import { jsx as e, jsxs as o } from "react/jsx-runtime";
import { generateBlockProps as l } from "../../utils/block.js";
import { Suspense as u } from "react";
import b from "./block-wrapper.js";
import "../../config/theme.config.js";
import { BuilderConfiguration as h } from "../../config/builder.config.js";
import { LicenseManager as s } from "../../licensing/index.js";
import { FiLock as x } from "../../../../../node_modules/.pnpm/react-icons@5.5.0_react@19.0.0/node_modules/react-icons/fi/index.js";
const f = ({ block: r, index: i, meta: d }) => {
  const a = r.id, n = l({ block: r, index: i, meta: d }), t = h.getBlock(r.type), m = (t == null ? void 0 : t.previewComponent) || (t == null ? void 0 : t.component), c = s.isBlockPremium(r.type), p = s.canUseBlock(r.type);
  return m ? c && !p ? /* @__PURE__ */ e("div", { className: "rounded-sm border border-dashed border-amber-500 bg-amber-50 px-4 py-4 text-center text-amber-700", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center", children: [
    /* @__PURE__ */ e(x, { size: 24, className: "mb-2" }),
    /* @__PURE__ */ e("p", { className: "font-medium", children: "Premium Block" }),
    /* @__PURE__ */ o("p", { className: "mt-1 text-sm", children: [
      "This ",
      r.type,
      " block requires a premium license"
    ] }),
    /* @__PURE__ */ e(
      "button",
      {
        className: "mt-3 rounded bg-amber-500 px-3 py-1 text-white transition-colors hover:bg-amber-600",
        onClick: () => window.open("https://your-upgrade-url.com", "_blank"),
        children: "Upgrade to Premium"
      }
    )
  ] }) }) : /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(b, { blockId: a, attributes: n.attributes, children: /* @__PURE__ */ e(m, { ...n }) }) }) : /* @__PURE__ */ e("div", { className: "border-danger-500 text-danger-500 rounded-sm border border-dashed px-4 py-2 text-center", children: /* @__PURE__ */ o("p", { children: [
    'Block type "',
    r.type,
    '" not found'
  ] }) });
};
f.displayName = "RenderBlock";
export {
  f as RenderBlock,
  f as default
};
//# sourceMappingURL=render-block.js.map
