{{! make the _globals object in course.json available to this template}}
{{import_globals}}

<div {{#each _attributes}}{{@key}}="{{this}}" {{/each}} class="notify__popup notify__popup-type-{{_type}}{{#if _classes}} {{_classes}}{{/if}}">
  <div class="notify__popup-inner">

    <div class="notify__content">
      <div class="notify__content-inner">

        {{#if _showIcon}}
        <div class="notify__icon">
          <div class="icon{{#equals _type "prompt"}} is-prompt{{/equals}}{{#equals _type "alert"}} is-alert{{/equals}}"></div>
        </div>
        {{/if}}

        {{#if title}}
        <div class="notify__title" id="notify-heading">
          <div class="notify__title-inner" {{{a11y_attrs_heading 'notify'}}}>
            {{{compile title}}}
          </div>
        </div>
        {{/if}}

        {{#if body}}
        <div class="notify__body">
          <div class="notify__body-inner">
            {{{compile body}}}
          </div>
        </div>
        {{/if}}

        {{#equals _type "alert"}}
        <div class="notify__btn-container">
          <button class="btn-text notify__btn notify__btn-alert js-notify-btn-alert" aria-label="{{{confirmText}}}">
            {{{confirmText}}}
          </button>
        </div>
        {{/equals}}

        {{#equals _type "prompt"}}
        <div class="notify__btn-container">
          {{#each _prompts}}
          <button class="btn-text notify__btn notify__btn-prompt js-notify-btn-prompt" data-event="{{_callbackEvent}}" aria-label="{{{promptText}}}">
            {{{promptText}}}
          </button>
          {{/each}}
        </div>
        {{/equals}}

      </div>
    </div>

    {{! toolbar moved for AA purposes - last tabbable element}}
    {{#all _isCancellable _showCloseButton}}
    {{#equals _type "popup"}}
    <button class="btn-icon notify__btn-icon notify__close-btn js-notify-close-btn" aria-label="{{_globals._accessibility._ariaLabels.closePopup}}">
      <div class="icon"></div>
    </button>
    {{/equals}}
    {{/all}}

  </div>

  {{{a11y_wrap_focus}}}

</div>

<div class="shadow notify__shadow js-notify-shadow-click"></div>
