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/pro/priceKeyboard/components/cashKeyboard/index.tsx
var cashKeyboard_exports = {};
__export(cashKeyboard_exports, {
  default: () => cashKeyboard_default
});
module.exports = __toCommonJS(cashKeyboard_exports);
var import_react = __toESM(require("react"));
var import_ahooks = require("ahooks");
var import_utils = require("@pisell/utils");
var import_CashKeyboardSimple = __toESM(require("./CashKeyboardSimple"));
var import_CashKeyboardIntact = __toESM(require("./CashKeyboardIntact"));
var import_locales = __toESM(require("./locales"));
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
var CashKeyboard = (props) => {
  var _a, _b, _c, _d, _e, _f, _g;
  const context = (0, import_useEngineContext.default)();
  import_utils.locales.init(
    import_locales.default,
    ((_e = (_d = (_c = (_b = (_a = context.appHelper.utils) == null ? void 0 : _a.getApp) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.locales) == null ? void 0 : _d.getLocale) == null ? void 0 : _e.call(_d)) || ((_g = (_f = context.appHelper.utils) == null ? void 0 : _f.storage) == null ? void 0 : _g.get("umi_locale")) || "en"
  );
  const { getData } = context.appHelper.utils;
  const amountSymbol = props.amountSymbol || (getData == null ? void 0 : getData("shop_symbol")) || "$";
  const { variant = "intact", value, onChange, shortcutsSize, ...otherProps } = props;
  const [internalValue, setInternalValue] = (0, import_ahooks.useControllableValue)(props);
  if (variant === "intact") {
    return /* @__PURE__ */ import_react.default.createElement(
      import_CashKeyboardIntact.default,
      {
        ...otherProps,
        amountSymbol,
        value: internalValue,
        placeholder: `${amountSymbol}0`,
        onChange: setInternalValue,
        shortcutsSize
      }
    );
  }
  return /* @__PURE__ */ import_react.default.createElement(
    import_CashKeyboardSimple.default,
    {
      ...otherProps,
      amountSymbol,
      placeholder: `${amountSymbol}0`,
      value: internalValue,
      onChange: setInternalValue
    }
  );
};
var cashKeyboard_default = CashKeyboard;
