var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { UmbCollectionViewElementBase } from '../umb-collection-view-element-base.js';
import { css, customElement, html, nothing, repeat } from '../../../../../external/lit/index.js';
import { UmbTextStyles } from '../../../style/index.js';
let UmbRefCollectionViewElement = class UmbRefCollectionViewElement extends UmbCollectionViewElementBase {
    render() {
        if (this._loading)
            return nothing;
        return html `
			<uui-box>
				${repeat(this._items, (item) => item.unique, (item) => this.#renderItem(item))}
			</uui-box>
		`;
    }
    #renderItem(item) {
        const href = item.unique ? this._itemHrefs.get(item.unique) : undefined;
        return html `<umb-entity-collection-item-ref
			.item=${item}
			href=${href ?? nothing}
			?selectable=${this._isSelectableItem(item)}
			?select-only=${this._selectOnly}
			?selected=${this._isSelectedItem(item.unique)}
			@selected=${() => this._selectItem(item.unique)}
			@deselected=${() => this._deselectItem(item.unique)}>
			<umb-entity-actions-bundle slot="actions"></umb-entity-actions-bundle>
		</umb-entity-collection-item-ref>`;
    }
    static { this.styles = [
        UmbTextStyles,
        css `
			:host {
				display: flex;
				flex-direction: column;
			}

			umb-entity-collection-item-ref {
				margin-bottom: var(--uui-size-4);

				&:last-of-type {
					margin-bottom: 0;
				}
			}
		`,
    ]; }
};
UmbRefCollectionViewElement = __decorate([
    customElement('umb-ref-collection-view')
], UmbRefCollectionViewElement);
export { UmbRefCollectionViewElement };
export { UmbRefCollectionViewElement as element };
