{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template block_xp/advanced-heading

    Advanced heading.

    Example context (json):
    {
        "title": "Title here"
    }
}}
<div class="xp-flex xp-mb-6 xp-gap-4">
    <div class="xp-grow">
        <div>
            <{{#islevel2}}h2{{/islevel2}}{{^islevel2}}h3{{/islevel2}} class="xp-m-0">{{ title }}
                {{#hasvisibility}}
                    {{#isvisible}}
                        <span data-bs-toggle="tooltip" data-toggle="tooltip" class="xp-inline-block xp-text-base xp-leading-none"
                                title="{{#str}} pagecurrentvisibletoviewers, block_xp {{/str}}">
                            <span class="xp-sr-only">{{#str}} pagecurrentvisibletoviewers, block_xp {{/str}}</span>
                            <i class="fa fa-eye" aria-hidden="true"></i>
                        </span>
                    {{/isvisible}}
                    {{^isvisible}}
                        <span data-bs-toggle="tooltip" data-toggle="tooltip" class="xp-inline-block xp-text-base xp-leading-none"
                                title="{{#str}} pagecurrentnotvisibletoviewers, block_xp {{/str}}">
                            <span class="xp-sr-only">{{#str}} pagecurrentnotvisibletoviewers, block_xp {{/str}}</span>
                            <i class="fa fa-eye-slash" aria-hidden="true"></i>
                        </span>
                    {{/isvisible}}
                {{/hasvisibility}}
            </{{#islevel2}}h2{{/islevel2}}{{^islevel2}}h3{{/islevel2}}>
            {{#hasintro}}
            <div class="xp-text-sm xp-text-gray-500 xp-mt-2">
                {{ intro }}
                {{#helpicon}}
                    {{> core/help_icon }}
                {{/helpicon}}
            </div>
            {{/hasintro}}
        </div>
    </div>
    <div class="xp-flex xp-flex-wrap xp-gap-4 xp-items-start xp-whitespace-nowrap" data-region="block_xp-page_menu">
        {{# actions }}
            {{{.}}}
        {{/ actions }}
        {{# hasmenu }}
        <div class="dropdown">
            <button class="btn btn-link btn-icon icon-size-3 rounded-circle" data-bs-toggle="dropdown" data-toggle="dropdown" type="button" aria-expanded="false">
                <i class="fa fa-ellipsis-v text-dark py-2" aria-hidden="true"></i>
                <span class="xp-sr-only">{{#str}}menu, block_xp{{/str}}</span>
            </button>
            <div class="dropdown-menu dropdown-menu-right dropdown-menu-end">
                {{# menuitems }}
                    {{#isdivider}}<div class="dropdown-divider"></div>{{/isdivider}}
                    {{^isdivider}}
                    <a class="dropdown-item
                        {{#disabled}}disabled xp-not-italic{{/disabled}}
                        {{#classes}}{{.}} {{/classes}}"
                        {{#attributes}}{{name}}="{{value}}" {{/attributes}}>
                        <div class="xp-flex xp-w-full xp-gap-2">
                            <div class="xp-grow">
                                {{ label }}
                            </div>
                            {{# addonrequired }}
                            <div class="xp-flex-0">
                                <span class="xp-py-0.5 xp-px-1 xp-not-italic xp-normal-case xp-text-2xs xp-inline-block xp-bg-black xp-text-white xp-rounded xp-no-underline xp-font-normal xp-align-middle">XP+</span>
                            </div>
                            {{/ addonrequired }}
                        </div>
                    </a>
                    {{/isdivider}}
                {{/ menuitems }}
            </div>
        </div>
        {{/hasmenu}}
    </div>
</div>
