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 { css, customElement, html, property } from '../../../../external/lit/index.js';
import { UmbLitElement } from '../../lit-element/index.js';
import { clamp } from '../../utils/index.js';
let UmbTemporaryFileBadgeElement = class UmbTemporaryFileBadgeElement extends UmbLitElement {
    constructor() {
        super(...arguments);
        this.#progress = 0;
        this.complete = false;
        this.error = false;
    }
    #progress;
    set progress(v) {
        const p = clamp(Math.ceil(v), 0, 100);
        this.#progress = p;
    }
    get progress() {
        return this.#progress;
    }
    render() {
        return html ` <div id="wrapper">
			<uui-loader-circle .progress=${this.complete || this.error ? 100 : this.progress}></uui-loader-circle>
			<div id="icon">${this.#renderIcon()}</div>
		</div>`;
    }
    #renderIcon() {
        if (this.error) {
            return html `<uui-icon name="icon-alert"></uui-icon>`;
        }
        if (this.complete) {
            return html `<uui-icon name="icon-check"></uui-icon>`;
        }
        return `${this.progress}%`;
    }
    static { this.styles = css `
		#wrapper {
			position: relative;
			height: 75%;
		}

		:host([complete]) {
			uui-loader-circle,
			#icon {
				color: var(--uui-color-positive);
			}
		}
		:host([error]) {
			uui-loader-circle,
			#icon {
				color: var(--uui-color-danger);
			}
		}

		uui-loader-circle {
			z-index: 2;
			inset: 0;
			color: var(--uui-color-focus);
			font-size: var(--uui-size-12);
			width: 100%;
			height: 100%;
		}

		#icon {
			color: var(--uui-color-text);
			font-size: var(--uui-size-6);
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
		}
	`; }
};
__decorate([
    property({ type: Number })
], UmbTemporaryFileBadgeElement.prototype, "progress", null);
__decorate([
    property({ type: Boolean, reflect: true })
], UmbTemporaryFileBadgeElement.prototype, "complete", void 0);
__decorate([
    property({ type: Boolean, reflect: true })
], UmbTemporaryFileBadgeElement.prototype, "error", void 0);
UmbTemporaryFileBadgeElement = __decorate([
    customElement('umb-temporary-file-badge')
], UmbTemporaryFileBadgeElement);
export { UmbTemporaryFileBadgeElement };
export default UmbTemporaryFileBadgeElement;
