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);

// src/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.tsx
var MaxLengthSelect_exports = {};
__export(MaxLengthSelect_exports, {
  default: () => MaxLengthSelect_default
});
module.exports = __toCommonJS(MaxLengthSelect_exports);
var import_react = require("react");
var import_antd = require("antd");
var MaxLengthSelect = (props, ref) => {
  (0, import_react.useImperativeHandle)(ref, () => {
    return {
      onChange: handleChange
    };
  });
  const handleChange = (e, _option) => {
    if (props.onChange) {
      if ((props.mode === "multiple" || props.mode === "tags") && props.maxLength) {
        if (props.value && props.value.length >= props.maxLength && e.length > props.value.length) {
          return;
        }
      }
      props.onChange(e, _option);
    }
  };
  return /* @__PURE__ */ React.createElement(
    import_antd.Select,
    {
      ...props,
      onChange: handleChange,
      popupMatchSelectWidth: false
    },
    props.children
  );
};
var MaxLengthSelect_default = (0, import_react.forwardRef)(MaxLengthSelect);
