import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { on } from '@ember/modifier';
import { or } from 'ember-truth-helpers';
import EuiButton from './eui-button.js';
import EuiButtonEmpty from './eui-button-empty.js';
import EuiModal from './eui-modal.js';
import EuiModalBody from './eui-modal-body.js';
import EuiModalFooter from './eui-modal-footer.js';
import EuiModalHeader from './eui-modal-header.js';
import EuiModalHeaderTitle from './eui-modal-header-title.js';
import EuiTextComponent from './eui-text.js';

const EuiConfirmModal = setComponentTemplate(precompileTemplate(`
    <EuiModal
      class="euiModal--confirmation"
      @onClose={{@onCancel}}
      ...attributes
    >

      {{#if (or @title (has-block "title"))}}
        <EuiModalHeader>
          <EuiModalHeaderTitle>
            {{@title}}
            {{yield to="title"}}
          </EuiModalHeaderTitle>
        </EuiModalHeader>
      {{/if}}

      {{#if (or @message (has-block))}}
        <EuiModalBody>
          <EuiText>
            {{@message}}
            {{yield}}
          </EuiText>
        </EuiModalBody>
      {{/if}}

      <EuiModalFooter>
        <EuiButtonEmpty {{on "click" @onCancel}}>
          {{@cancelButtonText}}
        </EuiButtonEmpty>
        <EuiButton
          @fill={{true}}
          @color={{@buttonColor}}
          @isDisabled={{@confirmButtonDisabled}}
          @isLoading={{@isLoading}}
          {{on "click" @onConfirm}}
        >
          {{@confirmButtonText}}
        </EuiButton>
      </EuiModalFooter>

    </EuiModal>
  `, {
  strictMode: true,
  scope: () => ({
    EuiModal,
    or,
    EuiModalHeader,
    EuiModalHeaderTitle,
    EuiModalBody,
    EuiText: EuiTextComponent,
    EuiModalFooter,
    EuiButtonEmpty,
    on,
    EuiButton
  })
}), templateOnly("eui-confirm-modal", "EuiConfirmModal"));

export { EuiConfirmModal as default };
//# sourceMappingURL=eui-confirm-modal.js.map
