<?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;

/* @AkeneoPimEnrichment/Product/renderPdf.html.twig */
class __TwigTemplate_656503c64f4afb0c5c855314065bc29d extends Template
{
    private $source;
    private $macros = [];

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

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

        $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 = [])
    {
        $macros = $this->macros;
        // line 1
        yield "<!DOCTYPE html>
<html>
    <head>
        <title>";
        // line 4
        yield Twig\Extension\EscaperExtension::escape($this->env, CoreExtension::getAttribute($this->env, $this->source, ($context["product"] ?? null), "identifier", [], "any", false, false, false, 4), "html", null, true);
        yield " - ";
        yield Twig\Extension\EscaperExtension::escape($this->env, Twig\Extension\CoreExtension::dateFormatFilter($this->env, ($context["renderingDate"] ?? null)), "html", null, true);
        yield "</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
            yield "                @font-face {
                    font-family: \"Custom font\";
                    font-style: normal;
                    font-weight: 400;
                    src: url(";
            // line 12
            yield Twig\Extension\EscaperExtension::escape($this->env, ($context["customFont"] ?? null), "html", null, true);
            yield ") format('truetype');
                }
            ";
        }
        // line 15
        yield "
            body {
                font-family: \"Custom font\", \"DejaVu Sans\", monospace;
                font-weight: 400 !important;
                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%;
            }

            .attributes.pim_catalog_text.han-text .right-column,
            .attributes.pim_catalog_textarea.han-text .right-column {
                font-family: 'fireflysung', \"DejaVu Sans\", monospace;
            }

            table {
                table-layout: fixed;
                border-spacing : 0;
                border-collapse : collapse;
                margin-left: -250px;
                margin-top: 30px;
                width: 450px;
            }
            table > thead > tr > th,
            table > tbody > tr > td {
                font-size: 9px;
                height: 29px;
                padding: 0 10px;
                text-align: left;
            }
            table > thead > tr > th {
                background: #f0f1f3;
                border: 1px solid #e8ebee;
                font-weight: bold;
            }
            table > tbody > tr > td {
                border: 1px solid #e8ebee;
            }
            table > tbody > tr:nth-child(2n+1) > td {
                background: #f6f7fb;
            }

        </style>
    </head>
    <body>
        <div class=\"header\">
            ";
        // line 116
        yield from $this->unwrap()->yieldBlock('header', $context, $blocks);
        // line 120
        yield "        </div>
        <div class=\"images\">
            ";
        // line 122
        yield from $this->unwrap()->yieldBlock('images', $context, $blocks);
        // line 127
        yield "        </div>
        <div class=\"attribute-groups\">
            ";
        // line 129
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(($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 130
            yield "                ";
            yield from $this->unwrap()->yieldBlock('attribute_group', $context, $blocks);
            // line 161
            yield "            ";
            ++$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 162
        yield "        </div>
    </body>
</html>
";
        return; yield '';
    }

    // line 116
    public function block_header($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 117
        yield "                <h1>";
        yield Twig\Extension\EscaperExtension::escape($this->env, CoreExtension::getAttribute($this->env, $this->source, ($context["product"] ?? null), "getLabel", [($context["locale"] ?? null), ($context["scope"] ?? null)], "method", false, false, false, 117), "html", null, true);
        yield " ";
        (((CoreExtension::getAttribute($this->env, $this->source, ($context["product"] ?? null), "identifier", [], "any", false, false, false, 117) != CoreExtension::getAttribute($this->env, $this->source, ($context["product"] ?? null), "getLabel", [($context["locale"] ?? null), ($context["scope"] ?? null)], "method", false, false, false, 117))) ? (yield Twig\Extension\EscaperExtension::escape($this->env, (("(" . CoreExtension::getAttribute($this->env, $this->source, ($context["product"] ?? null), "identifier", [], "any", false, false, false, 117)) . ")"), "html", null, true)) : (yield ""));
        yield "</h1>
                <span class=\"rendering-date\">";
        // line 118
        yield Twig\Extension\EscaperExtension::escape($this->env, Twig\Extension\CoreExtension::dateFormatFilter($this->env, ($context["renderingDate"] ?? null)), "html", null, true);
        yield "</span>
            ";
        return; yield '';
    }

    // line 122
    public function block_images($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 123
        yield "                ";
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(($context["imagePaths"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["imagePath"]) {
            // line 124
            yield "                    <img src=\"media/cache/";
            yield Twig\Extension\EscaperExtension::escape($this->env, ($context["filter"] ?? null), "html", null, true);
            yield "/";
            yield Twig\Extension\EscaperExtension::escape($this->env, $context["imagePath"], "html", null, true);
            yield "\">
                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['imagePath'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 126
        yield "            ";
        return; yield '';
    }

    // line 130
    public function block_attribute_group($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 131
        yield "                    <div class=\"group\">
                        <h2>";
        // line 132
        yield Twig\Extension\EscaperExtension::escape($this->env, ($context["group"] ?? null), "html", null, true);
        yield "</h2>
                        ";
        // line 133
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(($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 134
            yield "                            ";
            yield from $this->unwrap()->yieldBlock('attribute', $context, $blocks);
            // line 158
            yield "                        ";
            ++$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 159
        yield "                    </div>
                ";
        return; yield '';
    }

    // line 134
    public function block_attribute($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 135
        yield "                                ";
        $context["locale_attribute"] = (((CoreExtension::getAttribute($this->env, $this->source, ($context["attribute"] ?? null), "isLocalizable", [], "any", false, false, false, 135) || CoreExtension::getAttribute($this->env, $this->source, ($context["attribute"] ?? null), "isLocaleSpecific", [], "any", false, false, false, 135))) ? (($context["locale"] ?? null)) : (null));
        // line 136
        yield "                                ";
        $context["channel_attribute"] = ((CoreExtension::getAttribute($this->env, $this->source, ($context["attribute"] ?? null), "isScopable", [], "any", false, false, false, 136)) ? (($context["scope"] ?? null)) : (null));
        // line 137
        yield "                                ";
        $context["content"] = CoreExtension::getAttribute($this->env, $this->source, ($context["product"] ?? null), "getValue", [CoreExtension::getAttribute($this->env, $this->source, ($context["attribute"] ?? null), "code", [], "any", false, false, false, 137), ($context["locale_attribute"] ?? null), ($context["channel_attribute"] ?? null)], "method", false, false, false, 137);
        // line 138
        yield "                                ";
        $context["manualHeight"] = true;
        // line 139
        yield "
                                ";
        // line 140
        if (((("pim_catalog_image" == CoreExtension::getAttribute($this->env, $this->source, ($context["attribute"] ?? null), "type", [], "any", false, false, false, 140)) && CoreExtension::getAttribute($this->env, $this->source, ($context["content"] ?? null), "data", [], "any", true, true, false, 140)) &&  !(null === CoreExtension::getAttribute($this->env, $this->source, ($context["content"] ?? null), "data", [], "any", false, false, false, 140)))) {
            // line 141
            yield "                                    ";
            $context["manualHeight"] = false;
            // line 142
            yield "                                ";
        }
        // line 143
        yield "
                                ";
        // line 144
        if (((($context["content"] ?? null) != null) && (($context["manualHeight"] ?? null) == true))) {
            // line 145
            yield "                                    ";
            $context["manualHeight"] = (Twig\Extension\CoreExtension::lengthFilter($this->env, CoreExtension::getAttribute($this->env, $this->source, ($context["attribute"] ?? null), "label", [], "any", false, false, false, 145)) > (Twig\Extension\CoreExtension::lengthFilter($this->env, Twig\Extension\CoreExtension::trimFilter(($context["content"] ?? null))) / 3));
            // line 146
            yield "                                ";
        }
        // line 147
        yield "
                                <div class=\"attributes ";
        // line 148
        yield Twig\Extension\EscaperExtension::escape($this->env, CoreExtension::getAttribute($this->env, $this->source, ($context["attribute"] ?? null), "type", [], "any", false, false, false, 148), "html", null, true);
        yield " ";
        if ($this->extensions['Akeneo\Pim\Enrichment\Bundle\Twig\AttributeExtension']->containsHanCharacters(($context["content"] ?? null))) {
            yield "han-text";
        }
        yield "\"
                                        ";
        // line 149
        if (($context["manualHeight"] ?? null)) {
            yield " style=\"height: ";
            yield Twig\Extension\EscaperExtension::escape($this->env, ((Twig\Extension\CoreExtension::round((Twig\Extension\CoreExtension::lengthFilter($this->env, CoreExtension::getAttribute($this->env, $this->source, ($context["attribute"] ?? null), "label", [], "any", false, false, false, 149)) / 30), 0, "ceil") * 18) + 10), "html", null, true);
            yield "px\"";
        }
        yield ">
                                    <div class=\"left-column\">
                                        ";
        // line 151
        yield Twig\Extension\EscaperExtension::escape($this->env, CoreExtension::getAttribute($this->env, $this->source, ($context["attribute"] ?? null), "label", [], "any", false, false, false, 151), "html", null, true);
        yield "
                                    </div>
                                    <div class=\"right-column\">
                                        ";
        // line 154
        yield $this->extensions['Akeneo\Pim\Enrichment\Bundle\PdfGeneration\Renderer\ProductValueRenderer\ProductValueRendererExtension']->renderAttributeValue($this->env, ($context["attribute"] ?? null), ($context["content"] ?? null), ($context["locale"] ?? null));
        yield "
                                    </div>
                                </div>
                            ";
        return; yield '';
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName()
    {
        return "@AkeneoPimEnrichment/Product/renderPdf.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array (  384 => 154,  378 => 151,  369 => 149,  361 => 148,  358 => 147,  355 => 146,  352 => 145,  350 => 144,  347 => 143,  344 => 142,  341 => 141,  339 => 140,  336 => 139,  333 => 138,  330 => 137,  327 => 136,  324 => 135,  320 => 134,  314 => 159,  300 => 158,  297 => 134,  280 => 133,  276 => 132,  273 => 131,  269 => 130,  264 => 126,  253 => 124,  248 => 123,  244 => 122,  237 => 118,  230 => 117,  226 => 116,  218 => 162,  204 => 161,  201 => 130,  184 => 129,  180 => 127,  178 => 122,  174 => 120,  172 => 116,  69 => 15,  63 => 12,  57 => 8,  55 => 7,  47 => 4,  42 => 1,);
    }

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