import { B as BalSwipeSubject } from './swipe.subject-ef4d7c09.js';

function ListenToSwipe(options = { mobileOnly: false }) {
    return function (target, _propertyKey, _descriptor) {
        const { connectedCallback, disconnectedCallback } = target;
        target.connectedCallback = function () {
            if (!this._balSwipeSubject) {
                this._balSwipeSubject = new BalSwipeSubject(options);
                this._balSwipeSubject.attach(this);
            }
            return connectedCallback && connectedCallback.call(this);
        };
        target.disconnectedCallback = function () {
            if (this._balSwipeSubject) {
                this._balSwipeSubject.detach();
                this._balSwipeSubject = undefined;
            }
            return disconnectedCallback && disconnectedCallback.call(this);
        };
    };
}

export { ListenToSwipe as L };
