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

/* _includes/forms/button */
class __TwigTemplate_36ba8646d2ffbf2b045aea5acf344f4d extends Template
{
    private $source;
    private $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 = [])
    {
        $macros = $this->macros;
        craft\helpers\Template::beginProfile("template", "_includes/forms/button");
        // line 1
        $context["spinner"] = (($context["spinner"]) ?? (false));
        // line 2
        $context["busyMessage"] = (($context["busyMessage"]) ?? (false));
        // line 3
        $context["failureMessage"] = (($context["failureMessage"]) ?? (false));
        // line 4
        $context["retryMessage"] = (($context["retryMessage"]) ?? (false));
        // line 5
        $context["successMessage"] = (($context["successMessage"]) ?? (false));
        // line 6
        $context["label"] = (($context["label"]) ?? (null));
        // line 7
        $context["attributes"] = $this->extensions['craft\web\twig\Extension']->mergeFilter(["type" => ((        // line 8
$context["type"]) ?? ("button")), "id" => ((        // line 9
$context["id"]) ?? (false)), "class" => $this->extensions['craft\web\twig\Extension']->mergeFilter(craft\helpers\Html::explodeClass(((        // line 10
$context["class"]) ?? ([]))), $this->extensions['craft\web\twig\Extension']->filterFilter($this->env, [0 => "btn", 1 => "btngroup-btn-first", 2 => (( !        // line 13
(isset($context["label"]) || array_key_exists("label", $context) ? $context["label"] : (function () { throw new RuntimeError('Variable "label" does not exist.', 13, $this->source); })())) ? ("btn-empty") : (null))])), "data" => ["busy-message" =>         // line 16
(isset($context["busyMessage"]) || array_key_exists("busyMessage", $context) ? $context["busyMessage"] : (function () { throw new RuntimeError('Variable "busyMessage" does not exist.', 16, $this->source); })()), "failure-message" =>         // line 17
(isset($context["failureMessage"]) || array_key_exists("failureMessage", $context) ? $context["failureMessage"] : (function () { throw new RuntimeError('Variable "failureMessage" does not exist.', 17, $this->source); })()), "retry-message" =>         // line 18
(isset($context["retryMessage"]) || array_key_exists("retryMessage", $context) ? $context["retryMessage"] : (function () { throw new RuntimeError('Variable "retryMessage" does not exist.', 18, $this->source); })()), "success-message" =>         // line 19
(isset($context["successMessage"]) || array_key_exists("successMessage", $context) ? $context["successMessage"] : (function () { throw new RuntimeError('Variable "successMessage" does not exist.', 19, $this->source); })())]], ((        // line 21
$context["attributes"]) ?? ([])));
        // line 23
        ob_start();
        // line 24
        echo "    ";
        if ((isset($context["spinner"]) || array_key_exists("spinner", $context) ? $context["spinner"] : (function () { throw new RuntimeError('Variable "spinner" does not exist.', 24, $this->source); })())) {
            // line 25
            echo "        <div role=\"status\" class=\"visually-hidden\"></div>
    ";
        }
        // line 27
        echo "    ";
        ob_start();
        // line 28
        echo "        ";
        echo (((isset($context["label"]) || array_key_exists("label", $context) ? $context["label"] : (function () { throw new RuntimeError('Variable "label" does not exist.', 28, $this->source); })())) ? ($this->extensions['craft\web\twig\Extension']->tagFunction("div", ["class" => "label", "text" =>         // line 30
(isset($context["label"]) || array_key_exists("label", $context) ? $context["label"] : (function () { throw new RuntimeError('Variable "label" does not exist.', 30, $this->source); })())])) : (""));
        // line 31
        echo "
        ";
        // line 32
        if ((isset($context["spinner"]) || array_key_exists("spinner", $context) ? $context["spinner"] : (function () { throw new RuntimeError('Variable "spinner" does not exist.', 32, $this->source); })())) {
            // line 33
            echo "            <div class=\"spinner spinner-absolute\">
                <span class=\"visually-hidden\">";
            // line 34
            echo twig_escape_filter($this->env, $this->extensions['craft\web\twig\Extension']->translateFilter("Loading", "app"), "html", null, true);
            echo "</span>
            </div>
        ";
        }
        // line 37
        echo "    ";
        echo craft\helpers\Html::tag("button", ob_get_clean(),         // line 27
(isset($context["attributes"]) || array_key_exists("attributes", $context) ? $context["attributes"] : (function () { throw new RuntimeError('Variable "attributes" does not exist.', 27, $this->source); })()));
        $___internal_parse_1_ = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 23
        echo twig_spaceless($___internal_parse_1_);
        craft\helpers\Template::endProfile("template", "_includes/forms/button");
    }

    public function getTemplateName()
    {
        return "_includes/forms/button";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  96 => 23,  93 => 27,  91 => 37,  85 => 34,  82 => 33,  80 => 32,  77 => 31,  75 => 30,  73 => 28,  70 => 27,  66 => 25,  63 => 24,  61 => 23,  59 => 21,  58 => 19,  57 => 18,  56 => 17,  55 => 16,  54 => 13,  53 => 10,  52 => 9,  51 => 8,  50 => 7,  48 => 6,  46 => 5,  44 => 4,  42 => 3,  40 => 2,  38 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("{% set spinner = spinner ?? false -%}
{% set busyMessage = busyMessage ?? false %}
{% set failureMessage = failureMessage ?? false %}
{% set retryMessage = retryMessage ?? false %}
{% set successMessage = successMessage ?? false %}
{% set label = label ?? null %}
{% set attributes = {
    type: type ?? 'button',
    id: id ?? false,
    class: (class ?? [])|explodeClass|merge([
        'btn',
        'btngroup-btn-first',
        not label ? 'btn-empty' : null,
    ]|filter),
    data: {
        'busy-message': busyMessage,
        'failure-message': failureMessage,
        'retry-message': retryMessage,
        'success-message': successMessage,
    }
}|merge(attributes ?? {}) -%}

{% apply spaceless %}
    {% if spinner %}
        <div role=\"status\" class=\"visually-hidden\"></div>
    {% endif %}
    {% tag 'button' with attributes %}
        {{ label ? tag('div', {
            class: 'label',
            text: label,
        }) }}
        {% if spinner %}
            <div class=\"spinner spinner-absolute\">
                <span class=\"visually-hidden\">{{ 'Loading'|t('app') }}</span>
            </div>
        {% endif %}
    {% endtag %}
{% endapply -%}
", "_includes/forms/button", "/home/addons/atweb.space/sub/craft-demo/cms/vendor/craftcms/cms/src/templates/_includes/forms/button.twig");
    }
}
