// packages/block-editor/src/components/rich-text/event-listeners/insert-replacement-text.js
import { privateApis as composePrivateApis } from "@wordpress/compose";
import { store as blockEditorStore } from "../../../store/index.mjs";
import { unlock } from "../../../lock-unlock.mjs";
var { subscribeDelegatedListener } = unlock(composePrivateApis);
var insert_replacement_text_default = (props) => (element) => {
  function onInput(event) {
    if (event.inputType !== "insertReplacementText") {
      return;
    }
    const { registry } = props.current;
    registry.dispatch(blockEditorStore).__unstableMarkLastChangeAsPersistent();
  }
  return subscribeDelegatedListener(element, "beforeinput", onInput);
};
export {
  insert_replacement_text_default as default
};
//# sourceMappingURL=insert-replacement-text.mjs.map
