import { registerChaiBlock as u } from "@chaibuilder/runtime";
import { j as a } from "./jsx-runtime-Sp0orL4X.js";
import * as m from "react";
import { c as j, o as p, f as v, v as C, b, T as N, y as B, u as T, r as L, d as S, q as R, e as k, h as F, G as O, g as I, S as U } from "./iconBase-zweRWSz0.js";
import "i18next";
import { ButtonIcon as H, CodeIcon as V, HeadingIcon as G, TextIcon as W, CursorTextIcon as X, Link1Icon as Y, ImageIcon as z, RowsIcon as Z, ColumnsIcon as J, SketchLogoIcon as K, VideoIcon as Q, DividerHorizontalIcon as ee, MoonIcon as te, SpaceBetweenVerticallyIcon as q, GroupIcon as le, InputIcon as A, RadiobuttonIcon as oe, DropdownMenuIcon as se, CheckboxIcon as ae } from "@radix-ui/react-icons";
import { isNull as ne, isEmpty as g, get as x, pick as re, omit as ce, map as M } from "lodash-es";
import "clsx";
import "tailwind-merge";
const ie = ({ className: e = "", inBuilder: l }) => l ? /* @__PURE__ */ a.jsx("div", { className: j("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ a.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ a.jsx("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700" }) }) }) : null, _ = ie, de = (e) => {
  const { blockProps: l, inBuilder: t, backgroundImage: s, children: o, tag: n = "div", styles: r } = e;
  let i = o;
  o || (i = /* @__PURE__ */ a.jsx(_, { inBuilder: t }));
  let c = {};
  return s && (c = { backgroundImage: `url(${s})` }), m.createElement(n, { ...l, ...r, style: c }, i);
}, ue = {
  type: "Box",
  label: "web_blocks.box",
  category: "core",
  group: "basic",
  props: {
    styles: p({ default: "" }),
    tag: v({
      title: "web_blocks.tag",
      default: "div",
      options: [
        { value: "div", title: "web_blocks.div" },
        { value: "header", title: "web_blocks.header" },
        { value: "footer", title: "web_blocks.footer" },
        { value: "section", title: "web_blocks.section" },
        { value: "article", title: "web_blocks.article" },
        { value: "aside", title: "web_blocks.aside" },
        { value: "main", title: "web_blocks.main" },
        { value: "nav", title: "web_blocks.nav" },
        { value: "figure", title: "web_blocks.figure" },
        { value: "details", title: "web_blocks.details" },
        { value: "summary", title: "web_blocks.summary" },
        { value: "dialog", title: "web_blocks.dialog" },
        { value: "strike", title: "web_blocks.strike" },
        { value: "caption", title: "web_blocks.caption" },
        { value: "legend", title: "web_blocks.legend" },
        { value: "figcaption", title: "web_blocks.figcaption" },
        { value: "mark", title: "web_blocks.mark" }
      ]
    }),
    backgroundImage: C({ title: "web_blocks.background_image" })
  },
  canAcceptBlock: () => !0
}, be = (e) => {
  const { blockProps: l, iconSize: t, icon: s, content: o, iconPos: n, styles: r, children: i } = e, c = s, d = i || /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
    /* @__PURE__ */ a.jsx("span", { "data-ai-key": "content", children: o }),
    c && /* @__PURE__ */ a.jsx(
      "div",
      {
        style: { width: t + "px" },
        className: n + " " + (n === "order-first" ? "mr-2" : "ml-2") || "",
        dangerouslySetInnerHTML: { __html: c }
      }
    )
  ] });
  return m.createElement(
    "button",
    {
      ...l,
      ...r,
      type: "button"
    },
    d
  );
}, pe = {
  type: "Button",
  label: "web_blocks.button",
  category: "core",
  icon: H,
  group: "basic",
  props: {
    content: b({ title: "web_blocks.label", default: "Button" }),
    styles: p({ default: "text-white bg-primary px-4 py-2 rounded-global flex items-center" }),
    icon: N({ title: "web_blocks.icon", default: "" }),
    iconSize: B({ title: "web_blocks.icon_size", default: 24 }),
    iconPos: v({
      title: "web_blocks.icon_position",
      default: "order-last",
      options: [
        { title: "web_blocks.start", value: "order-first" },
        { title: "web_blocks.end", value: "order-last" }
      ]
    })
  }
}, me = (e) => {
  const { blockProps: l, styles: t, htmlCode: s, inBuilder: o } = e;
  return o ? /* @__PURE__ */ a.jsxs("div", { className: "relative", children: [
    o ? /* @__PURE__ */ a.jsx("div", { ...l, ...t, className: "absolute z-20 h-full w-full" }) : null,
    m.createElement("div", {
      ...t,
      dangerouslySetInnerHTML: { __html: s.replace(/<script.*?>.*?<\/script>/g, "") }
    })
  ] }) : m.createElement("div", {
    ...l,
    ...t,
    dangerouslySetInnerHTML: { __html: s }
  });
}, fe = {
  type: "CustomHTML",
  label: "web_blocks.custom_html",
  category: "core",
  icon: V,
  group: "advanced",
  props: {
    styles: p({ default: "" }),
    htmlCode: T({
      title: "web_blocks.html_code",
      default: "<div><p>Enter your HTML code here...</p></div>",
      placeholder: "web_blocks.placeholder"
    })
  }
}, he = m.memo(
  (e) => {
    const { blockProps: l, styles: t } = e;
    return m.createElement("div", { ...l, ...t });
  }
), ke = {
  type: "EmptyBox",
  label: "web_blocks.empty_box",
  category: "core",
  group: "basic",
  props: {
    styles: p({ default: "" }),
    backgroundImage: C({ title: "web_blocks.background_image" })
  }
}, ye = (e) => {
  const { blockProps: l, styles: t, content: s, level: o = "h1", children: n = null } = e;
  return n ? m.createElement(o, { ...t, ...l }, n) : m.createElement(o, {
    ...t,
    ...l,
    "data-ai-key": "content",
    "data-ai-type": "html",
    dangerouslySetInnerHTML: { __html: s }
  });
}, ge = {
  type: "Heading",
  label: "web_blocks.heading",
  category: "core",
  icon: G,
  group: "typography",
  props: {
    level: v({
      title: "web_blocks.level",
      default: "h2",
      binding: !1,
      options: [
        { value: "h1", title: "h1" },
        { value: "h2", title: "h2" },
        { value: "h3", title: "h3" },
        { value: "h4", title: "h4" },
        { value: "h5", title: "h5" },
        { value: "h6", title: "h6" }
      ]
    }),
    styles: p({ default: "text-3xl" }),
    content: L({ title: "web_blocks.content", default: "Heading goes here" })
  },
  canAcceptBlock: (e) => e === "Span" || e === "Text"
}, _e = (e) => {
  const { blockProps: l, styles: t, content: s } = e;
  return ne(e.children) ? m.createElement("p", {
    ...t,
    ...l,
    "data-ai-key": "content",
    "data-ai-type": "html",
    dangerouslySetInnerHTML: { __html: s }
  }) : m.createElement("p", { ...t, ...l }, e.children);
}, we = {
  type: "Paragraph",
  label: "web_blocks.paragraph",
  category: "core",
  icon: W,
  group: "typography",
  props: {
    styles: p({ default: "" }),
    content: L({
      title: "web_blocks.content",
      default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."
    })
  },
  canAcceptBlock: (e) => e === "Span" || e === "Link" || e === "Text"
}, xe = (e) => {
  const { blockProps: l, styles: t, content: s, children: o = null, tag: n } = e;
  return o ? m.createElement("span", { ...t, ...l }, o) : m.createElement(n || "span", {
    ...t,
    ...l,
    "data-ai-key": "content",
    dangerouslySetInnerHTML: { __html: s }
  });
}, ve = {
  type: "Span",
  label: "web_blocks.span",
  category: "core",
  group: "typography",
  props: {
    styles: p({ default: "" }),
    content: L({ title: "web_blocks.content", default: "" })
  },
  canAcceptBlock: () => !0
}, Ie = (e) => {
  const { blockProps: l, content: t, styles: s } = e;
  return /* @__PURE__ */ a.jsx("div", { className: "max-w-full", children: /* @__PURE__ */ a.jsx(
    "div",
    {
      "data-ai-key": "content",
      "data-ai-type": "richtext",
      ...l,
      ...s,
      dangerouslySetInnerHTML: { __html: t }
    }
  ) });
}, Be = {
  type: "RichText",
  label: "web_blocks.richtext",
  category: "core",
  icon: X,
  group: "typography",
  props: {
    styles: p({ default: "" }),
    content: S({
      title: "web_blocks.content",
      default: "<p>This is a rich text block. You can add text, and other content here.</p>"
    })
  }
}, je = (e) => {
  const { blockProps: l, link: t, children: s, styles: o, inBuilder: n, content: r } = e;
  return !s && g(o == null ? void 0 : o.className) && g(r) ? /* @__PURE__ */ a.jsx(_, { inBuilder: n }) : n ? s ? /* @__PURE__ */ a.jsx("span", { ...l, ...o, children: s }) : m.createElement("span", {
    ...l,
    ...o,
    dangerouslySetInnerHTML: { __html: r }
  }) : s ? /* @__PURE__ */ a.jsx("a", { href: (t == null ? void 0 : t.href) || "#/", target: t == null ? void 0 : t.target, ...l, ...o, children: s }) : m.createElement("a", {
    ...l,
    ...o,
    "data-ai-key": "content",
    href: (t == null ? void 0 : t.href) || "#",
    target: (t == null ? void 0 : t.target) || "_self",
    dangerouslySetInnerHTML: { __html: r }
  });
}, Le = {
  type: "Link",
  label: "web_blocks.link",
  category: "core",
  icon: Y,
  group: "basic",
  props: {
    styles: p({ default: "" }),
    content: b({ title: "web_blocks.content", default: "" }),
    link: R({
      title: "web_blocks.link",
      default: { type: "page", target: "_self", href: "#" }
    })
  },
  canAcceptBlock: (e) => e !== "Link"
}, D = (e, ...l) => ({
  ...e,
  className: j(e.className, ...l)
}), Ce = (e) => {
  const { blockProps: l, children: t, styles: s, inBuilder: o, content: n, href: r } = e, { hrefType: i, autoplay: c, maxWidth: d, backdropColor: h, galleryName: f } = e, y = D(s, "cb-lightbox");
  if (!t && g(s == null ? void 0 : s.className) && g(n))
    return /* @__PURE__ */ a.jsx(_, { inBuilder: o });
  if (o)
    return t ? /* @__PURE__ */ a.jsx("span", { ...l, ...y, children: t }) : m.createElement("span", {
      ...l,
      ...y,
      dangerouslySetInnerHTML: { __html: n }
    });
  const w = {};
  return w["data-vbtype"] = i, c && (w["data-autoplay"] = "true"), d && (w["data-maxwidth"] = d + "px"), h && (w["data-overlay"] = h), f && (w["data-gall"] = f), t ? /* @__PURE__ */ a.jsx("a", { ...w, href: r || "#/", ...l, ...y, children: t }) : m.createElement("a", {
    ...l,
    ...y,
    ...w,
    href: r || "#",
    dangerouslySetInnerHTML: { __html: n }
  });
}, Se = {
  type: "LightBoxLink",
  label: "web_blocks.lightbox_link",
  category: "core",
  icon: z,
  group: "basic",
  props: {
    styles: p({ default: "" }),
    content: b({ title: "web_blocks.content", default: "Link text or drop blocks inside" }),
    href: b({ title: "web_blocks.href", default: "" }),
    hrefType: v({
      title: "web_blocks.type",
      default: "video",
      options: [
        { value: "video", title: "web_blocks.video" },
        { value: "iframe", title: "web_blocks.iframe" },
        { value: "inline", title: "web_blocks.inline" },
        { value: "ajax", title: "web_blocks.ajax" }
      ]
    }),
    autoplay: k({ title: "web_blocks.autoplay", default: !1 }),
    maxWidth: B({ title: "web_blocks.max_width", default: "" }),
    backdropColor: b({ title: "backdrop_color", default: "" }),
    galleryName: b({ title: "web_blocks.gallery_name", default: "" })
  },
  canAcceptBlock: (e) => e !== "Link" && e !== "LightBoxLink"
}, Me = (e) => {
  const { blockProps: l, children: t, listType: s, styles: o, tag: n, inBuilder: r } = e, i = j(x(o, "className", ""), s);
  return !t && g(o == null ? void 0 : o.className) ? /* @__PURE__ */ a.jsx(_, { inBuilder: r }) : m.createElement(
    n || (s === "list-decimal" ? "ol" : "ul"),
    { ...l, ...o, className: i },
    t
  );
}, Ne = {
  type: "List",
  label: "web_blocks.list",
  icon: Z,
  category: "core",
  group: "basic",
  props: {
    styles: p({ default: "" }),
    listType: v({
      title: "web_blocks.list_type",
      default: "list-none",
      options: [
        { value: "list-none", title: "web_blocks.none" },
        { value: "list-disc", title: "web_blocks.disc" },
        { value: "list-decimal", title: "web_blocks.number" }
      ]
    })
  },
  canAcceptBlock: (e) => e === "ListItem",
  blocks: [
    { _type: "List", _id: "a", listType: "list-none", styles: "#styles:," },
    {
      _type: "ListItem",
      _id: "b",
      _parent: "a",
      styles: "#styles:,",
      content: "Item 1"
    },
    {
      _type: "ListItem",
      _id: "c",
      _parent: "a",
      styles: "#styles:,",
      content: "Item 2"
    },
    {
      _type: "ListItem",
      _id: "d",
      _parent: "a",
      styles: "#styles:,",
      content: "Item 3"
    }
  ]
}, Ee = (e) => {
  const { blockProps: l, content: t, styles: s, children: o, tag: n } = e;
  return o ? m.createElement(n || "li", { ...s, ...l }, o) : m.createElement(n || "li", {
    ...s,
    ...l,
    "data-ai-key": "content",
    dangerouslySetInnerHTML: { __html: t }
  });
}, $e = {
  type: "ListItem",
  label: "web_blocks.listitem",
  icon: J,
  category: "core",
  group: "basic",
  props: {
    styles: p({ default: "" }),
    content: L({ title: "web_blocks.content", default: "List item" })
  },
  canAcceptBlock: (e) => e !== "ListItem",
  canBeNested: (e) => e === "List"
}, Pe = (e) => {
  const { blockProps: l, icon: t, styles: s, width: o, inBuilder: n, height: r } = e, i = D(s, j(o ? `w-[${o}px]` : "", r ? `h-[${r}px]` : ""));
  if (g(t))
    return /* @__PURE__ */ a.jsx(_, { inBuilder: n, className: "h-8 w-14" });
  const c = t.replace(/<svg /g, '<svg class="w-[inherit] h-[inherit]" ');
  return m.createElement("span", {
    ...l,
    ...i,
    dangerouslySetInnerHTML: { __html: c }
  });
}, Te = {
  type: "Icon",
  label: "web_blocks.icon",
  category: "core",
  icon: K,
  group: "media",
  props: {
    styles: p({ default: "text-black" }),
    icon: N({
      title: "web_blocks.icon",
      default: '<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'
    }),
    width: B({ title: "web_blocks.width", default: "" }),
    height: B({ title: "web_blocks.height", default: "" })
  }
}, He = (e) => {
  const { blockProps: l, image: t, styles: s, alt: o, height: n, width: r } = e;
  return g(t) ? /* @__PURE__ */ a.jsx(_, { className: "h-36" }) : m.createElement("img", {
    ...l,
    ...s,
    src: t,
    alt: o,
    loading: "lazy",
    height: n,
    width: r
  });
}, ze = {
  type: "Image",
  label: "web_blocks.image",
  category: "core",
  icon: z,
  group: "media",
  props: {
    styles: p({ default: "" }),
    image: C({
      title: "Image",
      default: "https://fakeimg.pl/400x200?text=Choose&font=bebas"
    }),
    alt: b({ title: "web_blocks.alt", default: "" }),
    width: b({ title: "web_blocks.width", default: "" }),
    height: b({ title: "web_blocks.height", default: "" })
  }
}, E = /^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/, $ = /^(https?:\/\/)?(www\.)?player.vimeo\.com/, P = /^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/, qe = (e) => {
  if (E.test(e)) {
    const l = e.match(E);
    return l ? `https://www.youtube.com/embed/${l[4]}` : e;
  }
  if ($.test(e)) {
    const l = e.match($);
    return l ? `https://player.vimeo.com/video/${l[3]}` : e;
  }
  if (P.test(e)) {
    const l = e.match(P);
    return l ? `https://www.dailymotion.com/embed/video/${l[4]}` : e;
  }
  return null;
}, Ae = m.memo(
  (e) => {
    const { blockProps: l, inBuilder: t, styles: s, url: o, controls: n } = e, r = x(n, "autoPlay", !1), i = x(n, "controls", !1), c = r || x(n, "muted", !0), d = x(n, "loop", !1);
    if (g(o))
      return /* @__PURE__ */ a.jsx(_, { inBuilder: t, className: "h-36" });
    let h = qe(o), f = null;
    if (h) {
      if (!g(h)) {
        const y = [];
        y.push(`autoplay=${r ? 1 : 0}`), y.push(`controls=${n ? 1 : 0}`), y.push(`mute=${c ? 1 : 0}&muted=${c ? 1 : 0}`), y.push(`loop=${d ? 1 : 0}`), h = `${h}?${y.join("&")}`;
      }
      f = m.createElement("iframe", {
        ...l,
        className: "absolute inset-0 w-full h-full",
        src: h,
        allow: t ? "" : "autoplay *; fullscreen *",
        allowFullScreen: !0,
        frameBorder: 0
      });
    } else
      f = m.createElement("video", {
        ...l,
        className: "absolute inset-0 w-full h-full",
        src: o,
        controls: i,
        muted: c,
        autoPlay: t ? !1 : r,
        loop: d
      });
    return /* @__PURE__ */ a.jsx("div", { ...re(s, ["className"]), children: /* @__PURE__ */ a.jsxs("div", { className: "relative w-full overflow-hidden", style: { paddingBottom: "56.25%" }, children: [
      t ? /* @__PURE__ */ a.jsx("div", { ...l, ...ce(s, ["className"]), className: "absolute inset-0 z-20 h-full w-full" }) : null,
      f
    ] }) });
  }
), De = {
  type: "Video",
  label: "web_blocks.video",
  category: "core",
  icon: Q,
  group: "media",
  props: {
    styles: p({ default: "" }),
    url: b({
      title: "web_blocks.video_url",
      default: "https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"
    }),
    controls: F({
      title: "web_blocks.controls",
      properties: {
        autoPlay: k({ title: "web_blocks.autoplay", default: !0 }),
        controls: k({ title: "web_blocks.controls", default: !1 }),
        loop: k({ title: "web_blocks.loop", default: !1 }),
        muted: k({ title: "web_blocks.muted", default: !0 })
      }
    })
  }
};
function Re(e) {
  return O({ tag: "svg", attr: { version: "1.1", viewBox: "0 0 32 32" }, child: [{ tag: "path", attr: { d: "M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z" }, child: [] }] })(e);
}
const Fe = (e) => {
  const { scripts: l, inBuilder: t, blockProps: s } = e;
  return t ? /* @__PURE__ */ a.jsx("div", { ...s, children: /* @__PURE__ */ a.jsx("div", { className: j("pointer-events-none flex flex-col items-center justify-center p-2", ""), children: /* @__PURE__ */ a.jsx("div", { className: "h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800", children: /* @__PURE__ */ a.jsx("p", { className: "text-left text-xs text-gray-400", children: "Scripts will be only executed in preview and live mode. Place your script at the bottom of the" }) }) }) }) : /* @__PURE__ */ a.jsx("div", { dangerouslySetInnerHTML: { __html: l } });
}, Oe = {
  type: "CustomScript",
  label: "web_blocks.custom_script",
  category: "core",
  icon: Re,
  group: "advanced",
  props: {
    scripts: T({
      title: "Script",
      default: "",
      placeholder: "<script>console.log('Hello, world!');<\/script>"
    })
  }
}, Ue = (e) => {
  const { blockProps: l, styles: t } = e;
  return m.createElement("hr", { ...t, ...l });
}, Ve = {
  type: "Divider",
  label: "web_blocks.divider",
  category: "core",
  icon: ee,
  group: "basic",
  props: {
    styles: p({ default: "bg-gray-900 h-0.5 py-2 my-1" })
  }
}, Ge = () => null, We = {
  type: "Dark Mode",
  label: "web_blocks.dark_mode",
  category: "core",
  icon: te,
  group: "advanced",
  props: {},
  blocks: () => [
    { _id: "ultqCh", _type: "Span", tag: "span", styles: "#styles:,", _name: "Dark Mode Switcher" },
    {
      _id: "vroabi",
      _parent: "ultqCh",
      _type: "Button",
      // @ts-ignore
      styles_attrs: { type: "button", "x-on:click": "darkMode = 'dark'", "x-show": "darkMode === 'light'" },
      styles: "#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",
      _name: "Dark Mode Btn"
    },
    {
      _id: "eweibk",
      _parent: "vroabi",
      _type: "Span",
      tag: "span",
      styles: "#styles:,group inline-flex shrink-0 justify-center items-center size-9"
    },
    {
      _id: "nltBrv",
      _parent: "eweibk",
      _type: "Icon",
      styles: "#styles:, shrink-0 size-4",
      icon: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'></path></svg>"
    },
    {
      _id: "gesydi",
      _parent: "ultqCh",
      _type: "Button",
      // @ts-ignore
      styles_attrs: { type: "button", "x-on:click": "darkMode = 'light'", "x-show": "darkMode === 'dark'" },
      styles: "#styles:,bg-white dark:bg-black font-medium text-gray-800 rounded-full hover:bg-gray-200 focus:outline-none focus:bg-gray-200 dark:text-neutral-200 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800",
      _name: "Light Mode Btn"
    },
    {
      _id: "sgbhDo",
      _parent: "gesydi",
      _type: "Span",
      tag: "span",
      styles: "#styles:,group inline-flex shrink-0 justify-center items-center size-9"
    },
    {
      _id: "AdDwBC",
      _parent: "sgbhDo",
      _type: "Icon",
      styles: "#styles:, shrink-0 size-4",
      icon: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'></circle><path d='M12 2v2'></path><path d='M12 20v2'></path><path d='m4.93 4.93 1.41 1.41'></path><path d='m17.66 17.66 1.41 1.41'></path><path d='M2 12h2'></path><path d='M20 12h2'></path><path d='m6.34 17.66-1.41 1.41'></path><path d='m19.07 4.93-1.41 1.41'></path></svg>"
    }
  ]
}, Xe = (e) => e.inBuilder || e.forceWrapper ? /* @__PURE__ */ a.jsx("span", { "data-ai-key": "content", ...e.blockProps, children: e.content }) : `${e.content}`, Ye = {
  type: "Text",
  label: "web_blocks.text",
  hidden: !0,
  category: "core",
  group: "typography",
  icon: q,
  props: {
    content: L({ title: "web_blocks.content", defaultValue: "" })
  }
}, Ze = (e) => {
  const { blockProps: l, backgroundImage: t, children: s, styles: o } = e;
  let n = {};
  return t && (n = { backgroundImage: `url(${t})` }), m.createElement("div", { ...l, ...o, style: n }, s);
}, Je = {
  type: "Body",
  label: "Body",
  category: "core",
  group: "basic",
  hidden: !0,
  props: {
    styles: p({ default: "font-body antialiased" }),
    backgroundImage: C({ title: "Background Image" })
  },
  canAcceptBlock: () => !0,
  canDelete: () => !1,
  canMove: () => !1,
  canDuplicate: () => !1
}, Ke = (e) => {
  const { blockProps: l, styles: t } = e;
  return m.createElement("br", { ...l, ...t });
}, Qe = {
  type: "LineBreak",
  label: "Line Break",
  category: "core",
  group: "basic",
  hidden: !0,
  icon: q,
  props: {
    styles: p({ default: "" })
  }
}, et = (e) => {
  const { blockProps: l, errorMessage: t, name: s, _type: o, successMessage: n, action: r, styles: i, children: c } = e;
  let d = c;
  c || (d = /* @__PURE__ */ a.jsx(_, {}));
  const h = {
    "x-data": "{}",
    "x-on:submit.prevent": "post"
  }, f = {
    "x-html": "",
    ":class": "{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"
  };
  return /* @__PURE__ */ a.jsxs(
    "form",
    {
      ...h,
      "data-error": t,
      "data-success": n,
      method: "post",
      action: r,
      ...l,
      ...i,
      children: [
        /* @__PURE__ */ a.jsx("div", { ...f }),
        /* @__PURE__ */ a.jsx("input", { name: "formname", type: "hidden", value: s || o }),
        d
      ]
    }
  );
}, tt = {
  type: "Form",
  label: "web_blocks.form",
  category: "core",
  icon: le,
  group: "form",
  props: {
    styles: p({ default: "" }),
    action: b({
      title: "web_blocks.submit_url",
      default: "/api/form/submit"
    }),
    errorMessage: S({
      title: "web_blocks.error_message",
      default: "Something went wrong. Please try again"
    }),
    successMessage: S({
      title: "web_blocks.success_message",
      default: "Thank you for your submission."
    })
  },
  canAcceptBlock: () => !0
}, lt = (e) => {
  const { blockProps: l, inBuilder: t, label: s, styles: o, inputStyles: n, icon: r, iconPos: i } = e, c = I(), d = {
    "x-bind:disabled": "formLoading"
  };
  return /* @__PURE__ */ a.jsxs(
    "button",
    {
      id: c,
      ...d,
      ...n,
      ...o,
      ...l || {},
      type: t ? "button" : "submit",
      children: [
        s,
        r && /* @__PURE__ */ a.jsx("span", { className: i, dangerouslySetInnerHTML: { __html: r } })
      ]
    }
  );
}, ot = {
  type: "FormButton",
  label: "web_blocks.submit_button",
  category: "core",
  icon: H,
  group: "form",
  props: {
    label: b({ title: "web_blocks.label", default: "Submit" }),
    styles: p({
      default: "text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"
    }),
    icon: N({ title: "Icon", default: "" }),
    iconPos: v({
      title: "web_blocks.icon_position",
      default: "order-last",
      options: [
        { title: "web_blocks.start", value: "order-first" },
        { title: "web_blocks.end", value: "order-last" }
      ]
    })
  }
}, st = (e) => {
  const {
    blockProps: l,
    label: t,
    placeholder: s,
    styles: o,
    inputStyles: n,
    showLabel: r,
    required: i,
    inputType: c = "text",
    inBuilder: d,
    fieldName: h
  } = e, f = I();
  return !r || c === "submit" ? (c === "submit" && (l.value = t), /* @__PURE__ */ a.jsx(
    "input",
    {
      id: f,
      name: h,
      readOnly: d,
      ...l,
      ...n,
      ...o,
      type: c,
      placeholder: s,
      required: i
    }
  )) : /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
    r && /* @__PURE__ */ a.jsx("label", { htmlFor: f, children: t }),
    /* @__PURE__ */ a.jsx(
      "input",
      {
        name: h,
        readOnly: d,
        ...n,
        id: f,
        type: c,
        placeholder: s,
        required: i
      }
    )
  ] });
}, at = {
  type: "Input",
  label: "web_blocks.input",
  category: "core",
  icon: A,
  group: "form",
  props: {
    styles: p({ default: "" }),
    fieldName: b({ title: "Field Name", default: "input" }),
    inputType: v({
      title: "web_blocks.type",
      options: M(
        ["text", "email", "password", "number", "tel", "file", "hidden", "range", "submit", "color", "date", "time"],
        (e) => ({
          value: e,
          title: e
        })
      ),
      default: "text"
    }),
    value: b({ title: "web_blocks.value", default: "" }),
    showLabel: k({ title: "web_blocks.show_label", default: !0 }),
    inputStyles: p({ default: "w-full p-1" }),
    label: b({ title: "web_blocks.label", default: "Label" }),
    placeholder: b({
      title: "web_blocks.placeholder",
      default: "Placeholder"
    }),
    required: k({ title: "web_blocks.required", default: !1 })
  }
}, nt = (e) => {
  const { blockProps: l, fieldName: t, label: s, styles: o, inputStyles: n, checked: r, required: i, showLabel: c = !0 } = e, d = I();
  return c ? /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
    /* @__PURE__ */ a.jsx("input", { ...n, name: t, id: d, type: "radio", required: i, defaultChecked: r }),
    s && /* @__PURE__ */ a.jsx("label", { htmlFor: d, children: s })
  ] }) : /* @__PURE__ */ a.jsx(
    "input",
    {
      id: d,
      ...l,
      ...n,
      ...o,
      type: "radio",
      required: i,
      checked: r,
      name: t
    }
  );
}, rt = {
  type: "Radio",
  label: "web_blocks.radio",
  category: "core",
  icon: oe,
  group: "form",
  props: {
    styles: p({ default: "flex items-center w-max gap-x-2" }),
    fieldName: b({ title: "web_blocks.field_name", default: "radio" }),
    label: b({ title: "web_blocks.label", default: "Label" }),
    checked: k({ title: "web_blocks.checked", default: !1 }),
    required: k({ title: "web_blocks.required", default: !1 })
  }
}, ct = (e) => {
  const {
    blockProps: l,
    fieldName: t,
    label: s,
    placeholder: o,
    styles: n,
    inputStyles: r,
    required: i,
    showLabel: c,
    _multiple: d = !1
  } = e, h = I();
  return c ? /* @__PURE__ */ a.jsxs("div", { ...n, children: [
    c && /* @__PURE__ */ a.jsx("label", { htmlFor: h, children: s }),
    /* @__PURE__ */ a.jsxs("select", { ...r, id: h, required: i, multiple: d, name: t, children: [
      /* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
      M(e.options, (f) => /* @__PURE__ */ a.jsx(
        "option",
        {
          selected: x(f, "selected", !1),
          value: f.value,
          dangerouslySetInnerHTML: { __html: f.label }
        },
        f.value
      ))
    ] })
  ] }) : /* @__PURE__ */ a.jsxs(
    "select",
    {
      id: h,
      ...n,
      ...l,
      required: i,
      multiple: d,
      name: t,
      children: [
        /* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, selected: !0, hidden: !0, children: o }),
        M(e.options, (f) => /* @__PURE__ */ a.jsx(
          "option",
          {
            selected: x(f, "selected", !1),
            value: f.value,
            dangerouslySetInnerHTML: { __html: f.label }
          },
          f.value
        ))
      ]
    }
  );
}, it = {
  type: "Select",
  label: "web_blocks.select",
  category: "core",
  icon: se,
  group: "form",
  props: {
    styles: p({ default: "" }),
    fieldName: b({ title: "web_blocks.field_name", default: "select" }),
    showLabel: k({ title: "web_blocks.show_label", default: !0 }),
    inputStyles: p({ default: "w-full p-1" }),
    label: b({ title: "web_blocks.label", default: "Label" }),
    placeholder: b({
      title: "web_blocks.placeholder",
      default: "Placeholder"
    }),
    required: k({ title: "web_blocks.required", default: !1 }),
    _multiple: k({ title: "web_blocks.multiple", default: !1 }),
    options: U({
      title: "web_blocks.options",
      itemProperties: {
        label: b({ title: "web_blocks.label", default: "" }),
        value: b({ title: "web_blocks.value", default: "" })
      }
    })
  }
}, dt = (e) => {
  const { blockProps: l, fieldName: t, label: s, placeholder: o, styles: n, inputStyles: r, _rows: i, showLabel: c } = e, d = I();
  return c ? /* @__PURE__ */ a.jsxs("div", { ...n, ...l, children: [
    c && /* @__PURE__ */ a.jsx("label", { htmlFor: d, children: s }),
    /* @__PURE__ */ a.jsx("textarea", { name: t, ...r, id: d, placeholder: o, rows: i })
  ] }) : /* @__PURE__ */ a.jsx(
    "textarea",
    {
      id: d,
      name: t,
      ...l,
      ...r,
      ...n,
      placeholder: o,
      rows: i
    }
  );
}, ut = {
  type: "TextArea",
  label: "web_blocks.textarea",
  category: "core",
  icon: A,
  group: "form",
  props: {
    fieldName: b({ title: "web_blocks.field_name", default: "textarea" }),
    showLabel: k({ title: "web_blocks.show_label", default: !0 }),
    styles: p({ default: "" }),
    inputStyles: p({ default: "w-full p-1" }),
    label: b({ title: "web_blocks.label", default: "Label" }),
    placeholder: b({
      title: "web_blocks.placeholder",
      default: "Placeholder"
    }),
    _rows: B({ title: "web_blocks.rows", default: 3 })
  }
}, bt = (e) => {
  const { blockProps: l, fieldName: t, label: s, styles: o, inputStyles: n, required: r, checked: i, showLabel: c = !0 } = e, d = I();
  return c ? /* @__PURE__ */ a.jsxs("div", { ...o, ...l, children: [
    /* @__PURE__ */ a.jsx(
      "input",
      {
        ...n,
        name: t,
        id: d,
        type: "checkbox",
        required: r,
        defaultChecked: i
      }
    ),
    s && s !== "Label" && /* @__PURE__ */ a.jsx("label", { htmlFor: d, children: s })
  ] }) : /* @__PURE__ */ a.jsx(
    "input",
    {
      id: d,
      ...l,
      ...n,
      ...o,
      type: "checkbox",
      required: r,
      name: t
    }
  );
}, pt = {
  type: "Checkbox",
  label: "web_blocks.checkbox",
  category: "core",
  icon: ae,
  group: "form",
  props: {
    fieldName: b({ title: "Field Name", default: "checkbox" }),
    styles: p({ default: "flex items-center gap-x-2" }),
    label: b({ title: "web_blocks.label", default: "Label" }),
    checked: k({ title: "web_blocks.checked", default: !1 }),
    required: k({ title: "web_blocks.required", default: !1 })
  }
}, xt = () => {
  u(de, ue), u(he, ke), u(be, pe), u(ye, ge), u(_e, we), u(xe, ve), u(Ie, Be), u(je, Le), u(Ce, Se), u(Me, Ne), u(Ee, $e), u(Pe, Te), u(He, ze), u(Ae, De), u(me, fe), u(Xe, Ye), u(et, tt), u(lt, ot), u(st, at), u(bt, pt), u(nt, rt), u(ct, it), u(dt, ut), u(Ke, Qe), u(Ze, Je), u(Fe, Oe), u(Ue, Ve), u(Ge, We);
};
export {
  xt as loadWebBlocks
};
