'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-7a477838.js');

const utilResizeObserverCss = ".sc-digi-util-resize-observer-h{display:block}";
const DigiUtilResizeObserverStyle0 = utilResizeObserverCss;

const UtilResizeObserver = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.afOnChange = index.createEvent(this, "afOnChange", 7);
        this._observer = null;
    }
    componentWillLoad() {
        this.initObserver();
    }
    disconnectedCallback() {
        this.removeObserver();
    }
    initObserver() {
        this._observer = new ResizeObserver(([entry]) => {
            this.afOnChange.emit(entry);
        });
        this._observer.observe(this.hostElement);
    }
    removeObserver() {
        if (this._observer)
            this._observer.disconnect();
    }
    changeHandler(e) {
        this.afOnChange.emit(e);
    }
    render() {
        return index.h("slot", { key: '1428211db620bf886a98eb908958a7d7ffb0eac1' });
    }
    get hostElement() { return index.getElement(this); }
};
UtilResizeObserver.style = DigiUtilResizeObserverStyle0;

exports.digi_util_resize_observer = UtilResizeObserver;
