"use client";
import { jsxs as p } from "react/jsx-runtime";
import { useLexicalComposerContext as d } from "../../../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
import { SELECTION_CHANGE_COMMAND as u, COMMAND_PRIORITY_CRITICAL as f } from "../../../../node_modules/lexical/Lexical.prod.js";
import { useState as e, useEffect as C } from "react";
import { ToolbarContext as T } from "../../context/toolbar-context.js";
import { useEditorModal as E } from "../../editor-hooks/use-modal.js";
function O({
  children: s
}) {
  const [t] = d(), [o, a] = e(t), [r, i] = e("paragraph"), [m, n] = E(), l = () => {
  };
  return C(() => o.registerCommand(
    u,
    (M, c) => (a(c), !1),
    f
  ), [t, o]), /* @__PURE__ */ p(
    T,
    {
      activeEditor: o,
      $updateToolbar: l,
      blockType: r,
      setBlockType: i,
      showModal: n,
      children: [
        m,
        s({ blockType: r })
      ]
    }
  );
}
export {
  O as ToolbarPlugin
};
