import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import didInsert from '@ember/render-modifiers/modifiers/did-insert';
import optional from 'ember-composable-helpers/helpers/optional';
import { and, not, or } from 'ember-truth-helpers';
import randomId from '../-private/random-id.js';
import argOrDefault from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';

const EuiRadio = setComponentTemplate(precompileTemplate(`
  {{#let
    (and (has-block "label") (not (argOrDefault @isFakeLabelBlock false)))
    (argOrDefault @id (randomId))
    as |hasLabelBlock id|
  }}
    {{#let
      (classNames
        @containerClass
        (if (not (or hasLabelBlock @label)) "euiRadio--noLabel")
        (if @compressed "euiRadio--compressed")
        "euiRadio"
      )
      as |classes|
    }}
      <div class={{classes}}>
        <input
          class="euiRadio__input"
          type="radio"
          id={{id}}
          checked={{@checked}}
          disabled={{@disabled}}
          name={{@name}}
          {{didInsert (optional @inputRef)}}
          ...attributes
        />
        <div class="euiRadio__circle"></div>
        {{#if (or hasLabelBlock @label)}}
          <label
            class={{classNames "euiRadio__label" @labelProps.className}}
            for={{id}}
          >
            {{#if hasLabelBlock}}
              {{yield to="label"}}
            {{else}}
              {{@label}}
            {{/if}}
          </label>
        {{/if}}
      </div>
    {{/let}}
  {{/let}}
`, {
  strictMode: true,
  scope: () => ({
    and,
    not,
    argOrDefault,
    randomId,
    classNames,
    or,
    didInsert,
    optional
  })
}), templateOnly("eui-radio", "EuiRadio"));

export { EuiRadio as default };
//# sourceMappingURL=eui-radio.js.map
