import { a0 as l, bP as u, bb as c, bv as b, ba as C, bB as h, eb as m, U as v, V as t, P as a, bh as n, bi as o, bj as i, bg as s, bl as y, bn as Q, bo as R, bG as w, ca as x, cb as f, ec as M } from "./684d2f28.js";
import { useContext as g } from "react";
import "react-dom";
const V = [{
  label: l("QRCode.L"),
  value: "L"
}, {
  label: l("QRCode.M"),
  value: "M"
}, {
  label: l("QRCode.Q"),
  value: "Q"
}, {
  label: l("QRCode.H"),
  value: "H"
}], S = {
  value: u("value"),
  level: c(V, "L"),
  includeMargin: b.DEFAULT_TRUE,
  image: C,
  style: h(m)
}, p = (e) => {
  const r = e.value.value;
  return r.length > 2953 ? /* @__PURE__ */ t(n, {
    children: l("QRCode.maxLength")
  }) : /* @__PURE__ */ t("div", {
    style: {
      margin: e.style.margin,
      padding: e.includeMargin ? e.style.padding : 0,
      width: x(e.style.margin),
      height: f(e.style.margin),
      background: e.style.background,
      borderRadius: e.style.radius,
      border: `${e.style.borderWidth ? e.style.borderWidth : "1px"} solid ${e.style.border}`
    },
    children: /* @__PURE__ */ t(M, {
      value: r,
      level: e.level,
      width: "100%",
      height: "100%",
      bgColor: e.style.background,
      fgColor: e.style.color,
      includeMargin: !1,
      imageSettings: e.image ? {
        src: e.image,
        width: 0,
        height: 0,
        excavate: !0
      } : void 0
    })
  });
};
let d = function() {
  return new v(S, (e) => /* @__PURE__ */ t(p, {
    ...e
  })).setPropertyViewFn((e) => /* @__PURE__ */ a(n, {
    children: [/* @__PURE__ */ t(o, {
      name: i.basic,
      children: e.value.propertyView({
        label: l("QRCode.value"),
        tooltip: l("QRCode.valueTooltip"),
        placeholder: "https://example.com"
      })
    }), ["logic", "both"].includes(g(s).editorModeStatus) && /* @__PURE__ */ a(n, {
      children: [/* @__PURE__ */ t(o, {
        name: i.interaction,
        children: y(e)
      }), /* @__PURE__ */ a(o, {
        name: i.advanced,
        children: [e.level.propertyView({
          label: l("QRCode.level"),
          tooltip: l("QRCode.levelTooltip")
        }), e.image.propertyView({
          label: l("QRCode.image"),
          placeholder: "http://logo.jpg"
        })]
      })]
    }), ["layout", "both"].includes(g(s).editorModeStatus) && /* @__PURE__ */ a(o, {
      name: i.style,
      children: [e.style.getPropertyView(), e.includeMargin.propertyView({
        label: l("QRCode.includeMargin")
      })]
    })]
  })).build();
}();
d = class extends d {
  autoHeight() {
    return !1;
  }
};
const j = Q(d, [new R("value", l("QRCode.valueDesc")), w]);
export {
  j as QRCodeComp
};
