import * as tsplus_module_1 from "@effect/core/stm/STM/operations/unit";
import * as tsplus_module_2 from "@tsplus/stdlib/collections/SortedMap/getOrd";
import * as tsplus_module_3 from "@tsplus/stdlib/collections/SortedMap/empty";
import * as tsplus_module_4 from "@tsplus/stdlib/collections/Chunk/single";
import * as tsplus_module_5 from "@tsplus/stdlib/collections/SortedMap/set";
import * as tsplus_module_6 from "@tsplus/stdlib/collections/Collection/functions";
import * as tsplus_module_7 from "@effect/core/stm/TRef/operations/getAndUpdate";
import * as tsplus_module_8 from "@effect/core/stm/STM/operations/map";
import { concreteTPriorityQueue } from "@effect/core/stm/TPriorityQueue/operations/_internal/InternalTPriorityQueue";
/**
 * Offers all of the elements in the specified collection to the queue.
 *
 * @tsplus fluent ets/TPriorityQueue offerAll
 */

export function offerAll_(self, values) {
  void 0;
  return tsplus_module_8.map_(tsplus_module_7.getAndUpdate_(self.map, sa => tsplus_module_6.reduce_(values(), tsplus_module_3.empty(tsplus_module_2.getOrd(sa)), (map, a) => tsplus_module_5.set_(map, a, tsplus_module_4.single(a)))), () => tsplus_module_1.unit_);
}
/**
 * Offers all of the elements in the specified collection to the queue.
 *
 * @tsplus static ets/TPriorityQueue/Aspects offerAll
 */

export const offerAll = values => self => offerAll_(self, values);
//# sourceMappingURL=offerAll.mjs.map