async function mapWithConcurrency(items, concurrency, mapper) {
  if (concurrency <= 0 || items.length <= concurrency) {
    return Promise.all(items.map((item, index) => mapper(item, index)));
  }
  const results = new Array(items.length);
  for (let start = 0; start < items.length; start += concurrency) {
    const chunk = items.slice(start, start + concurrency);
    const chunkResults = await Promise.all(
      chunk.map((item, offset) => mapper(item, start + offset))
    );
    for (let i = 0; i < chunkResults.length; i++) results[start + i] = chunkResults[i];
  }
  return results;
}
export {
  mapWithConcurrency
};
//# sourceMappingURL=bounded-decrypt.js.map
