import { factorySpace as h } from "../../../../micromark-factory-space@2.0.1/node_modules/micromark-factory-space/index.es.js";
import { markdownLineEndingOrSpace as m, markdownLineEnding as C, markdownSpace as c } from "../../../../micromark-util-character@2.1.1/node_modules/micromark-util-character/index.es.js";
const l = {
  name: "tasklistCheck",
  tokenize: L
};
function g() {
  return {
    text: {
      91: l
    }
  };
}
function L(n, i, r) {
  const k = this;
  return e;
  function e(t) {
    return (
      // Exit if there’s stuff before.
      k.previous !== null || // Exit if not in the first content that is the first child of a list
      // item.
      !k._gfmTasklistFirstContentOfListItem ? r(t) : (n.enter("taskListCheck"), n.enter("taskListCheckMarker"), n.consume(t), n.exit("taskListCheckMarker"), u)
    );
  }
  function u(t) {
    return m(t) ? (n.enter("taskListCheckValueUnchecked"), n.consume(t), n.exit("taskListCheckValueUnchecked"), a) : t === 88 || t === 120 ? (n.enter("taskListCheckValueChecked"), n.consume(t), n.exit("taskListCheckValueChecked"), a) : r(t);
  }
  function a(t) {
    return t === 93 ? (n.enter("taskListCheckMarker"), n.consume(t), n.exit("taskListCheckMarker"), n.exit("taskListCheck"), s) : r(t);
  }
  function s(t) {
    return C(t) ? i(t) : c(t) ? n.check({
      tokenize: o
    }, i, r)(t) : r(t);
  }
}
function o(n, i, r) {
  return h(n, k, "whitespace");
  function k(e) {
    return e === null ? r(e) : i(e);
  }
}
export {
  g as gfmTaskListItem
};
//# sourceMappingURL=syntax.es.js.map
