var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
  genCustomKeys: () => genCustomKeys,
  genDefaultKeys: () => genDefaultKeys
});
module.exports = __toCommonJS(stdin_exports);
const genBasicKeys = (props) => {
  const keys = Array(9).fill("").map((_, i) => ({ text: i + 1 }));
  if (props.randomKeyOrder) {
    keys.sort(() => Math.random() > 0.5 ? 1 : -1);
  }
  return keys;
};
const genDefaultKeys = (props) => [
  ...genBasicKeys(props),
  { text: props.extraKey, type: "extra" },
  { text: 0 },
  {
    text: props.showDeleteKey ? props.deleteButtonText : "",
    type: props.showDeleteKey ? "delete" : ""
  }
];
const genCustomKeys = (props) => {
  const keys = genBasicKeys(props);
  const { extraKey } = props;
  const extraKeys = Array.isArray(extraKey) ? extraKey : [extraKey];
  if (extraKeys.length === 1) {
    keys.push({ text: 0, wider: true }, { text: extraKeys[0], type: "extra" });
  } else if (extraKeys.length === 2) {
    keys.push(
      { text: extraKeys[0], type: "extra" },
      { text: 0 },
      { text: extraKeys[1], type: "extra" }
    );
  }
  return keys;
};
