const p = (o) => {
  var l;
  const t = o.payload.validationErrors, c = [];
  return (l = t == null ? void 0 : t.elements) == null || l.map((r) => {
    if (r.elements) {
      const d = r.jsonPath, n = r.elements[0];
      let s = {};
      if (d && n && n.errorMessage) {
        for (const f in o.meta.arg.requestBody) {
          const m = o.meta.arg.requestBody[f], u = function(e, a) {
            if (e && a && e[a])
              return e[a];
          }, E = (d.match(/\d+|\w+/gm) ?? []).reduce(u, m);
          s = {
            ...s,
            ...E
          };
        }
        const i = {
          ...n,
          info: s
        };
        c.push(i);
      }
    }
  }), c;
};
export {
  p as extractErrorScopes
};
