import React from "react";
import { Decoration_Type } from "./../../ricos-schema/legacy/wix/rich_content/v1/index.js";
const decorator = (element, strikethroughDecoration) => {
  const { strikethroughData } = strikethroughDecoration;
  const isStrikethrough = typeof strikethroughData === "undefined" || strikethroughData;
  return /* @__PURE__ */ React.createElement(
    "s",
    {
      key: `strikethrough-${element?.key}`,
      style: { textDecoration: isStrikethrough ? "line-through" : "none" }
    },
    element
  );
};
const StrikethroughDecorator = {
  rule: (node) => !!node.textData?.decorations?.some(({ type }) => type === Decoration_Type.STRIKETHROUGH),
  decorate: ({ element, node }) => {
    const strikethroughDecoration = node.textData?.decorations?.find(
      ({ type }) => type === Decoration_Type.STRIKETHROUGH
    );
    return decorator(element, strikethroughDecoration);
  }
};
var viewer_default = StrikethroughDecorator;
export {
  viewer_default as default
};
//# sourceMappingURL=viewer.js.map
