import { jsx as t } from "react/jsx-runtime";
import { useEditorRef as p } from "@udecode/plate-core";
import { useLinkToolbarButtonState as s, useLinkToolbarButton as f } from "@udecode/plate-link";
import { focusEditor as a } from "@udecode/slate-react";
import { forwardRef as u } from "react";
import { ToolbarButton as c } from "../../components/Toolbar/ToolbarButton.es.js";
import l from "../../../../foundation/Icon/Generated/IconLink16.es.js";
import { IconStylingWrapper as d } from "../helper.es.js";
const b = u(
  (r, n) => {
    const o = p(), i = s(), { props: e } = f(i);
    return /* @__PURE__ */ t(
      c,
      {
        onMouseDown: (m) => {
          m.preventDefault(), a(o, o.selection ?? o.prevSelection ?? void 0);
        },
        ref: n,
        ...e,
        ...r,
        children: /* @__PURE__ */ t(d, { icon: /* @__PURE__ */ t(l, {}) })
      }
    );
  }
);
b.displayName = "LinkToolbarButton";
export {
  b as LinkToolbarButton
};
//# sourceMappingURL=LinkToolbarButton.es.js.map
