import { __require as P } from "../../../util@0.11.1/node_modules/util/util.js";
import { __require as q } from "../../../is-arrayish@0.2.1/node_modules/is-arrayish/index.js";
var h, p;
function y() {
  if (p)
    return h;
  p = 1;
  var O = P(), g = q(), f = function(e, r) {
    (!e || e.constructor !== String) && (r = e || {}, e = Error.name);
    var n = function b(i) {
      if (!this)
        return new b(i);
      i = i instanceof Error ? i.message : i || this.message, Error.call(this, i), Error.captureStackTrace(this, n), this.name = e, Object.defineProperty(this, "message", {
        configurable: !0,
        enumerable: !1,
        get: function() {
          var t = i.split(/\r?\n/g);
          for (var s in r)
            if (!!r.hasOwnProperty(s)) {
              var a = r[s];
              "message" in a && (t = a.message(this[s], t) || t, g(t) || (t = [t]));
            }
          return t.join(`
`);
        },
        set: function(t) {
          i = t;
        }
      });
      var l = null, o = Object.getOwnPropertyDescriptor(this, "stack"), E = o.get, j = o.value;
      delete o.value, delete o.writable, o.set = function(t) {
        l = t;
      }, o.get = function() {
        var t = (l || (E ? E.call(this) : j)).split(/\r?\n+/g);
        l || (t[0] = this.name + ": " + this.message);
        var s = 1;
        for (var a in r)
          if (!!r.hasOwnProperty(a)) {
            var c = r[a];
            if ("line" in c) {
              var v = c.line(this[a]);
              v && t.splice(s++, 0, "    " + v);
            }
            "stack" in c && c.stack(this[a], t);
          }
        return t.join(`
`);
      }, Object.defineProperty(this, "stack", o);
    };
    return Object.setPrototypeOf ? (Object.setPrototypeOf(n.prototype, Error.prototype), Object.setPrototypeOf(n, Error)) : O.inherits(n, Error), n;
  };
  return f.append = function(u, e) {
    return {
      message: function(r, n) {
        return r = r || e, r && (n[0] += " " + u.replace("%s", r.toString())), n;
      }
    };
  }, f.line = function(u, e) {
    return {
      line: function(r) {
        return r = r || e, r ? u.replace("%s", r.toString()) : null;
      }
    };
  }, h = f, h;
}
export {
  y as __require
};
//# sourceMappingURL=index.js.map
