"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../../devlop@1.1.0/node_modules/devlop/lib/default.cjs.js"),p=require("../../../../mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/index.cjs.js");function u(){return{exit:{taskListCheckValueChecked:h,taskListCheckValueUnchecked:h,paragraph:m}}}function d(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:g}}}function h(s){const e=this.stack[this.stack.length-2];l.ok(e.type==="listItem"),e.checked=s.type==="taskListCheckValueChecked"}function m(s){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const i=this.stack[this.stack.length-1];l.ok(i.type==="paragraph");const t=i.children[0];if(t&&t.type==="text"){const a=e.children;let n=-1,c;for(;++n<a.length;){const r=a[n];if(r.type==="paragraph"){c=r;break}}c===i&&(t.value=t.value.slice(1),t.value.length===0?i.children.shift():i.position&&t.position&&typeof t.position.start.offset=="number"&&(t.position.start.column++,t.position.start.offset++,i.position.start=Object.assign({},t.position.start)))}}this.exit(s)}function g(s,e,i,t){const a=s.children[0],n=typeof s.checked=="boolean"&&a&&a.type==="paragraph",c="["+(s.checked?"x":" ")+"] ",r=i.createTracker(t);n&&r.move(c);let o=p.handle.listItem(s,e,i,{...t,...r.current()});return n&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,k)),o;function k(f){return f+c}}exports.gfmTaskListItemFromMarkdown=u;exports.gfmTaskListItemToMarkdown=d;
//# sourceMappingURL=index.cjs.js.map
