import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { and, or } from 'ember-truth-helpers';
import argOrDefault from '../helpers/arg-or-default.js';
import EuiFormControlLayout from './eui-form-control-layout.js';
import EuiTextComponent from './eui-text.js';

const EuiFormControlLayoutDelimited = setComponentTemplate(precompileTemplate(`
    {{#let
      (has-block "prepend")
      (has-block "append")
      (has-block "delimiter")
      (argOrDefault @delimiter "→")
      (argOrDefault @useGroup true)
      as |hasPrepend hasAppend hasDelimeterBlock delimiter useGroup|
    }}
      <EuiFormControlLayout
        class="euiFormControlLayoutDelimited"
        @icon={{@icon}}
        @clear={{@clear}}
        @fullWidth={{@fullWidth}}
        @isLoading={{@isLoading}}
        @compressed={{@compressed}}
        @readOnly={{@readOnly}}
        @disabled={{@disabled}}
        @useGroup={{and useGroup (or hasPrepend hasAppend)}}
      >
        <:prepend as |prependClasses|>
          {{yield prependClasses to="prepend"}}
        </:prepend>
        <:field>
          {{yield "euiFormControlLayoutDelimited__input" to="startControl"}}
          <EuiText
            class="euiFormControlLayoutDelimited__delimeter"
            @size="s"
            @color="subdued"
          >
            {{#if (or delimiter hasDelimeterBlock)}}
              {{#if hasDelimeterBlock}}
                {{yield to="delimiter"}}
              {{else}}
                {{delimiter}}
              {{/if}}
            {{/if}}
          </EuiText>
          {{yield "euiFormControlLayoutDelimited__input" to="endControl"}}
        </:field>
        <:append as |appendClasses|>
          {{yield appendClasses to="append"}}
        </:append>
      </EuiFormControlLayout>
    {{/let}}
  `, {
  strictMode: true,
  scope: () => ({
    argOrDefault,
    EuiFormControlLayout,
    and,
    or,
    EuiText: EuiTextComponent
  })
}), templateOnly("eui-form-control-layout-delimited", "EuiFormControlLayoutDelimited"));

export { EuiFormControlLayoutDelimited as default };
//# sourceMappingURL=eui-form-control-layout-delimited.js.map
