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

/* graph/graph_cost.html.twig */
class __TwigTemplate_47b7a7558120e814e1efd2702a81d6c6 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->blocks = [
            'page_title' => [$this, 'block_page_title'],
            'page_content' => [$this, 'block_page_content'],
            'javascripts' => [$this, 'block_javascripts'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 1
        return "@AdminLTE/layout/mesodd-layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/layout/mesodd-layout.html.twig", 1);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_title(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("graph.cost.title", [], "messages");
        yield from [];
    }

    // line 6
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_content(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 7
        yield "
    ";
        // line 8
        yield from $this->load("graph/graph_cost.html.twig", 8, 1066408299)->unwrap()->yield($context);
        // line 15
        yield "
    ";
        // line 16
        if ((($tmp = ($context["type"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 17
            yield "    ";
            yield from $this->load("graph/graph_cost.html.twig", 17, 830017144)->unwrap()->yield($context);
            // line 22
            yield "    ";
        }
        // line 23
        yield "
";
        yield from [];
    }

    // line 26
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_javascripts(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 27
        yield "<script>
        let \$type = \$('#ministry_sel_type');

        \$type.change(function() {
            let \$form = \$type.closest('form');

            let data = {};
            data[\$type.attr('name')] = \$type.val();

            \$.ajax({
                url: \$form.attr('action'),
                type: \$form.attr('method'),
                data: data,
                success: function(html) {
                    \$('#ministry_sel_entite').replaceWith(
                        \$(html).find('#ministry_sel_entite')
                    );
                }
            });
        });
    </script>
  ";
        // line 48
        if ((($tmp = ($context["type"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 49
            yield "    <script>
        \$(function () {

            var donutChartCanvas = \$('#donutChart').get(0).getContext('2d')
            var donutData        = {
                labels: ";
            // line 54
            if ((($tmp = ($context["donutChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                yield json_encode((($_v0 = ($context["donutChart"] ?? null)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["labels"] ?? null) : null));
            } else {
                yield " []";
            }
            yield ",
                datasets: [
                    {
                        data: ";
            // line 57
            if ((($tmp = ($context["donutChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                yield json_encode((($_v1 = ($context["donutChart"] ?? null)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["percents"] ?? null) : null));
            } else {
                yield " []";
            }
            yield ",
                        backgroundColor: ";
            // line 58
            if ((($tmp = ($context["donutChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                yield json_encode((($_v2 = ($context["donutChart"] ?? null)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2["bgColor"] ?? null) : null));
            } else {
                yield " []";
            }
            yield ",
                    }
                ]
            }
            var donutOptions     = {
                maintainAspectRatio: false,
                responsive: true,
                plugins: {
                    datalabels: {
                        backgroundColor: ";
            // line 67
            if ((($tmp = ($context["donutChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                yield json_encode((($_v3 = ($context["donutChart"] ?? null)) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3["bgColor"] ?? null) : null));
            } else {
                yield " []";
            }
            yield ",
\t\t\t\t\t\tborderColor: 'white',
\t\t\t\t\t\tborderRadius: 25,
\t\t\t\t\t\tborderWidth: 2,
                        color: 'white',
                        font: {
                            weight: 'bold',
                            size: 12,
                        },
                        align: 'center',
                        anchor: 'end',
                    }
                }
            }

            var donutChart = new Chart(donutChartCanvas, {
                type: 'doughnut',
                data: donutData,
                options: donutOptions      
            })
              
        })
    </script>
";
        }
        // line 91
        yield "
    <script src=\"";
        // line 92
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/chart.js/Chart.min.js"), "html", null, true);
        yield "\"></script>
    <script src=\"";
        // line 93
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/chartjs-plugin-datalabels/chartjs-plugin-datalabels.min.js"), "html", null, true);
        yield "\"></script>
    
";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "graph/graph_cost.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  204 => 93,  200 => 92,  197 => 91,  166 => 67,  150 => 58,  142 => 57,  132 => 54,  125 => 49,  123 => 48,  100 => 27,  93 => 26,  87 => 23,  84 => 22,  81 => 17,  79 => 16,  76 => 15,  74 => 8,  71 => 7,  64 => 6,  53 => 3,  42 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "graph/graph_cost.html.twig", "/var/www/html/templates/graph/graph_cost.html.twig");
    }
}


/* graph/graph_cost.html.twig */
class __TwigTemplate_47b7a7558120e814e1efd2702a81d6c6___1066408299 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->blocks = [
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 8
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 8);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 9
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 10
        yield "            ";
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
        yield "
                ";
        // line 11
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(($context["form"] ?? null), 'widget');
        yield "
            ";
        // line 12
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
        yield "    
        ";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "graph/graph_cost.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  292 => 12,  288 => 11,  283 => 10,  276 => 9,  265 => 8,  204 => 93,  200 => 92,  197 => 91,  166 => 67,  150 => 58,  142 => 57,  132 => 54,  125 => 49,  123 => 48,  100 => 27,  93 => 26,  87 => 23,  84 => 22,  81 => 17,  79 => 16,  76 => 15,  74 => 8,  71 => 7,  64 => 6,  53 => 3,  42 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "graph/graph_cost.html.twig", "/var/www/html/templates/graph/graph_cost.html.twig");
    }
}


/* graph/graph_cost.html.twig */
class __TwigTemplate_47b7a7558120e814e1efd2702a81d6c6___830017144 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->blocks = [
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 17
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 17);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 18
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 19
        yield "            <canvas id=\"donutChart\" style=\"height:70vh\"></canvas>
        ";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "graph/graph_cost.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  370 => 19,  363 => 18,  352 => 17,  292 => 12,  288 => 11,  283 => 10,  276 => 9,  265 => 8,  204 => 93,  200 => 92,  197 => 91,  166 => 67,  150 => 58,  142 => 57,  132 => 54,  125 => 49,  123 => 48,  100 => 27,  93 => 26,  87 => 23,  84 => 22,  81 => 17,  79 => 16,  76 => 15,  74 => 8,  71 => 7,  64 => 6,  53 => 3,  42 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "graph/graph_cost.html.twig", "/var/www/html/templates/graph/graph_cost.html.twig");
    }
}
