"use strict";
const React = require("react");
var __read = globalThis && globalThis.__read || function(o, n) {
  var m = typeof Symbol === "function" && o[Symbol.iterator];
  if (!m)
    return o;
  var i = m.call(o), r, ar = [], e;
  try {
    while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
      ar.push(r.value);
  } catch (error) {
    e = { error };
  } finally {
    try {
      if (r && !r.done && (m = i["return"]))
        m.call(i);
    } finally {
      if (e)
        throw e.error;
    }
  }
  return ar;
};
var globalInstanceIdMap = {};
function useId(prefix) {
  var _a = __read(React.useState(), 2), id = _a[0], setId = _a[1];
  React.useEffect(function() {
    globalInstanceIdMap[prefix] = prefix in globalInstanceIdMap ? globalInstanceIdMap[prefix] : 0;
    setId(globalInstanceIdMap[prefix]);
    globalInstanceIdMap[prefix] += 1;
  }, []);
  return typeof id === "number" ? "" + prefix + id : void 0;
}
module.exports = useId;
//# sourceMappingURL=useId.js.map
