import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { and, not, or, eq } from 'ember-truth-helpers';
import argOrDefault from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';
import EuiButtonContent from './eui-button-content.js';

const EuiButtonEmpty = setComponentTemplate(precompileTemplate(`
    {{#let
      (argOrDefault @size "m") (argOrDefault @iconSize "m")
      as |size iconSize|
    }}
      {{#if (and @href (not (or @isLoading @isDisabled)))}}
        <a
          class={{classNames
            (if (or @isLoading @isDisabled) "euiButtonEmpty-isDisabled")
            componentName="EuiButtonEmpty"
            color=(argOrDefault @color "primary")
            size=size
            flush=@flush
          }}
          href={{@href}}
          target={{@target}}
          ...attributes
        >
          <EuiButtonContent
            class="euiButtonEmpty__content {{@contentClasses}}"
            @isLoading={{@isLoading}}
            @iconType={{@iconType}}
            @iconSide={{@iconSide}}
            @iconSize={{if (eq size "xs") "s" iconSize}}
            @iconClasses={{@iconClasses}}
            @useSvg={{@useSvg}}
            @useComponent={{@useComponent}}
            @textClasses={{classNames "euiButtonEmpty__text" @textClasses}}
          >
            {{yield}}
          </EuiButtonContent>
        </a>
      {{else}}
        <button
          class={{classNames
            (if (or @isLoading @isDisabled) "euiButtonEmpty-isDisabled")
            componentName="EuiButtonEmpty"
            color=(argOrDefault @color "primary")
            size=size
            flush=@flush
          }}
          disabled={{or @isLoading @isDisabled @disabled}}
          type={{if @type @type "button"}}
          aria-pressed={{@isSelected}}
          ...attributes
        >
          <EuiButtonContent
            class="euiButtonEmpty__content {{@contentClasses}}"
            @isLoading={{@isLoading}}
            @iconType={{@iconType}}
            @iconSide={{@iconSide}}
            @iconSize={{if (eq size "xs") "s" iconSize}}
            @iconClasses={{@iconClasses}}
            @useSvg={{@useSvg}}
            @useComponent={{@useComponent}}
            @textClasses={{classNames "euiButtonEmpty__text" @textClasses}}
          >
            {{yield}}
          </EuiButtonContent>
        </button>
      {{/if}}
    {{/let}}
  `, {
  strictMode: true,
  scope: () => ({
    argOrDefault,
    and,
    not,
    or,
    classNames,
    EuiButtonContent,
    eq
  })
}), templateOnly("eui-button-empty", "EuiButtonEmpty"));

export { EuiButtonEmpty as default };
//# sourceMappingURL=eui-button-empty.js.map
