"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const _arrayMap = require("./_arrayMap.cjs");
const _baseGet = require("./_baseGet.cjs");
const _baseIteratee = require("./_baseIteratee.cjs");
const _baseMap = require("./_baseMap.cjs");
const _baseSortBy = require("./_baseSortBy.cjs");
const _baseUnary = require("./_baseUnary.cjs");
const _compareMultiple = require("./_compareMultiple.cjs");
const identity = require("./identity.cjs");
const isArray = require("./isArray.cjs");
function baseOrderBy(collection, iteratees, orders) {
  if (iteratees.length) {
    iteratees = _arrayMap.default(iteratees, function(iteratee) {
      if (isArray.default(iteratee)) {
        return function(value) {
          return _baseGet.default(value, iteratee.length === 1 ? iteratee[0] : iteratee);
        };
      }
      return iteratee;
    });
  } else {
    iteratees = [identity.default];
  }
  var index = -1;
  iteratees = _arrayMap.default(iteratees, _baseUnary.default(_baseIteratee.default));
  var result = _baseMap.default(collection, function(value, key, collection2) {
    var criteria = _arrayMap.default(iteratees, function(iteratee) {
      return iteratee(value);
    });
    return { "criteria": criteria, "index": ++index, "value": value };
  });
  return _baseSortBy.default(result, function(object, other) {
    return _compareMultiple.default(object, other, orders);
  });
}
exports.default = baseOrderBy;
//# sourceMappingURL=_baseOrderBy.cjs.map
