"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    SlotsForNoShadowDOMMixin: ()=>SlotsForNoShadowDOMMixin
});
const SlotsForNoShadowDOMMixin = (superClass)=>{
    class SlotsForNoShadowDOMClass extends superClass {
        createRenderRoot() {
            return this;
        }
        willUpdate(changedProperties) {
            super.willUpdate?.(changedProperties);
            if (!this.hasUpdated) this.adoptChildren();
        }
        updated(changedProperties) {
            super.updated?.(changedProperties);
            for (const { placeholder, nodes } of this.slotPlaceholders)placeholder.replaceWith(...nodes);
            this.slotPlaceholders = [];
        }
        adoptChildren() {
            const children = Array.from(this.childNodes);
            for (const child of children){
                const slotName = child instanceof Element ? child.getAttribute('slot') || '' : '';
                if (!this.slotContent[slotName]) this.slotContent[slotName] = [];
                this.slotContent[slotName].push(child);
                child.remove();
            }
        }
        isTextNodeEmpty(node) {
            return !node.textContent || !node.textContent.trim();
        }
        isSlotEmpty(slot) {
            const content = this.slotContent[slot];
            return !content || content.every((child)=>child instanceof Comment || child instanceof Text && this.isTextNodeEmpty(child));
        }
        renderDefaultSlotContent(defaultContent) {
            if (!this.isSlotEmpty('')) return this.createSlotPlaceholder(this.slotContent['']);
            return defaultContent ? [
                defaultContent
            ] : [];
        }
        createSlotPlaceholder(nodes) {
            const placeholder = document.createComment('slot');
            this.slotPlaceholders.push({
                placeholder,
                nodes
            });
            return [
                placeholder
            ];
        }
        constructor(...args){
            super(...args), this.slotContent = {}, this.slotPlaceholders = [];
        }
    }
    return SlotsForNoShadowDOMClass;
};
exports.SlotsForNoShadowDOMMixin = __webpack_exports__.SlotsForNoShadowDOMMixin;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "SlotsForNoShadowDOMMixin"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
