// #region Imports
import { html } from '../../../../Dom/Html';
import { repeat } from '../../../Directives/Directives';
import { createThumbnailPreviewFromFile } from '../../Primitives/Thumbnail/Previews/ThumbnailPreviewFactory';
// #endregion
/**
 * The template of the `ChatInputAttachmentListElement`.
 */
export function chatInputAttachmentListElementTemplate(e) {
    return html `
        ${repeat(e.files, (file) => file.name, (file) => html `
        <mosaik-box part="attachment"
                    .cornered="${true}"
                    .lang="${e.lang}"
                    .dir="${e.dir}"
                    @click="${() => window.open(URL.createObjectURL(file))}">
            <mosaik-dismiss part="dismiss"
                            slot="dismiss"
                            .size="${'tiny'}"
                            .lang="${e.lang}"
                            .dir="${e.dir}"
                            @click="${(x) => e.onDismiss(x, file)}"></mosaik-dismiss>
            <mosaik-thumbnail part="thumbnail"
                              .lang="${e.lang}"
                              .dir="${e.dir}"
                              .preview="${createThumbnailPreviewFromFile(file)}"></mosaik-thumbnail>
            <div part="content">
                <mosaik-text part="label"
                             .lang="${e.lang}"
                             .dir="${e.dir}"
                             .text="${file.name}"
                             .truncate="${true}"></mosaik-text>
                <mosaik-text part="type"
                             .lang="${e.lang}"
                             .dir="${e.dir}"
                             .text="${file.type}"
                             .truncate="${true}"></mosaik-text>
            </div>
        </mosaik-box>
        `)}
    `;
}
//# sourceMappingURL=ChatInputAttachmentListElementTemplate.js.map