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