<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
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;

/* @SuluWebsite/Sitemap/sitemap.xml.twig */
class __TwigTemplate_9b4bea362f1dfae991f3236c25ccab7b49ad164c296b2d599dff714bf01bde77 extends Template
{
    private $source;
    private $macros = [];

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

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

        $this->parent = false;

        $this->blocks = [
            'namespaces' => [$this, 'block_namespaces'],
            'url' => [$this, 'block_url'],
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@SuluWebsite/Sitemap/sitemap.xml.twig"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@SuluWebsite/Sitemap/sitemap.xml.twig"));

        // line 1
        ob_start();
        // line 2
        echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<urlset xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" ";
        // line 3
        $this->displayBlock('namespaces', $context, $blocks);
        echo ">
    ";
        // line 4
        $context["registrableDomain"] = twig_get_attribute($this->env, $this->source, tld_extract((isset($context["domain"]) || array_key_exists("domain", $context) ? $context["domain"] : (function () { throw new RuntimeError('Variable "domain" does not exist.', 4, $this->source); })())), "registrableDomain", [], "any", false, false, false, 4);
        // line 5
        echo "
    ";
        // line 6
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["entries"]) || array_key_exists("entries", $context) ? $context["entries"] : (function () { throw new RuntimeError('Variable "entries" does not exist.', 6, $this->source); })()));
        $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["entry"]) {
            // line 7
            echo "        ";
            $context["location"] = twig_get_attribute($this->env, $this->source, $context["entry"], "loc", [], "any", false, false, false, 7);
            // line 8
            echo "
        ";
            // line 9
            if ((0 === twig_compare(twig_get_attribute($this->env, $this->source, tld_extract((isset($context["location"]) || array_key_exists("location", $context) ? $context["location"] : (function () { throw new RuntimeError('Variable "location" does not exist.', 9, $this->source); })())), "registrableDomain", [], "any", false, false, false, 9), (isset($context["registrableDomain"]) || array_key_exists("registrableDomain", $context) ? $context["registrableDomain"] : (function () { throw new RuntimeError('Variable "registrableDomain" does not exist.', 9, $this->source); })())))) {
                // line 10
                echo "            <url>
                ";
                // line 11
                $this->displayBlock('url', $context, $blocks);
                // line 42
                echo "            </url>
        ";
            }
            // line 44
            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['entry'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 45
        echo "</urlset>
";
        $___internal_f3be120376f705d8d6b2771745988d09fbc8374e4c442ebfc80e6b65b689902a_ = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 1
        echo twig_spaceless($___internal_f3be120376f705d8d6b2771745988d09fbc8374e4c442ebfc80e6b65b689902a_);
        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

    }

    // line 3
    public function block_namespaces($context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "namespaces"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "namespaces"));

        echo "xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

    }

    // line 11
    public function block_url($context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "url"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "url"));

        // line 12
        echo "                    <loc>";
        echo twig_escape_filter($this->env, (isset($context["location"]) || array_key_exists("location", $context) ? $context["location"] : (function () { throw new RuntimeError('Variable "location" does not exist.', 12, $this->source); })()), "html", null, true);
        echo "</loc>
                    ";
        // line 13
        if (twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 13, $this->source); })()), "lastmod", [], "any", false, false, false, 13)) {
            // line 14
            echo "                        <lastmod>";
            echo twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 14, $this->source); })()), "lastmod", [], "any", false, false, false, 14), "Y-m-d"), "html", null, true);
            echo "</lastmod>
                    ";
        }
        // line 16
        echo "                    ";
        if (twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 16, $this->source); })()), "changefreq", [], "any", false, false, false, 16)) {
            // line 17
            echo "                        <changefreq>";
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 17, $this->source); })()), "changefreq", [], "any", false, false, false, 17), "html", null, true);
            echo "</changefreq>
                    ";
        }
        // line 19
        echo "                    ";
        if (twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 19, $this->source); })()), "priority", [], "any", false, false, false, 19)) {
            // line 20
            echo "                        <priority>";
            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 20, $this->source); })()), "priority", [], "any", false, false, false, 20), "html", null, true);
            echo "</priority>
                    ";
        }
        // line 22
        echo "
                    ";
        // line 23
        $context["amount"] = 0;
        // line 24
        echo "                    ";
        $context["defaultHref"] = null;
        // line 25
        echo "                    ";
        if ((1 === twig_compare(twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 25, $this->source); })()), "alternateLinks", [], "any", false, false, false, 25)), 1))) {
            // line 26
            echo "                        ";
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 26, $this->source); })()), "alternateLinks", [], "any", false, false, false, 26));
            foreach ($context['_seq'] as $context["_key"] => $context["alternateLink"]) {
                // line 27
                echo "                            ";
                $context["href"] = twig_get_attribute($this->env, $this->source, $context["alternateLink"], "href", [], "any", false, false, false, 27);
                // line 28
                echo "                            ";
                if (( !twig_test_empty((isset($context["href"]) || array_key_exists("href", $context) ? $context["href"] : (function () { throw new RuntimeError('Variable "href" does not exist.', 28, $this->source); })())) && (0 === twig_compare(twig_get_attribute($this->env, $this->source, tld_extract((isset($context["href"]) || array_key_exists("href", $context) ? $context["href"] : (function () { throw new RuntimeError('Variable "href" does not exist.', 28, $this->source); })())), "registrableDomain", [], "any", false, false, false, 28), (isset($context["registrableDomain"]) || array_key_exists("registrableDomain", $context) ? $context["registrableDomain"] : (function () { throw new RuntimeError('Variable "registrableDomain" does not exist.', 28, $this->source); })()))))) {
                    // line 29
                    echo "                                <xhtml:link rel=\"alternate\" hreflang=\"";
                    echo twig_escape_filter($this->env, twig_replace_filter(twig_get_attribute($this->env, $this->source, $context["alternateLink"], "locale", [], "any", false, false, false, 29), ["_" => "-"]), "html", null, true);
                    echo "\" href=\"";
                    echo twig_escape_filter($this->env, (isset($context["href"]) || array_key_exists("href", $context) ? $context["href"] : (function () { throw new RuntimeError('Variable "href" does not exist.', 29, $this->source); })()), "html", null, true);
                    echo "\"/>
                                ";
                    // line 30
                    $context["amount"] = ((isset($context["amount"]) || array_key_exists("amount", $context) ? $context["amount"] : (function () { throw new RuntimeError('Variable "amount" does not exist.', 30, $this->source); })()) + 1);
                    // line 31
                    echo "                                ";
                    if ((0 === twig_compare(twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 31, $this->source); })()), "defaultLocale", [], "any", false, false, false, 31), twig_get_attribute($this->env, $this->source, $context["alternateLink"], "locale", [], "any", false, false, false, 31)))) {
                        // line 32
                        echo "                                    ";
                        $context["defaultHref"] = (isset($context["href"]) || array_key_exists("href", $context) ? $context["href"] : (function () { throw new RuntimeError('Variable "href" does not exist.', 32, $this->source); })());
                        // line 33
                        echo "                                ";
                    }
                    // line 34
                    echo "                            ";
                }
                // line 35
                echo "                        ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['alternateLink'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 36
            echo "                    ";
        }
        // line 37
        echo "
                    ";
        // line 38
        if (((isset($context["defaultHref"]) || array_key_exists("defaultHref", $context) ? $context["defaultHref"] : (function () { throw new RuntimeError('Variable "defaultHref" does not exist.', 38, $this->source); })()) && (1 === twig_compare((isset($context["amount"]) || array_key_exists("amount", $context) ? $context["amount"] : (function () { throw new RuntimeError('Variable "amount" does not exist.', 38, $this->source); })()), 0)))) {
            // line 39
            echo "                        <xhtml:link rel=\"alternate\" hreflang=\"x-default\" href=\"";
            echo twig_escape_filter($this->env, (isset($context["defaultHref"]) || array_key_exists("defaultHref", $context) ? $context["defaultHref"] : (function () { throw new RuntimeError('Variable "defaultHref" does not exist.', 39, $this->source); })()), "html", null, true);
            echo "\"/>
                    ";
        }
        // line 41
        echo "                ";
        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

    }

    public function getTemplateName()
    {
        return "@SuluWebsite/Sitemap/sitemap.xml.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  244 => 41,  238 => 39,  236 => 38,  233 => 37,  230 => 36,  224 => 35,  221 => 34,  218 => 33,  215 => 32,  212 => 31,  210 => 30,  203 => 29,  200 => 28,  197 => 27,  192 => 26,  189 => 25,  186 => 24,  184 => 23,  181 => 22,  175 => 20,  172 => 19,  166 => 17,  163 => 16,  157 => 14,  155 => 13,  150 => 12,  140 => 11,  121 => 3,  111 => 1,  107 => 45,  93 => 44,  89 => 42,  87 => 11,  84 => 10,  82 => 9,  79 => 8,  76 => 7,  59 => 6,  56 => 5,  54 => 4,  50 => 3,  47 => 2,  45 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("{% apply spaceless %}
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<urlset xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" {% block namespaces %}xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"{% endblock %}>
    {% set registrableDomain = sulu_util_domain_info(domain).registrableDomain %}

    {% for entry in entries %}
        {% set location = entry.loc %}

        {% if sulu_util_domain_info(location).registrableDomain == registrableDomain %}
            <url>
                {% block url %}
                    <loc>{{ location }}</loc>
                    {% if entry.lastmod %}
                        <lastmod>{{ entry.lastmod|date('Y-m-d') }}</lastmod>
                    {% endif %}
                    {% if entry.changefreq %}
                        <changefreq>{{ entry.changefreq }}</changefreq>
                    {% endif %}
                    {% if entry.priority %}
                        <priority>{{ entry.priority }}</priority>
                    {% endif %}

                    {% set amount = 0 %}
                    {% set defaultHref = null %}
                    {% if entry.alternateLinks|length > 1 %}
                        {% for alternateLink in entry.alternateLinks %}
                            {% set href = alternateLink.href %}
                            {% if href is not empty and sulu_util_domain_info(href).registrableDomain == registrableDomain %}
                                <xhtml:link rel=\"alternate\" hreflang=\"{{ alternateLink.locale|replace({'_': '-'}) }}\" href=\"{{ href }}\"/>
                                {% set amount = amount + 1 %}
                                {% if entry.defaultLocale == alternateLink.locale %}
                                    {% set defaultHref = href %}
                                {% endif %}
                            {% endif %}
                        {% endfor %}
                    {% endif %}

                    {% if defaultHref and amount > 0 %}
                        <xhtml:link rel=\"alternate\" hreflang=\"x-default\" href=\"{{ defaultHref }}\"/>
                    {% endif %}
                {% endblock %}
            </url>
        {% endif %}
    {% endfor %}
</urlset>
{% endapply %}
", "@SuluWebsite/Sitemap/sitemap.xml.twig", "/home/lepronl/project/opizzicato/vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/Resources/views/Sitemap/sitemap.xml.twig");
    }
}
