import { splice as a } from "../../../micromark-util-chunked@2.0.1/node_modules/micromark-util-chunked/index.js";
const s = {}.hasOwnProperty;
function d(t) {
  const e = {};
  let n = -1;
  for (; ++n < t.length; )
    l(e, t[n]);
  return e;
}
function l(t, e) {
  let n;
  for (n in e) {
    const i = (s.call(t, n) ? t[n] : void 0) || (t[n] = {}), f = e[n];
    let o;
    if (f)
      for (o in f) {
        s.call(i, o) || (i[o] = []);
        const r = f[o];
        h(
          // @ts-expect-error Looks like a list.
          i[o],
          Array.isArray(r) ? r : r ? [r] : []
        );
      }
  }
}
function h(t, e) {
  let n = -1;
  const c = [];
  for (; ++n < e.length; )
    (e[n].add === "after" ? t : c).push(e[n]);
  a(t, 0, 0, c);
}
export {
  d as combineExtensions
};
//# sourceMappingURL=index.js.map
