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AU,IAAM,KAAO,IACjD,KAJA,OAAOc,CAKT,E","sources":["../node_modules/mdast-util-gfm-task-list-item/from-markdown.js","../node_modules/mdast-util-gfm-task-list-item/to-markdown.js"],"sourcesContent":["exports.exit = {\n taskListCheckValueChecked: exitCheck,\n taskListCheckValueUnchecked: exitCheck,\n paragraph: exitParagraphWithTaskListItem\n}\n\nfunction exitCheck(token) {\n // We’re always in a paragraph, in a list item.\n this.stack[this.stack.length - 2].checked =\n token.type === 'taskListCheckValueChecked'\n}\n\nfunction exitParagraphWithTaskListItem(token) {\n var parent = this.stack[this.stack.length - 2]\n var node = this.stack[this.stack.length - 1]\n var siblings = parent.children\n var head = node.children[0]\n var index = -1\n var firstParaghraph\n\n if (\n parent &&\n parent.type === 'listItem' &&\n typeof parent.checked === 'boolean' &&\n head &&\n head.type === 'text'\n ) {\n while (++index < siblings.length) {\n if (siblings[index].type === 'paragraph') {\n firstParaghraph = siblings[index]\n break\n }\n }\n\n if (firstParaghraph === node) {\n // Must start with a space or a tab.\n head.value = head.value.slice(1)\n\n if (head.value.length === 0) {\n node.children.shift()\n } else {\n head.position.start.column++\n head.position.start.offset++\n node.position.start = Object.assign({}, head.position.start)\n }\n }\n }\n\n this.exit(token)\n}\n","var defaultListItem = require('mdast-util-to-markdown/lib/handle/list-item')\n\nexports.unsafe = [{atBreak: true, character: '-', after: '[:|-]'}]\n\nexports.handlers = {\n listItem: listItemWithTaskListItem\n}\n\nfunction listItemWithTaskListItem(node, parent, context) {\n var value = defaultListItem(node, parent, context)\n var head = node.children[0]\n\n if (typeof node.checked === 'boolean' && head && head.type === 'paragraph') {\n value = value.replace(/^(?:[*+-]|\\d+\\.)([\\r\\n]| {1,3})/, check)\n }\n\n return value\n\n function check($0) {\n return $0 + '[' + (node.checked ? 'x' : ' ') + '] '\n }\n}\n"],"names":["exitCheck","token","this","stack","length","checked","type","exports","exit","taskListCheckValueChecked","taskListCheckValueUnchecked","paragraph","firstParaghraph","parent","node","siblings","children","head","index","value","slice","shift","position","start","column","offset","Object","assign","defaultListItem","require","unsafe","atBreak","character","after","handlers","listItem","context","replace","$0"],"sourceRoot":""}