var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellQrcode/index.tsx
var pisellQrcode_exports = {};
__export(pisellQrcode_exports, {
  default: () => pisellQrcode_default
});
module.exports = __toCommonJS(pisellQrcode_exports);
var import_react = __toESM(require("react"));
var import_antd = require("antd");
var import_classnames = __toESM(require("classnames"));
var import_pisellModal = __toESM(require("./../pisellModal"));
var import_locales = require("../../locales/index");
var import_index = require("./index.less");
var PisellQrcode = (props) => {
  const { size, platform, value = "", className } = props;
  const [open, setOpen] = (0, import_react.useState)(false);
  (0, import_react.useEffect)(() => {
    document.body.id = "body";
  }, []);
  const modalRef = (0, import_react.useRef)(null);
  (0, import_react.useEffect)(() => {
    if (open) {
    }
  }, [open]);
  const modalProps = {
    title: (0, import_locales.getText)("pisellQrcode-qrcode"),
    platform,
    onCancel: () => setOpen(false),
    open,
    footer: null,
    mobileModalHeight: "auto",
    className: (0, import_classnames.default)("pisell-qrcode-modal"),
    bodyStyle: {
      padding: 0
    }
  };
  return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-qrcode-wrapper", className) }, /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      onClick: (e) => {
        e.stopPropagation();
        setOpen(true);
      }
    },
    /* @__PURE__ */ import_react.default.createElement(import_antd.QRCode, { size, value, bordered: false })
  ), /* @__PURE__ */ import_react.default.createElement(import_pisellModal.default, { ...modalProps }, /* @__PURE__ */ import_react.default.createElement(import_antd.QRCode, { size: 200, value, style: { marginTop: 24 } }), /* @__PURE__ */ import_react.default.createElement("p", { className: (0, import_classnames.default)("pisell-qrcode-modal-value") }, value), /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, null), /* @__PURE__ */ import_react.default.createElement(
    import_antd.Button,
    {
      onClick: () => setOpen(false),
      className: (0, import_classnames.default)("pisell-qrcode-modal-button")
    },
    (0, import_locales.getText)("pisellQrcode-done")
  )));
};
var pisellQrcode_default = PisellQrcode;
