import { b9 as l, de as u, a0 as o, bP as p, cv as w, bb as s, df as x, bB as b, dg as f, U as $, V as n, dh as C, P as a, bh as m, bi as r, bj as i, bg as h, bl as y, bn as v, bo as k, bG as A, co as S, ca as V, cb as T, di as z, dj as H, dk as P } from "./684d2f28.js";
import { useContext as c } from "react";
import { MarginControl as B } from "./0f3d7a1a.js";
import { PaddingControl as F } from "./2d5fc5ff.js";
import "react-dom";
const M = (t) => S`
    border-radius: ${t.radius ? t.radius : "4px"};
    border: ${t.borderWidth ? t.borderWidth : "0px"} solid ${t.border};
    color: ${t.text};
    font-size: ${t.textSize} !important;
    font-weight: ${t.textWeight} !important;
    font-family: ${t.fontFamily} !important;
    font-style:${t.fontStyle} !important;
    text-transform:${t.textTransform} !important;
    text-decoration:${t.textDecoration} !important;
    background-color: ${t.background};
    .markdown-body a {
      color: ${t.links};
    }
    .markdown-body {
      margin: ${t.margin} !important;	
      padding: ${t.padding};	
      width: ${V(t.margin)};	
      // height: ${T(t.margin)};
      h1 {
        line-height: 1.5;
      }
      h5 {
        line-height: 2.2;
      }
    }

    .markdown-body {
      &,
      p,
      div,
      h1,
      h2,
      h3,
      h4,
      h5,
      h6 {
        color: ${t.text};
      }
      img,
      pre {
        background-color: ${t.background};
        code {
          color: #000000;
        }
      }
    }
  `, j = l.div`
  height: 100%;
  overflow: auto;
  margin: 0;
  ${(t) => t.$type === "text" && "white-space:break-spaces;line-height: 1.9;"};
  ${(t) => t.$styleConfig && M(t.$styleConfig)}
  display: flex;
  font-size: 13px;
  ${u};
  overflow-wrap: anywhere;
  .markdown-body {
    overflow-wrap: anywhere;
  }
`, W = l(z)`
  transform: rotate(90deg);
`, D = l(H)`
  transform: rotate(90deg);
`, E = l(P)`
  transform: rotate(90deg);
`, N = [{
  label: "Markdown",
  value: "markdown"
}, {
  label: o("text"),
  value: "text"
}], R = [{
  label: /* @__PURE__ */ n(W, {}),
  value: "flex-start"
}, {
  label: /* @__PURE__ */ n(E, {}),
  value: "center"
}, {
  label: /* @__PURE__ */ n(D, {}),
  value: "flex-end"
}];
let d = function() {
  const t = {
    text: p("text", o("textShow.text", {
      name: "{{currentUser.name}}"
    })),
    autoHeight: w,
    type: s(N, "markdown"),
    horizontalAlignment: x(),
    verticalAlignment: s(R, "center"),
    style: b(f),
    margin: B,
    padding: F
  };
  return new $(t, (e) => {
    const g = e.text.value;
    return /* @__PURE__ */ n(j, {
      $type: e.type,
      $styleConfig: e.style,
      style: {
        justifyContent: e.horizontalAlignment,
        alignItems: e.autoHeight ? "center" : e.verticalAlignment,
        textAlign: e.horizontalAlignment
      },
      children: e.type === "markdown" ? /* @__PURE__ */ n(C, {
        children: g
      }) : g
    });
  }).setPropertyViewFn((e) => /* @__PURE__ */ a(m, {
    children: [/* @__PURE__ */ a(r, {
      name: i.basic,
      children: [e.type.propertyView({
        label: o("value"),
        tooltip: o("textShow.valueTooltip"),
        radioButton: !0
      }), e.text.propertyView({})]
    }), ["logic", "both"].includes(c(h).editorModeStatus) && /* @__PURE__ */ n(r, {
      name: i.interaction,
      children: y(e)
    }), ["layout", "both"].includes(c(h).editorModeStatus) && /* @__PURE__ */ a(m, {
      children: [/* @__PURE__ */ a(r, {
        name: i.layout,
        children: [e.autoHeight.getPropertyView(), !e.autoHeight.getView() && e.verticalAlignment.propertyView({
          label: o("textShow.verticalAlignment"),
          radioButton: !0
        }), e.horizontalAlignment.propertyView({
          label: o("textShow.horizontalAlignment"),
          radioButton: !0
        })]
      }), /* @__PURE__ */ n(r, {
        name: i.style,
        children: e.style.getPropertyView()
      })]
    })]
  })).build();
}();
d = class extends d {
  autoHeight() {
    return this.children.autoHeight.getView();
  }
};
const q = v(d, [new k("text", o("textShow.textDesc")), A]);
export {
  q as TextComp
};
