import { defineComponent, onBeforeUnmount, onMounted } from "vue";
//#region src/components/ImportCollection/PasteEventListener.vue?vue&type=script&setup=true&lang.ts
var PasteEventListener_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "PasteEventListener",
	emits: ["input"],
	setup(__props, { emit: __emit }) {
		const emit = __emit;
		onMounted(() => {
			document.addEventListener("paste", handlePaste);
		});
		onBeforeUnmount(() => {
			document.removeEventListener("paste", handlePaste);
		});
		function handlePaste(event) {
			const target = event.target;
			const isCodeMirror = Boolean(document.activeElement?.classList.contains("cm-content"));
			if (target && (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable || isCodeMirror)) return;
			if (event.clipboardData) {
				const pastedText = event.clipboardData.getData("text");
				if (pastedText) emit("input", pastedText, null, "paste");
			}
		}
		return (_ctx, _cache) => {
			return null;
		};
	}
});
//#endregion
export { PasteEventListener_vue_vue_type_script_setup_true_lang_default as default };

//# sourceMappingURL=PasteEventListener.vue.script.js.map