import templateOnly from '@ember/component/template-only';
import { setComponentTemplate } from '@ember/component';
import { precompileTemplate } from '@ember/template-compilation';
import { concat } from '@ember/helper';
import { element } from 'ember-element-helper';
import style from 'ember-style-modifier/modifiers/style';
import { eq } from 'ember-truth-helpers';
import argOrDefault from '../helpers/arg-or-default.js';
import classNames from '../helpers/class-names.js';
import euiPageRestrictWidth from '../helpers/eui-page-restrict-width.js';
import EuiPanel from './eui-panel.js';

const EuiPageBody = setComponentTemplate(precompileTemplate(`
  {{#let
    (argOrDefault @restrictWidth false)
    (argOrDefault @tagName "div")
    (argOrDefault @borderRadius "none")
    (argOrDefault @paddingSize (if @panelled "l" "none"))
    as |restrictWidth tagName borderRadius paddingSize|
  }}

    {{#let (euiPageRestrictWidth restrictWidth @style) as |styling|}}
      {{#if @panelled}}
        <EuiPanel
          class={{classNames
            (if (eq borderRadius "none") "euiPageBody--borderRadiusNone")
            (if
              styling.widthClassName
              (concat "euiPageBody--" styling.widthClassName)
            )
            componentName="EuiPageBody"
            paddingSize=@paddingSize
          }}
          @paddingSize={{paddingSize}}
          @borderRadius={{borderRadius}}
          @color={{@color}}
          @hasBorder={{@hasBorder}}
          @hasShadow={{@hasShadow}}
          {{style styling.newStyle}}
          ...attributes
        >
          {{yield}}
        </EuiPanel>
      {{else}}
        {{#let (element tagName) as |Tag|}}
          <Tag
            class={{classNames
              (if (eq borderRadius "none") "euiPageBody--borderRadiusNone")
              (if
                styling.widthClassName
                (concat "euiPageBody--" styling.widthClassName)
              )
              componentName="EuiPageBody"
              paddingSize=@paddingSize
            }}
            {{style styling.newStyle}}
            {{!@glint-expect-error}}
            ...attributes
          >
            {{yield}}
          </Tag>
        {{/let}}
      {{/if}}
    {{/let}}
  {{/let}}
`, {
  strictMode: true,
  scope: () => ({
    argOrDefault,
    euiPageRestrictWidth,
    EuiPanel,
    classNames,
    eq,
    concat,
    style,
    element
  })
}), templateOnly("eui-page-body", "EuiPageBody"));

export { EuiPageBody as default };
//# sourceMappingURL=eui-page-body.js.map
