"use client";
import { factorySpace as a } from "../../micromark-factory-space/index.js";
import { markdownLineEnding as l } from "../../micromark-util-character/index.js";
import { subtokenize as p } from "../../micromark-util-subtokenize/index.js";
const d = {
  resolve: k,
  tokenize: h
}, s = {
  partial: !0,
  tokenize: x
};
function k(n) {
  return p(n), n;
}
function h(n, u) {
  let r;
  return i;
  function i(t) {
    return n.enter("content"), r = n.enter("chunkContent", {
      contentType: "content"
    }), o(t);
  }
  function o(t) {
    return t === null ? c(t) : l(t) ? n.check(s, e, c)(t) : (n.consume(t), o);
  }
  function c(t) {
    return n.exit("chunkContent"), n.exit("content"), u(t);
  }
  function e(t) {
    return n.consume(t), n.exit("chunkContent"), r.next = n.enter("chunkContent", {
      contentType: "content",
      previous: r
    }), r = r.next, o;
  }
}
function x(n, u, r) {
  const i = this;
  return o;
  function o(e) {
    return n.exit("chunkContent"), n.enter("lineEnding"), n.consume(e), n.exit("lineEnding"), a(n, c, "linePrefix");
  }
  function c(e) {
    if (e === null || l(e))
      return r(e);
    const t = i.events[i.events.length - 1];
    return !i.parser.constructs.disable.null.includes("codeIndented") && t && t[1].type === "linePrefix" && t[2].sliceSerialize(t[1], !0).length >= 4 ? u(e) : n.interrupt(i.parser.constructs.flow, r, u)(e);
  }
}
export {
  d as content
};
