{"version":3,"file":"index.mjs","sources":["../src/heading.js","../src/bold.js","../src/italic.js","../src/strikeThrough.js","../src/code.js","../src/autoLink.js","../src/email.js","../src/anything.js","../src/index.js"],"sourcesContent":["import * as A from \"arcsecond\";\n\nconst newline = A.lookAhead(A.str(\"\\n\"));\nconst newLineOrEndOfInput = A.choice([A.endOfInput, newline]);\n\n// # followed by space followed by any chars till \\n\nconst h1 = A.between(A.str(\"# \"))(newLineOrEndOfInput)(\n  A.everythingUntil(newLineOrEndOfInput)\n).map((result) => `<h1>${result}</h1>`);\n\n// ## followed by space followed by any chars till \\n\nconst h2 = A.between(A.str(\"## \"))(newLineOrEndOfInput)(\n  A.everythingUntil(newLineOrEndOfInput)\n).map((result) => `<h2>${result}</h2>`);\n\n// ### followed by space followed by any chars till \\n\nconst h3 = A.between(A.str(\"### \"))(newLineOrEndOfInput)(\n  A.everythingUntil(newLineOrEndOfInput)\n).map((result) => `<h3>${result}</h3>`);\n\n// ### followed by space followed by any chars till \\n\nconst h4 = A.between(A.str(\"#### \"))(newLineOrEndOfInput)(\n  A.everythingUntil(newLineOrEndOfInput)\n).map((result) => `<h4>${result}</h4>`);\n\n// ### followed by space followed by any chars till \\n\nconst h5 = A.between(A.str(\"##### \"))(newLineOrEndOfInput)(\n  A.everythingUntil(newLineOrEndOfInput)\n).map((result) => `<h5>${result}</h5>`);\n\nconst heading = A.choice([h1, h2, h3, h4, h5]);\n\nexport default heading;\n","import * as A from \"arcsecond\";\n\n// Anything between **\nconst block = A.str(\"**\");\n\nconst bold = A.between(block)(block)(A.everythingUntil(block)).map(\n  (result) => `<b>${result}</b>`\n);\n\nexport default bold;\n","import * as A from \"arcsecond\";\n\n// Anything between *\nconst block = A.str(\"*\");\n\nconst italic = A.between(block)(block)(A.everythingUntil(block)).map(\n  (result) => `<i>${result}</i>`\n);\n\nexport default italic;\n","import * as A from \"arcsecond\";\n\n// Anything between ~~\nconst block = A.str(\"~~\");\n\nconst strikeThrough = A.between(block)(block)(A.everythingUntil(block)).map(\n  (result) => `<del>${result}</del>`\n);\n\nexport default strikeThrough;\n","import * as A from \"arcsecond\";\n\n// Anything between ```\nconst block = A.str(\"```\");\n\nconst code = A.between(block)(block)(A.everythingUntil(block)).map(\n  (result) => `<code>${result}</code>`\n);\n\nexport default code;\n","import * as A from \"arcsecond\";\n\nconst URL_REGEX = /^((([A-Za-z]{3,9}:(?:\\/\\/)?)(?:[\\-;:&=\\+\\$,\\w]+@)?[A-Za-z0-9\\.\\-]+|(?:www\\.|[\\-;:&=\\+\\$,\\w]+@)[A-Za-z0-9\\.\\-]+)((?:\\/[\\+~%\\/\\.\\w\\-_]*)?\\??(?:[\\-\\+=&;%@\\.\\w_]*)#?(?:[\\.\\!\\/\\\\\\w]*))?)/;\n\nconst autoLink = A.regex(URL_REGEX).map(\n  (result) => `<a href=\"${result}\">${result}</a>`\n);\n\nexport default autoLink;\n","import * as A from \"arcsecond\";\n\nconst EMAIL_REGEX = /^\\S+@\\S+\\.\\S+/;\n\nconst autoLink = A.regex(EMAIL_REGEX).map(\n  (result) => `<a href=\"mailto:${result}\">${result}</a>`\n);\n\nexport default autoLink;\n","import * as A from \"arcsecond\";\n\n// Anything including newline and spaces\nconst anything = A.regex(/^./s).map((result) => result);\n\nexport default anything;\n","import * as A from \"arcsecond\";\n\nimport heading from \"./heading\";\nimport bold from \"./bold\";\nimport italic from \"./italic\";\nimport strikeThrough from \"./strikeThrough\";\nimport code from \"./code\";\nimport autoLink from \"./autoLink\";\nimport email from \"./email\";\nimport anything from \"./anything\";\n\nconst choice = A.choice;\nconst many = A.many;\n\nconst pico = (input) => {\n  return many(\n    choice([\n      heading,\n      bold,\n      italic,\n      strikeThrough,\n      code,\n      email,\n      autoLink,\n      anything,\n    ])\n  )\n    .run(input)\n    .result.join(\"\");\n};\n\nexport default pico;\n\nexport {\n  choice,\n  many,\n  heading,\n  bold,\n  italic,\n  strikeThrough,\n  code,\n  autoLink,\n  anything,\n};\n"],"names":["newLineOrEndOfInput","A","heading","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