/* eslint-disable lit/prefer-static-styles */
// #region Imports
import { html } from '../../../../Dom/Html';
import { RendererServiceLocator } from '../../../../Dom/Renderer';
import { styleMap, when } from '../../../Directives/Directives';
// #endregion
/**
 * The template of the {@link ProgressRingElement}.
 *
 * @public
 */
export function progressRingElementTemplate(e) {
    return html `
        <style>
            :host {
                --progress-ring-thickness: ${e.thickness};
                --progress-ring-radius: ${e.radius};
            }
        </style>
        ${when(e.label.trim(), () => html `
        <slot name="label">
            <mosaik-text part="label"
                         .truncate="${true}"
                         .text="${e.label.trim()}"></mosaik-text>
        </slot>
        `)}
        ${when(e.isIndeterminate, () => html `
        <svg part="svg" class="circle indeterminate"
             viewBox="0 0 ${e.diameter} ${e.diameter}"
             style="${styleMap({ width: `${e.diameter}px`, height: `${e.diameter}px` })}">
            <circle part="indeterminate" />
        </svg>
        `, () => html `
        <svg part="svg"
             viewBox="0 0 ${e.diameter} ${e.diameter}"
             style="${styleMap({ width: `${e.diameter}px`, height: `${e.diameter}px` })}">
            <circle part="bar"></circle>
            <circle part="fill"
                    class="circle-path"
                    stroke-dasharray="${e.getCircumference()} ${e.getCircumference()}"
                    stroke-dashoffset="${e.getOffset()}" />
        </svg>
        `)}
        <div part="hint">
            <slot name="hint"
                  @slotchange="${(x) => x.target.assignedElements().map((y, i) => RendererServiceLocator.current.setStyle(y, 'order', i))}"></slot>
        </div>
    `;
}
//# sourceMappingURL=ProgressRingElementTemplate.js.map