import { __exports as s } from "./index-LexicalContentEditable.prod2.js";
import { __require as k } from "./index-LexicalComposerContext2.js";
import z from "react";
var p;
function I() {
  if (p) return s;
  p = 1;
  var f = k(), t = z;
  function d() {
    return d = Object.assign ? Object.assign.bind() : function(o) {
      for (var r = 1; r < arguments.length; r++) {
        var i = arguments[r], a;
        for (a in i) Object.prototype.hasOwnProperty.call(i, a) && (o[a] = i[a]);
      }
      return o;
    }, d.apply(this, arguments);
  }
  var m = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? t.useLayoutEffect : t.useEffect;
  return s.ContentEditable = function({ ariaActiveDescendant: o, ariaAutoComplete: r, ariaControls: i, ariaDescribedBy: a, ariaExpanded: b, ariaLabel: x, ariaLabelledBy: C, ariaMultiline: v, ariaOwns: y, ariaRequired: E, autoCapitalize: _, className: w, id: L, role: u = "textbox", spellCheck: h = !0, style: q, tabIndex: g, "data-testid": O, ...R }) {
    let [n] = f.useLexicalComposerContext(), [e, c] = t.useState(!1), j = t.useCallback((l) => {
      n.setRootElement(l);
    }, [n]);
    return m(() => (c(n.isEditable()), n.registerEditableListener((l) => {
      c(l);
    })), [n]), t.createElement(
      "div",
      d({}, R, { "aria-activedescendant": e ? o : void 0, "aria-autocomplete": e ? r : "none", "aria-controls": e ? i : void 0, "aria-describedby": a, "aria-expanded": e && u === "combobox" ? !!b : void 0, "aria-label": x, "aria-labelledby": C, "aria-multiline": v, "aria-owns": e ? y : void 0, "aria-readonly": e ? void 0 : !0, "aria-required": E, autoCapitalize: _, className: w, contentEditable: e, "data-testid": O, id: L, ref: j, role: u, spellCheck: h, style: q, tabIndex: g })
    );
  }, s;
}
export {
  I as __require
};
