var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {enumerable: true, configurable: true, writable: true, value}) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
function fromEntries(entries) {
  const obj = {};
  for (const [k, v] of entries) {
    obj[k] = v;
  }
  return obj;
}
function addRollupInput(inputOptions, newInputs) {
  if (!inputOptions.input) {
    return __spreadProps(__spreadValues({}, inputOptions), {input: newInputs});
  }
  if (typeof inputOptions.input === "string") {
    return __spreadProps(__spreadValues({}, inputOptions), {
      input: [inputOptions.input, ...newInputs]
    });
  }
  if (Array.isArray(inputOptions.input)) {
    return __spreadProps(__spreadValues({}, inputOptions), {
      input: [...inputOptions.input, ...newInputs]
    });
  }
  if (typeof inputOptions.input === "object") {
    return __spreadProps(__spreadValues({}, inputOptions), {
      input: __spreadValues(__spreadValues({}, inputOptions.input), fromEntries(newInputs.map((i) => [i.split("/").slice(-1)[0].split(".")[0], i])))
    });
  }
  throw new Error(`Unknown rollup input type. Supported inputs are string, array and object.`);
}
export {
  addRollupInput
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc3JjL3ZpdGUtcGx1Z2luLWJ1aWxkLWh0bWwvYWRkLXJvbGx1cC1pbnB1dC50cyJdLAogICJtYXBwaW5ncyI6ICI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFQSxxQkFBd0IsU0FBd0I7QUFDOUMsUUFBTSxNQUF5QjtBQUMvQixhQUFXLENBQUMsR0FBRyxNQUFNLFNBQVM7QUFDNUIsUUFBSSxLQUFLO0FBQUE7QUFFWCxTQUFPO0FBQUE7QUFHRix3QkFBd0IsY0FBNEIsV0FBbUM7QUFHNUYsTUFBSSxDQUFDLGFBQWEsT0FBTztBQUN2QixXQUFPLGlDQUFLLGVBQUwsQ0FBbUIsT0FBTztBQUFBO0FBR25DLE1BQUksT0FBTyxhQUFhLFVBQVUsVUFBVTtBQUMxQyxXQUFPLGlDQUNGLGVBREU7QUFBQSxNQUVMLE9BQU8sQ0FBQyxhQUFhLE9BQU8sR0FBRztBQUFBO0FBQUE7QUFJbkMsTUFBSSxNQUFNLFFBQVEsYUFBYSxRQUFRO0FBQ3JDLFdBQU8saUNBQ0YsZUFERTtBQUFBLE1BRUwsT0FBTyxDQUFDLEdBQUcsYUFBYSxPQUFPLEdBQUc7QUFBQTtBQUFBO0FBSXRDLE1BQUksT0FBTyxhQUFhLFVBQVUsVUFBVTtBQUMxQyxXQUFPLGlDQUNGLGVBREU7QUFBQSxNQUVMLE9BQU8sa0NBQ0YsYUFBYSxRQUNiLFlBQVksVUFBVSxJQUFJLENBQUMsTUFBTSxDQUFDLEVBQUUsTUFBTSxLQUFLLE1BQU0sSUFBSSxHQUFHLE1BQU0sS0FBSyxJQUFJO0FBQUE7QUFBQTtBQUtwRixRQUFNLElBQUksTUFBTTtBQUFBOyIsCiAgIm5hbWVzIjogW10KfQo=
