import { combineExtensions } from "../micromark-util-combine-extensions/index.js";
import { content } from "./lib-initialize-content.js";
import { document } from "./lib-initialize-document.js";
import { flow } from "./lib-initialize-flow.js";
import { text, string } from "./lib-initialize-text.js";
import * as constructs from "./lib-constructs.js";
import { createTokenizer } from "./lib-create-tokenizer.js";
function parse(options) {
  const settings = options || {};
  const constructs$1 = (
    /** @type {FullNormalizedExtension} */
    combineExtensions([constructs, ...settings.extensions || []])
  );
  const parser = {
    constructs: constructs$1,
    content: create(content),
    defined: [],
    document: create(document),
    flow: create(flow),
    lazy: {},
    string: create(string),
    text: create(text)
  };
  return parser;
  function create(initial) {
    return creator;
    function creator(from) {
      return createTokenizer(parser, initial, from);
    }
  }
}
export {
  parse
};
//# sourceMappingURL=lib-parse.js.map
