import { p as proxyCustomElement, H, e as createEvent, h, c as Host } from './p-ae373651.js';
import { e as defaultIconPack, i as useLanguage } from './p-5b3a7f00.js';
import './p-a83ccdbd.js';
import { S as SyncWithStore } from './p-070aa695.js';
import { d as defineCustomElement$2 } from './p-3e0452c4.js';

const rtkFileDropzoneCss = "#dropzone{position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);z-index:10;display:none;flex-direction:column;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}#dropzone.active{display:flex;animation:0.2s slide-up ease-in}";
const RtkFileDropzoneStyle0 = rtkFileDropzoneCss;

var __decorate = (undefined && undefined.__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;
};
const RtkFileDropzone$1 = /*@__PURE__*/ proxyCustomElement(class RtkFileDropzone extends H {
    constructor() {
        super();
        this.__registerHost();
        this.__attachShadow();
        this.onDropCallback = createEvent(this, "dropCallback", 7);
        /** Icon pack */
        this.iconPack = defaultIconPack;
        /** Language */
        this.t = useLanguage();
        this.dropzoneActivated = false;
    }
    connectedCallback() {
        if (!this.hostEl)
            throw new Error('hostEl prop is required');
        this.hostEl.addEventListener('dragover', (e) => {
            e.preventDefault();
            this.dropzoneActivated = true;
        });
        this.hostEl.addEventListener('dragleave', () => {
            this.dropzoneActivated = false;
        });
        this.hostEl.addEventListener('drop', (e) => {
            e.preventDefault();
            this.dropzoneActivated = false;
            this.onDropCallback.emit(e);
        });
    }
    render() {
        return (h(Host, { key: '31d5ca1c0b9612c257ca9fb2233c6c1d2a4d049f' }, h("div", { key: '697c79cbd3c736b7efb890fddfca94c393b48d08', id: "dropzone", class: { active: this.dropzoneActivated }, part: "dropzone" }, h("rtk-icon", { key: '3fea26663f603965ef5dfc7d548cdcfc892bbc90', icon: this.iconPack.attach }), h("p", { key: 'cab674da2e590d75ad20ca66661753cb52771925' }, this.t('chat.send_attachment')))));
    }
    static get style() { return RtkFileDropzoneStyle0; }
}, [1, "rtk-file-dropzone", {
        "hostEl": [16],
        "iconPack": [16],
        "t": [16],
        "dropzoneActivated": [32]
    }]);
__decorate([
    SyncWithStore()
], RtkFileDropzone$1.prototype, "iconPack", void 0);
__decorate([
    SyncWithStore()
], RtkFileDropzone$1.prototype, "t", void 0);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["rtk-file-dropzone", "rtk-icon"];
    components.forEach(tagName => { switch (tagName) {
        case "rtk-file-dropzone":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, RtkFileDropzone$1);
            }
            break;
        case "rtk-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}
defineCustomElement$1();

const RtkFileDropzone = RtkFileDropzone$1;
const defineCustomElement = defineCustomElement$1;

export { RtkFileDropzone, defineCustomElement };
