// #region Imports
import { html } from '../../../../Dom/Html';
import { Icons } from '../../../../Resources/Icons';
import { when } from '../../../Directives/Directives';
import { styleSheetVar } from '../../../Directives/StyleSheetVarDirective';
import { Appearance } from '../../../Types/Appearance';
import { IconPosition } from '../../../Types/IconPosition';
import { Placement } from '../../../Types/Placement';
import { Size } from '../../../Types/Size';
// #endregion
/**
 * The template of the {@link SplitButtonElement}.
 *
 * @public
 */
export function splitButtonElementTemplate(e) {
    return html `
        <div>
        ${when(!e.disabled, () => html `
        <mosaik-focus-ring part="focusRing"
                           .variant="${e.variant}"
                           .visible="${e.isFocused}"
                           .controlled="${'manual'}"
                           .for="${'button'}"></mosaik-focus-ring>
        `)}
        <button id="button"
                part="button"
                type="${e.type}">
            ${when(!e.disabled, () => html `
            <mosaik-ripple part="ripple"
                           .variant="${e.variant}"
                           .for="${'button'}"></mosaik-ripple>
            `)}
            <mosaik-stack orientation="${e.orientation}"
                          vertical-alignment="${e.verticalContentAlignment}"
                          horizontal-alignment="${e.horizontalContentAlignment}"
                          .gap="${styleSheetVar('--split-button-gap')}"
                          ?reverse="${e.iconPosition === IconPosition.After}">
                <slot name="icon">
                ${when(e.icon, () => html `
                    <mosaik-icon part="icon"
                                 .appearance="${Appearance.Plain}"
                                 .variant="${e.variant}"
                                 .data="${e.icon}"
                                 .size="${e.iconSize ?? e.size}"
                                 ?inline="${true}"
                                 ?disabled="${e.disabled}"></mosaik-icon>
                `)}
                </slot>
                <slot name="label">
                ${when(e.label, () => html `
                    <mosaik-text part="label"
                                 .text="${e.label}"
                                 .variant="${e.variant}"
                                 ?disabled="${e.disabled}"></mosaik-text>
                `)}
                </slot>
            </mosaik-stack>
        </button>
        ${when(e.isBusy, () => html `
        <mosaik-progress-ring part="progressRing"
                              .thickness="${'2px'}"
                              .radius="${'12px'}"
                              .variant="${e.variant}"
                              .isIndeterminate="${true}"
                              ?disabled="${e.disabled}"></mosaik-progress-ring>
        `)}
        </div>
        <button part="buttonSplit"
                id="button_split"
                @click="${(x) => e.onSplit(x)}">
            ${when(!e.disabled, () => html `
            <mosaik-focus-ring part="focusRing"
                               .variant="${e.variant}"></mosaik-focus-ring>
            <mosaik-ripple part="ripple"
                           .variant="${e.variant}"
                           .for="${'button_split'}"></mosaik-ripple>
            `)}
            <mosaik-icon part="iconCaret"
                         slot="suffix"
                         .inline="${true}"
                         .size="${Size.Small}"
                         .data="${Icons.caretDown}"
                         .appearance="${Appearance.Plain}"
                         .variant="${e.variant}"
                         ?disabled="${e.disabled}"></mosaik-icon>
        </button>
        <slot name="overlay"></slot>
        <mosaik-floating part="popup"
                         .anchor="${'button_split'}"
                         .placement="${e.dropDownPlacement}"
                         .distance="${e.dropDownDistance}"
                         .skidding="${e.dropDownSkidding}"
                         .strategy="${e.dropDownStrategy}"
                         .maxHeight="${e.maxDropDownHeight}"
                         .flipFallbackPlacements="${[Placement.Top, Placement.Bottom]}"
                         .sync="${'none'}"
                         ?flip="${true}"
                         ?shift="${true}"
                         ?active="${e.isDropDownOpen}">
            <slot></slot>
        </mosaik-floating>
    `;
}
//# sourceMappingURL=SplitButtonElementTemplate.js.map