"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listenPaste = exports.makePasteListener = void 0;
function makePasteListener(listener) {
    return (component) => {
        return listenPaste(component, (value) => {
            listener(value);
        });
    };
}
exports.makePasteListener = makePasteListener;
function listenPaste(component, listener) {
    const { $element } = component;
    const _listener = (_event) => {
        const { clipboardData } = _event;
        const value = (clipboardData && clipboardData.getData('text/plain')) || '';
        listener(value, _event);
    };
    $element.addEventListener('paste', _listener);
    return () => {
        $element.removeEventListener('paste', _listener);
    };
}
exports.listenPaste = listenPaste;
//# sourceMappingURL=paste.js.map