import { X as w, dh as $, Y as o, M, S as l, w as d, bI as T, bH as z, a6 as y, G as S, bJ as D, a9 as V, ar as A, O as s, a3 as C, hy as B, Z as m, hz as F, hA as x, az as O, F as a, aB as H, hB as v, af as b, a7 as r, a8 as n, aa as P, ab as W, L as R } from "./603b75d9.js";
import { useRef as U, useState as p, useEffect as k, useContext as h } from "react";
import { TriContainer as L } from "./d91d7adf.js";
import { ContainerCompBuilder as _ } from "./23a8bd12.js";
import "react-dom";
import "./48fb13b8.js";
import "./046c0def.js";
const {
  Meta: N
} = v, j = w.div`
  height: 100%;
  width: 100%;
  .ant-card-small >.ant-card-head {
    border: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.border;
}};
    border-style: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.borderStyle;
}};
    border-width: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.borderWidth;
}};
    border-radius: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.radius;
}};
    font-size: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.textSize;
}};
    font-style: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.fontStyle;
}};
    font-family: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.fontFamily;
}};
    font-weight: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.textWeight;
}};
    text-transform: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.textTransform;
}};
    text-decoration: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.textDecoration;
}};
    color: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.text;
}};
    rotate: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.rotation;
}};
    margin: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.margin;
}};
    padding: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.padding;
}};
    ${(t) => $(t.$headerStyle)}
  }
  .ant-card-head-title{
    font-size: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.textSize;
}};
    font-family: ${(t) => {
  var e;
  return (e = t.$headerStyle) == null ? void 0 : e.fontFamily;
}};
  }
  .ant-card .ant-card-actions {
    border-top: 1px solid ${(t) => {
  var e;
  return (e = t.$style) == null ? void 0 : e.border;
}};
  }
  .ant-card .ant-card-actions>li:not(:last-child) {
    border-inline-end: 1px solid ${(t) => {
  var e;
  return (e = t.$style) == null ? void 0 : e.border;
}};
  }
  .ant-card .ant-card-actions {
    ${(t) => t.$style && $(t.$style)}
  }
  .ant-card .ant-card-body {
    border: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.border;
}};
    border-style: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.borderStyle;
}};
    border-width: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.borderWidth;
}};
    border-radius: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.radius;
}};
    rotate: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.rotation;
}};
    margin: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.margin;
}};
    padding: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.padding;
}};
    ${(t) => $(t.$bodyStyle)}
  }
  .ant-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: ${(t) => {
  var e;
  return (e = t.$style) == null ? void 0 : e.margin;
}};
    padding: ${(t) => {
  var e;
  return (e = t.$style) == null ? void 0 : e.padding;
}};
    border: ${(t) => {
  var e;
  return (e = t.$style) == null ? void 0 : e.border;
}};
    rotate: ${(t) => {
  var e;
  return (e = t.$style) == null ? void 0 : e.rotation;
}};
    border-style: ${(t) => {
  var e;
  return (e = t.$style) == null ? void 0 : e.borderStyle;
}};
    border-radius: ${(t) => {
  var e;
  return (e = t.$style) == null ? void 0 : e.radius;
}};
    border-width: ${(t) => {
  var e;
  return (e = t.$style) == null ? void 0 : e.borderWidth;
}};
    box-shadow: ${(t) => {
  var e, c;
  return `${(e = t.$style) == null ? void 0 : e.boxShadow} ${(c = t.$style) == null ? void 0 : c.boxShadowColor}`;
}};
    ${(t) => t.$style && $(t.$style)}
    ${(t) => t.$animationStyle}
  }
  .ant-card-body {
    display: ${(t) => t.$showMate ? "" : "none"};
    height: ${(t) => t.$cardType == "custom" ? "100%" : "auto"};
  }
  .ant-card-body .ant-card-meta .ant-card-meta-title{
    color: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.text;
}} !important;
    font-size: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.textSize;
}};
    font-style: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.fontStyle;
}};
    font-family: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.fontFamily;
}};
    font-weight: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.textWeight;
}};
    text-transform: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.textTransform;
}};
    text-decoration: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.textDecoration;
}};
  }
  .ant-card-body .ant-card-meta .ant-card-meta-description{
    color: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.text;
}} !important;
    font-size: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.textSize;
}};
    font-style: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.fontStyle;
}};
    font-family: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.fontFamily;
}};
    font-weight: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.textWeight;
}};
    text-transform: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.textTransform;
}};
    text-decoration: ${(t) => {
  var e;
  return (e = t.$bodyStyle) == null ? void 0 : e.textDecoration;
}};
  }
`, G = w.div`
  height: 100%;
  width: 100%;
`, Y = w.div`
  pointer-events: ${(t) => t.disabled ? "none" : ""};
  svg {
    color: ${(t) => {
  var e;
  return t.disabled ? "#d9d9d9" : (e = t.$style) == null ? void 0 : e.IconColor;
}};
  }
  &:hover {
    svg {
      color: ${(t) => {
  var e;
  return (e = t.$style) == null ? void 0 : e.activateColor;
}};
    }
}
`, J = [{
  label: o("card.common"),
  value: "common"
}, {
  label: o("card.custom"),
  value: "custom"
}], X = [{
  label: o("card.default"),
  value: "default"
}, {
  label: o("card.small"),
  value: "small"
}], Z = new M({
  label: l,
  icon: d(R, "/icon:antd/settingoutlined"),
  disabled: T,
  hidden: T,
  onEvent: z
}, (t) => t).setPropertyViewFn((t) => /* @__PURE__ */ y(S, {
  children: [t.icon.propertyView({
    label: o("button.icon")
  }), D(t), V(t), t.onEvent.getPropertyView()]
})).build(), q = A(Z, {
  initOptions: [{
    label: o("optionsControl.optionI", {
      i: 1
    }),
    icon: "/icon:antd/settingoutlined"
  }, {
    label: o("optionsControl.optionI", {
      i: 2
    }),
    icon: "/icon:antd/editoutlined"
  }, {
    label: o("optionsControl.optionI", {
      i: 3
    }),
    icon: "/icon:antd/ellipsisoutlined"
  }]
}), K = function() {
  const t = {
    showTitle: s.DEFAULT_TRUE,
    title: d(l, o("card.title")),
    size: C(X, "small"),
    extraTitle: d(l, o("card.more")),
    cardType: C(J, "common"),
    CoverImg: s.DEFAULT_TRUE,
    imgSrc: d(l, "https://lowcoder.cloud/images/e0a89736c6be4393893d2981ac1fd753.png"),
    imgHeight: d(l, "auto"),
    showMeta: s.DEFAULT_TRUE,
    metaTitle: d(l, o("card.metaTitle")),
    metaDesc: d(l, o("card.metaDesc")),
    hoverable: s.DEFAULT_TRUE,
    showActionIcon: s.DEFAULT_TRUE,
    actionOptions: q,
    onEvent: B,
    style: m(F, "style"),
    headerStyle: m(x, "headerStyle"),
    bodyStyle: m(x, "bodyStyle"),
    animationStyle: m(O, "animationStyle")
  };
  return new _(t, (e) => {
    e.container.showHeader = !1, e.container.style = Object.assign(e.container.style, {
      CONTAINER_BODY_PADDING: e.style.containerBodyPadding,
      border: "#00000000",
      background: e.style.background
    });
    const c = U(null), [g, E] = p(0), [u, I] = p(0);
    k(() => {
      u && g && f();
    }, [u, g]);
    const f = () => {
      const i = c.current;
      E((i == null ? void 0 : i.clientWidth) ?? 0), I((i == null ? void 0 : i.clientHeight) ?? 0);
    };
    return /* @__PURE__ */ a(H, {
      onResize: f,
      children: /* @__PURE__ */ a(j, {
        ref: c,
        $style: e.style,
        $animationStyle: e.animationStyle,
        $headerStyle: e.headerStyle,
        $bodyStyle: e.bodyStyle,
        $showMate: e.showMeta || e.cardType == "custom",
        $cardType: e.cardType,
        onMouseEnter: () => e.onEvent("focus"),
        onMouseLeave: () => e.onEvent("blur"),
        onClick: () => e.onEvent("click"),
        children: /* @__PURE__ */ y(v, {
          style: {
            width: g,
            height: "100%"
          },
          size: e.size,
          hoverable: e.hoverable,
          title: e.showTitle && e.title,
          extra: e.showTitle && /* @__PURE__ */ a("a", {
            href: "#",
            onClick: () => e.onEvent("clickExtra"),
            children: e.extraTitle
          }),
          cover: e.cardType == "common" && e.CoverImg && /* @__PURE__ */ a("img", {
            src: e.imgSrc,
            height: e.imgHeight
          }),
          actions: e.cardType == "common" && e.showActionIcon ? e.actionOptions.filter((i) => !i.hidden).map((i) => /* @__PURE__ */ a(Y, {
            onClick: () => i.onEvent("click"),
            disabled: i.disabled,
            $style: e.style,
            children: i.icon
          })) : [],
          children: [e.cardType == "common" && e.showMeta && /* @__PURE__ */ a(N, {
            title: e.metaTitle,
            description: e.metaDesc
          }), e.cardType == "custom" && /* @__PURE__ */ a(G, {
            children: /* @__PURE__ */ a(L, {
              ...e
            })
          })]
        })
      })
    });
  }).setPropertyViewFn((e) => /* @__PURE__ */ y(S, {
    children: [(h(b).editorModeStatus === "logic" || h(b).editorModeStatus === "both") && /* @__PURE__ */ y(S, {
      children: [/* @__PURE__ */ y(r, {
        name: n.basic,
        children: [e.size.propertyView({
          label: o("card.titleSize"),
          radioButton: !0
        }), e.showTitle.propertyView({
          label: o("card.showTitle")
        }), e.showTitle.getView() && e.title.propertyView({
          label: o("card.title")
        }), e.showTitle.getView() && e.extraTitle.propertyView({
          label: o("card.extraTitle")
        }), e.cardType.getView() == "common" && e.CoverImg.propertyView({
          label: o("card.CoverImg")
        }), e.cardType.getView() == "common" && e.CoverImg.getView() && e.imgSrc.propertyView({
          label: o("card.imgSrc")
        }), e.cardType.getView() == "common" && e.CoverImg.getView() && e.imgHeight.propertyView({
          label: o("card.imgHeight")
        }), e.cardType.getView() == "common" && e.showMeta.propertyView({
          label: o("card.showMeta")
        }), e.cardType.getView() == "common" && e.showMeta.getView() && e.metaTitle.propertyView({
          label: o("card.metaTitle")
        }), e.cardType.getView() == "common" && e.showMeta.getView() && e.metaDesc.propertyView({
          label: o("card.metaDesc")
        }), e.cardType.getView() == "common" && e.showActionIcon.propertyView({
          label: o("card.showActionIcon")
        }), e.cardType.getView() == "common" && e.showActionIcon.getView() && e.actionOptions.propertyView({
          title: o("card.actionOptions")
        })]
      }), /* @__PURE__ */ y(r, {
        name: n.interaction,
        children: [V(e), e.onEvent.getPropertyView()]
      })]
    }), (h(b).editorModeStatus === "layout" || h(b).editorModeStatus === "both") && /* @__PURE__ */ y(S, {
      children: [/* @__PURE__ */ a(r, {
        name: n.layout,
        children: e.cardType.propertyView({
          label: o("card.cardType"),
          radioButton: !0
        })
      }), /* @__PURE__ */ a(r, {
        name: n.style,
        children: e.style.getPropertyView()
      }), /* @__PURE__ */ a(r, {
        name: n.headerStyle,
        children: e.headerStyle.getPropertyView()
      }), /* @__PURE__ */ a(r, {
        name: n.bodyStyle,
        children: e.bodyStyle.getPropertyView()
      }), /* @__PURE__ */ a(r, {
        name: n.animationStyle,
        hasTooltip: !0,
        children: e.animationStyle.getPropertyView()
      })]
    })]
  })).build();
}(), ne = P(K, [W]);
export {
  ne as CardComp,
  K as ContainerBaseComp
};
