remark-gfm-4.0.0-cjs.js 105 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577
  1. var __defProp = Object.defineProperty;
  2. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  3. var __getOwnPropNames = Object.getOwnPropertyNames;
  4. var __hasOwnProp = Object.prototype.hasOwnProperty;
  5. var __export = (target, all2) => {
  6. for (var name in all2)
  7. __defProp(target, name, { get: all2[name], enumerable: true });
  8. };
  9. var __copyProps = (to, from, except, desc) => {
  10. if (from && typeof from === "object" || typeof from === "function") {
  11. for (let key of __getOwnPropNames(from))
  12. if (!__hasOwnProp.call(to, key) && key !== except)
  13. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  14. }
  15. return to;
  16. };
  17. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  18. // remark-gfm.js
  19. var remark_gfm_exports = {};
  20. __export(remark_gfm_exports, {
  21. default: () => remark_gfm_default
  22. });
  23. module.exports = __toCommonJS(remark_gfm_exports);
  24. // node_modules/ccount/index.js
  25. function ccount(value, character) {
  26. const source = String(value);
  27. if (typeof character !== "string") {
  28. throw new TypeError("Expected character");
  29. }
  30. let count = 0;
  31. let index = source.indexOf(character);
  32. while (index !== -1) {
  33. count++;
  34. index = source.indexOf(character, index + character.length);
  35. }
  36. return count;
  37. }
  38. // node_modules/devlop/lib/default.js
  39. function ok() {
  40. }
  41. // node_modules/micromark-util-character/index.js
  42. var asciiAlpha = regexCheck(/[A-Za-z]/);
  43. var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
  44. var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
  45. function asciiControl(code3) {
  46. return (
  47. // Special whitespace codes (which have negative values), C0 and Control
  48. // character DEL
  49. code3 !== null && (code3 < 32 || code3 === 127)
  50. );
  51. }
  52. var asciiDigit = regexCheck(/\d/);
  53. var asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
  54. var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
  55. function markdownLineEnding(code3) {
  56. return code3 !== null && code3 < -2;
  57. }
  58. function markdownLineEndingOrSpace(code3) {
  59. return code3 !== null && (code3 < 0 || code3 === 32);
  60. }
  61. function markdownSpace(code3) {
  62. return code3 === -2 || code3 === -1 || code3 === 32;
  63. }
  64. var unicodePunctuation = regexCheck(/\p{P}|\p{S}/u);
  65. var unicodeWhitespace = regexCheck(/\s/);
  66. function regexCheck(regex) {
  67. return check;
  68. function check(code3) {
  69. return code3 !== null && code3 > -1 && regex.test(String.fromCharCode(code3));
  70. }
  71. }
  72. // node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js
  73. function escapeStringRegexp(string) {
  74. if (typeof string !== "string") {
  75. throw new TypeError("Expected a string");
  76. }
  77. return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
  78. }
  79. // node_modules/unist-util-visit-parents/node_modules/unist-util-is/lib/index.js
  80. var convert = (
  81. // Note: overloads in JSDoc can’t yet use different `@template`s.
  82. /**
  83. * @type {(
  84. * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
  85. * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
  86. * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
  87. * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
  88. * ((test?: Test) => Check)
  89. * )}
  90. */
  91. /**
  92. * @param {Test} [test]
  93. * @returns {Check}
  94. */
  95. function(test) {
  96. if (test === null || test === void 0) {
  97. return ok2;
  98. }
  99. if (typeof test === "function") {
  100. return castFactory(test);
  101. }
  102. if (typeof test === "object") {
  103. return Array.isArray(test) ? anyFactory(test) : propsFactory(test);
  104. }
  105. if (typeof test === "string") {
  106. return typeFactory(test);
  107. }
  108. throw new Error("Expected function, string, or object as test");
  109. }
  110. );
  111. function anyFactory(tests) {
  112. const checks = [];
  113. let index = -1;
  114. while (++index < tests.length) {
  115. checks[index] = convert(tests[index]);
  116. }
  117. return castFactory(any);
  118. function any(...parameters) {
  119. let index2 = -1;
  120. while (++index2 < checks.length) {
  121. if (checks[index2].apply(this, parameters)) return true;
  122. }
  123. return false;
  124. }
  125. }
  126. function propsFactory(check) {
  127. const checkAsRecord = (
  128. /** @type {Record<string, unknown>} */
  129. check
  130. );
  131. return castFactory(all2);
  132. function all2(node2) {
  133. const nodeAsRecord = (
  134. /** @type {Record<string, unknown>} */
  135. /** @type {unknown} */
  136. node2
  137. );
  138. let key;
  139. for (key in check) {
  140. if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
  141. }
  142. return true;
  143. }
  144. }
  145. function typeFactory(check) {
  146. return castFactory(type);
  147. function type(node2) {
  148. return node2 && node2.type === check;
  149. }
  150. }
  151. function castFactory(testFunction) {
  152. return check;
  153. function check(value, index, parent) {
  154. return Boolean(
  155. looksLikeANode(value) && testFunction.call(
  156. this,
  157. value,
  158. typeof index === "number" ? index : void 0,
  159. parent || void 0
  160. )
  161. );
  162. }
  163. }
  164. function ok2() {
  165. return true;
  166. }
  167. function looksLikeANode(value) {
  168. return value !== null && typeof value === "object" && "type" in value;
  169. }
  170. // node_modules/unist-util-visit-parents/lib/color.js
  171. function color(d) {
  172. return d;
  173. }
  174. // node_modules/unist-util-visit-parents/lib/index.js
  175. var empty = [];
  176. var CONTINUE = true;
  177. var EXIT = false;
  178. var SKIP = "skip";
  179. function visitParents(tree, test, visitor, reverse) {
  180. let check;
  181. if (typeof test === "function" && typeof visitor !== "function") {
  182. reverse = visitor;
  183. visitor = test;
  184. } else {
  185. check = test;
  186. }
  187. const is4 = convert(check);
  188. const step = reverse ? -1 : 1;
  189. factory(tree, void 0, [])();
  190. function factory(node2, index, parents) {
  191. const value = (
  192. /** @type {Record<string, unknown>} */
  193. node2 && typeof node2 === "object" ? node2 : {}
  194. );
  195. if (typeof value.type === "string") {
  196. const name = (
  197. // `hast`
  198. typeof value.tagName === "string" ? value.tagName : (
  199. // `xast`
  200. typeof value.name === "string" ? value.name : void 0
  201. )
  202. );
  203. Object.defineProperty(visit2, "name", {
  204. value: "node (" + color(node2.type + (name ? "<" + name + ">" : "")) + ")"
  205. });
  206. }
  207. return visit2;
  208. function visit2() {
  209. let result = empty;
  210. let subresult;
  211. let offset;
  212. let grandparents;
  213. if (!test || is4(node2, index, parents[parents.length - 1] || void 0)) {
  214. result = toResult(visitor(node2, parents));
  215. if (result[0] === EXIT) {
  216. return result;
  217. }
  218. }
  219. if ("children" in node2 && node2.children) {
  220. const nodeAsParent = (
  221. /** @type {UnistParent} */
  222. node2
  223. );
  224. if (nodeAsParent.children && result[0] !== SKIP) {
  225. offset = (reverse ? nodeAsParent.children.length : -1) + step;
  226. grandparents = parents.concat(nodeAsParent);
  227. while (offset > -1 && offset < nodeAsParent.children.length) {
  228. const child = nodeAsParent.children[offset];
  229. subresult = factory(child, offset, grandparents)();
  230. if (subresult[0] === EXIT) {
  231. return subresult;
  232. }
  233. offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
  234. }
  235. }
  236. }
  237. return result;
  238. }
  239. }
  240. }
  241. function toResult(value) {
  242. if (Array.isArray(value)) {
  243. return value;
  244. }
  245. if (typeof value === "number") {
  246. return [CONTINUE, value];
  247. }
  248. return value === null || value === void 0 ? empty : [value];
  249. }
  250. // node_modules/mdast-util-find-and-replace/node_modules/unist-util-is/lib/index.js
  251. var convert2 = (
  252. // Note: overloads in JSDoc can’t yet use different `@template`s.
  253. /**
  254. * @type {(
  255. * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
  256. * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
  257. * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
  258. * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
  259. * ((test?: Test) => Check)
  260. * )}
  261. */
  262. /**
  263. * @param {Test} [test]
  264. * @returns {Check}
  265. */
  266. function(test) {
  267. if (test === null || test === void 0) {
  268. return ok3;
  269. }
  270. if (typeof test === "function") {
  271. return castFactory2(test);
  272. }
  273. if (typeof test === "object") {
  274. return Array.isArray(test) ? anyFactory2(test) : propsFactory2(test);
  275. }
  276. if (typeof test === "string") {
  277. return typeFactory2(test);
  278. }
  279. throw new Error("Expected function, string, or object as test");
  280. }
  281. );
  282. function anyFactory2(tests) {
  283. const checks = [];
  284. let index = -1;
  285. while (++index < tests.length) {
  286. checks[index] = convert2(tests[index]);
  287. }
  288. return castFactory2(any);
  289. function any(...parameters) {
  290. let index2 = -1;
  291. while (++index2 < checks.length) {
  292. if (checks[index2].apply(this, parameters)) return true;
  293. }
  294. return false;
  295. }
  296. }
  297. function propsFactory2(check) {
  298. const checkAsRecord = (
  299. /** @type {Record<string, unknown>} */
  300. check
  301. );
  302. return castFactory2(all2);
  303. function all2(node2) {
  304. const nodeAsRecord = (
  305. /** @type {Record<string, unknown>} */
  306. /** @type {unknown} */
  307. node2
  308. );
  309. let key;
  310. for (key in check) {
  311. if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
  312. }
  313. return true;
  314. }
  315. }
  316. function typeFactory2(check) {
  317. return castFactory2(type);
  318. function type(node2) {
  319. return node2 && node2.type === check;
  320. }
  321. }
  322. function castFactory2(testFunction) {
  323. return check;
  324. function check(value, index, parent) {
  325. return Boolean(
  326. looksLikeANode2(value) && testFunction.call(
  327. this,
  328. value,
  329. typeof index === "number" ? index : void 0,
  330. parent || void 0
  331. )
  332. );
  333. }
  334. }
  335. function ok3() {
  336. return true;
  337. }
  338. function looksLikeANode2(value) {
  339. return value !== null && typeof value === "object" && "type" in value;
  340. }
  341. // node_modules/mdast-util-find-and-replace/lib/index.js
  342. function findAndReplace(tree, list2, options) {
  343. const settings = options || {};
  344. const ignored = convert2(settings.ignore || []);
  345. const pairs = toPairs(list2);
  346. let pairIndex = -1;
  347. while (++pairIndex < pairs.length) {
  348. visitParents(tree, "text", visitor);
  349. }
  350. function visitor(node2, parents) {
  351. let index = -1;
  352. let grandparent;
  353. while (++index < parents.length) {
  354. const parent = parents[index];
  355. const siblings = grandparent ? grandparent.children : void 0;
  356. if (ignored(
  357. parent,
  358. siblings ? siblings.indexOf(parent) : void 0,
  359. grandparent
  360. )) {
  361. return;
  362. }
  363. grandparent = parent;
  364. }
  365. if (grandparent) {
  366. return handler(node2, parents);
  367. }
  368. }
  369. function handler(node2, parents) {
  370. const parent = parents[parents.length - 1];
  371. const find = pairs[pairIndex][0];
  372. const replace2 = pairs[pairIndex][1];
  373. let start = 0;
  374. const siblings = parent.children;
  375. const index = siblings.indexOf(node2);
  376. let change = false;
  377. let nodes = [];
  378. find.lastIndex = 0;
  379. let match = find.exec(node2.value);
  380. while (match) {
  381. const position = match.index;
  382. const matchObject = {
  383. index: match.index,
  384. input: match.input,
  385. stack: [...parents, node2]
  386. };
  387. let value = replace2(...match, matchObject);
  388. if (typeof value === "string") {
  389. value = value.length > 0 ? { type: "text", value } : void 0;
  390. }
  391. if (value === false) {
  392. find.lastIndex = position + 1;
  393. } else {
  394. if (start !== position) {
  395. nodes.push({
  396. type: "text",
  397. value: node2.value.slice(start, position)
  398. });
  399. }
  400. if (Array.isArray(value)) {
  401. nodes.push(...value);
  402. } else if (value) {
  403. nodes.push(value);
  404. }
  405. start = position + match[0].length;
  406. change = true;
  407. }
  408. if (!find.global) {
  409. break;
  410. }
  411. match = find.exec(node2.value);
  412. }
  413. if (change) {
  414. if (start < node2.value.length) {
  415. nodes.push({ type: "text", value: node2.value.slice(start) });
  416. }
  417. parent.children.splice(index, 1, ...nodes);
  418. } else {
  419. nodes = [node2];
  420. }
  421. return index + nodes.length;
  422. }
  423. }
  424. function toPairs(tupleOrList) {
  425. const result = [];
  426. if (!Array.isArray(tupleOrList)) {
  427. throw new TypeError("Expected find and replace tuple or list of tuples");
  428. }
  429. const list2 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? tupleOrList : [tupleOrList];
  430. let index = -1;
  431. while (++index < list2.length) {
  432. const tuple = list2[index];
  433. result.push([toExpression(tuple[0]), toFunction(tuple[1])]);
  434. }
  435. return result;
  436. }
  437. function toExpression(find) {
  438. return typeof find === "string" ? new RegExp(escapeStringRegexp(find), "g") : find;
  439. }
  440. function toFunction(replace2) {
  441. return typeof replace2 === "function" ? replace2 : function() {
  442. return replace2;
  443. };
  444. }
  445. // node_modules/mdast-util-gfm-autolink-literal/lib/index.js
  446. var inConstruct = "phrasing";
  447. var notInConstruct = ["autolink", "link", "image", "label"];
  448. function gfmAutolinkLiteralFromMarkdown() {
  449. return {
  450. transforms: [transformGfmAutolinkLiterals],
  451. enter: {
  452. literalAutolink: enterLiteralAutolink,
  453. literalAutolinkEmail: enterLiteralAutolinkValue,
  454. literalAutolinkHttp: enterLiteralAutolinkValue,
  455. literalAutolinkWww: enterLiteralAutolinkValue
  456. },
  457. exit: {
  458. literalAutolink: exitLiteralAutolink,
  459. literalAutolinkEmail: exitLiteralAutolinkEmail,
  460. literalAutolinkHttp: exitLiteralAutolinkHttp,
  461. literalAutolinkWww: exitLiteralAutolinkWww
  462. }
  463. };
  464. }
  465. function gfmAutolinkLiteralToMarkdown() {
  466. return {
  467. unsafe: [
  468. {
  469. character: "@",
  470. before: "[+\\-.\\w]",
  471. after: "[\\-.\\w]",
  472. inConstruct,
  473. notInConstruct
  474. },
  475. {
  476. character: ".",
  477. before: "[Ww]",
  478. after: "[\\-.\\w]",
  479. inConstruct,
  480. notInConstruct
  481. },
  482. {
  483. character: ":",
  484. before: "[ps]",
  485. after: "\\/",
  486. inConstruct,
  487. notInConstruct
  488. }
  489. ]
  490. };
  491. }
  492. function enterLiteralAutolink(token) {
  493. this.enter({ type: "link", title: null, url: "", children: [] }, token);
  494. }
  495. function enterLiteralAutolinkValue(token) {
  496. this.config.enter.autolinkProtocol.call(this, token);
  497. }
  498. function exitLiteralAutolinkHttp(token) {
  499. this.config.exit.autolinkProtocol.call(this, token);
  500. }
  501. function exitLiteralAutolinkWww(token) {
  502. this.config.exit.data.call(this, token);
  503. const node2 = this.stack[this.stack.length - 1];
  504. ok(node2.type === "link");
  505. node2.url = "http://" + this.sliceSerialize(token);
  506. }
  507. function exitLiteralAutolinkEmail(token) {
  508. this.config.exit.autolinkEmail.call(this, token);
  509. }
  510. function exitLiteralAutolink(token) {
  511. this.exit(token);
  512. }
  513. function transformGfmAutolinkLiterals(tree) {
  514. findAndReplace(
  515. tree,
  516. [
  517. [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, findUrl],
  518. [/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g, findEmail]
  519. ],
  520. { ignore: ["link", "linkReference"] }
  521. );
  522. }
  523. function findUrl(_, protocol, domain2, path2, match) {
  524. let prefix = "";
  525. if (!previous(match)) {
  526. return false;
  527. }
  528. if (/^w/i.test(protocol)) {
  529. domain2 = protocol + domain2;
  530. protocol = "";
  531. prefix = "http://";
  532. }
  533. if (!isCorrectDomain(domain2)) {
  534. return false;
  535. }
  536. const parts = splitUrl(domain2 + path2);
  537. if (!parts[0]) return false;
  538. const result = {
  539. type: "link",
  540. title: null,
  541. url: prefix + protocol + parts[0],
  542. children: [{ type: "text", value: protocol + parts[0] }]
  543. };
  544. if (parts[1]) {
  545. return [result, { type: "text", value: parts[1] }];
  546. }
  547. return result;
  548. }
  549. function findEmail(_, atext, label, match) {
  550. if (
  551. // Not an expected previous character.
  552. !previous(match, true) || // Label ends in not allowed character.
  553. /[-\d_]$/.test(label)
  554. ) {
  555. return false;
  556. }
  557. return {
  558. type: "link",
  559. title: null,
  560. url: "mailto:" + atext + "@" + label,
  561. children: [{ type: "text", value: atext + "@" + label }]
  562. };
  563. }
  564. function isCorrectDomain(domain2) {
  565. const parts = domain2.split(".");
  566. if (parts.length < 2 || parts[parts.length - 1] && (/_/.test(parts[parts.length - 1]) || !/[a-zA-Z\d]/.test(parts[parts.length - 1])) || parts[parts.length - 2] && (/_/.test(parts[parts.length - 2]) || !/[a-zA-Z\d]/.test(parts[parts.length - 2]))) {
  567. return false;
  568. }
  569. return true;
  570. }
  571. function splitUrl(url) {
  572. const trailExec = /[!"&'),.:;<>?\]}]+$/.exec(url);
  573. if (!trailExec) {
  574. return [url, void 0];
  575. }
  576. url = url.slice(0, trailExec.index);
  577. let trail2 = trailExec[0];
  578. let closingParenIndex = trail2.indexOf(")");
  579. const openingParens = ccount(url, "(");
  580. let closingParens = ccount(url, ")");
  581. while (closingParenIndex !== -1 && openingParens > closingParens) {
  582. url += trail2.slice(0, closingParenIndex + 1);
  583. trail2 = trail2.slice(closingParenIndex + 1);
  584. closingParenIndex = trail2.indexOf(")");
  585. closingParens++;
  586. }
  587. return [url, trail2];
  588. }
  589. function previous(match, email) {
  590. const code3 = match.input.charCodeAt(match.index - 1);
  591. return (match.index === 0 || unicodeWhitespace(code3) || unicodePunctuation(code3)) && (!email || code3 !== 47);
  592. }
  593. // node_modules/micromark-util-normalize-identifier/index.js
  594. function normalizeIdentifier(value) {
  595. return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
  596. }
  597. // node_modules/mdast-util-gfm-footnote/lib/index.js
  598. footnoteReference.peek = footnoteReferencePeek;
  599. function gfmFootnoteFromMarkdown() {
  600. return {
  601. enter: {
  602. gfmFootnoteDefinition: enterFootnoteDefinition,
  603. gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,
  604. gfmFootnoteCall: enterFootnoteCall,
  605. gfmFootnoteCallString: enterFootnoteCallString
  606. },
  607. exit: {
  608. gfmFootnoteDefinition: exitFootnoteDefinition,
  609. gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,
  610. gfmFootnoteCall: exitFootnoteCall,
  611. gfmFootnoteCallString: exitFootnoteCallString
  612. }
  613. };
  614. }
  615. function gfmFootnoteToMarkdown() {
  616. return {
  617. // This is on by default already.
  618. unsafe: [{ character: "[", inConstruct: ["phrasing", "label", "reference"] }],
  619. handlers: { footnoteDefinition, footnoteReference }
  620. };
  621. }
  622. function enterFootnoteDefinition(token) {
  623. this.enter(
  624. { type: "footnoteDefinition", identifier: "", label: "", children: [] },
  625. token
  626. );
  627. }
  628. function enterFootnoteDefinitionLabelString() {
  629. this.buffer();
  630. }
  631. function exitFootnoteDefinitionLabelString(token) {
  632. const label = this.resume();
  633. const node2 = this.stack[this.stack.length - 1];
  634. ok(node2.type === "footnoteDefinition");
  635. node2.label = label;
  636. node2.identifier = normalizeIdentifier(
  637. this.sliceSerialize(token)
  638. ).toLowerCase();
  639. }
  640. function exitFootnoteDefinition(token) {
  641. this.exit(token);
  642. }
  643. function enterFootnoteCall(token) {
  644. this.enter({ type: "footnoteReference", identifier: "", label: "" }, token);
  645. }
  646. function enterFootnoteCallString() {
  647. this.buffer();
  648. }
  649. function exitFootnoteCallString(token) {
  650. const label = this.resume();
  651. const node2 = this.stack[this.stack.length - 1];
  652. ok(node2.type === "footnoteReference");
  653. node2.label = label;
  654. node2.identifier = normalizeIdentifier(
  655. this.sliceSerialize(token)
  656. ).toLowerCase();
  657. }
  658. function exitFootnoteCall(token) {
  659. this.exit(token);
  660. }
  661. function footnoteReference(node2, _, state, info) {
  662. const tracker = state.createTracker(info);
  663. let value = tracker.move("[^");
  664. const exit2 = state.enter("footnoteReference");
  665. const subexit = state.enter("reference");
  666. value += tracker.move(
  667. state.safe(state.associationId(node2), {
  668. ...tracker.current(),
  669. before: value,
  670. after: "]"
  671. })
  672. );
  673. subexit();
  674. exit2();
  675. value += tracker.move("]");
  676. return value;
  677. }
  678. function footnoteReferencePeek() {
  679. return "[";
  680. }
  681. function footnoteDefinition(node2, _, state, info) {
  682. const tracker = state.createTracker(info);
  683. let value = tracker.move("[^");
  684. const exit2 = state.enter("footnoteDefinition");
  685. const subexit = state.enter("label");
  686. value += tracker.move(
  687. state.safe(state.associationId(node2), {
  688. ...tracker.current(),
  689. before: value,
  690. after: "]"
  691. })
  692. );
  693. subexit();
  694. value += tracker.move(
  695. "]:" + (node2.children && node2.children.length > 0 ? " " : "")
  696. );
  697. tracker.shift(4);
  698. value += tracker.move(
  699. state.indentLines(state.containerFlow(node2, tracker.current()), map)
  700. );
  701. exit2();
  702. return value;
  703. }
  704. function map(line, index, blank) {
  705. if (index === 0) {
  706. return line;
  707. }
  708. return (blank ? "" : " ") + line;
  709. }
  710. // node_modules/mdast-util-gfm-strikethrough/lib/index.js
  711. var constructsWithoutStrikethrough = [
  712. "autolink",
  713. "destinationLiteral",
  714. "destinationRaw",
  715. "reference",
  716. "titleQuote",
  717. "titleApostrophe"
  718. ];
  719. handleDelete.peek = peekDelete;
  720. function gfmStrikethroughFromMarkdown() {
  721. return {
  722. canContainEols: ["delete"],
  723. enter: { strikethrough: enterStrikethrough },
  724. exit: { strikethrough: exitStrikethrough }
  725. };
  726. }
  727. function gfmStrikethroughToMarkdown() {
  728. return {
  729. unsafe: [
  730. {
  731. character: "~",
  732. inConstruct: "phrasing",
  733. notInConstruct: constructsWithoutStrikethrough
  734. }
  735. ],
  736. handlers: { delete: handleDelete }
  737. };
  738. }
  739. function enterStrikethrough(token) {
  740. this.enter({ type: "delete", children: [] }, token);
  741. }
  742. function exitStrikethrough(token) {
  743. this.exit(token);
  744. }
  745. function handleDelete(node2, _, state, info) {
  746. const tracker = state.createTracker(info);
  747. const exit2 = state.enter("strikethrough");
  748. let value = tracker.move("~~");
  749. value += state.containerPhrasing(node2, {
  750. ...tracker.current(),
  751. before: value,
  752. after: "~"
  753. });
  754. value += tracker.move("~~");
  755. exit2();
  756. return value;
  757. }
  758. function peekDelete() {
  759. return "~";
  760. }
  761. // node_modules/markdown-table/index.js
  762. function markdownTable(table, options = {}) {
  763. const align = (options.align || []).concat();
  764. const stringLength = options.stringLength || defaultStringLength;
  765. const alignments = [];
  766. const cellMatrix = [];
  767. const sizeMatrix = [];
  768. const longestCellByColumn = [];
  769. let mostCellsPerRow = 0;
  770. let rowIndex = -1;
  771. while (++rowIndex < table.length) {
  772. const row2 = [];
  773. const sizes2 = [];
  774. let columnIndex2 = -1;
  775. if (table[rowIndex].length > mostCellsPerRow) {
  776. mostCellsPerRow = table[rowIndex].length;
  777. }
  778. while (++columnIndex2 < table[rowIndex].length) {
  779. const cell = serialize(table[rowIndex][columnIndex2]);
  780. if (options.alignDelimiters !== false) {
  781. const size = stringLength(cell);
  782. sizes2[columnIndex2] = size;
  783. if (longestCellByColumn[columnIndex2] === void 0 || size > longestCellByColumn[columnIndex2]) {
  784. longestCellByColumn[columnIndex2] = size;
  785. }
  786. }
  787. row2.push(cell);
  788. }
  789. cellMatrix[rowIndex] = row2;
  790. sizeMatrix[rowIndex] = sizes2;
  791. }
  792. let columnIndex = -1;
  793. if (typeof align === "object" && "length" in align) {
  794. while (++columnIndex < mostCellsPerRow) {
  795. alignments[columnIndex] = toAlignment(align[columnIndex]);
  796. }
  797. } else {
  798. const code3 = toAlignment(align);
  799. while (++columnIndex < mostCellsPerRow) {
  800. alignments[columnIndex] = code3;
  801. }
  802. }
  803. columnIndex = -1;
  804. const row = [];
  805. const sizes = [];
  806. while (++columnIndex < mostCellsPerRow) {
  807. const code3 = alignments[columnIndex];
  808. let before = "";
  809. let after = "";
  810. if (code3 === 99) {
  811. before = ":";
  812. after = ":";
  813. } else if (code3 === 108) {
  814. before = ":";
  815. } else if (code3 === 114) {
  816. after = ":";
  817. }
  818. let size = options.alignDelimiters === false ? 1 : Math.max(
  819. 1,
  820. longestCellByColumn[columnIndex] - before.length - after.length
  821. );
  822. const cell = before + "-".repeat(size) + after;
  823. if (options.alignDelimiters !== false) {
  824. size = before.length + size + after.length;
  825. if (size > longestCellByColumn[columnIndex]) {
  826. longestCellByColumn[columnIndex] = size;
  827. }
  828. sizes[columnIndex] = size;
  829. }
  830. row[columnIndex] = cell;
  831. }
  832. cellMatrix.splice(1, 0, row);
  833. sizeMatrix.splice(1, 0, sizes);
  834. rowIndex = -1;
  835. const lines = [];
  836. while (++rowIndex < cellMatrix.length) {
  837. const row2 = cellMatrix[rowIndex];
  838. const sizes2 = sizeMatrix[rowIndex];
  839. columnIndex = -1;
  840. const line = [];
  841. while (++columnIndex < mostCellsPerRow) {
  842. const cell = row2[columnIndex] || "";
  843. let before = "";
  844. let after = "";
  845. if (options.alignDelimiters !== false) {
  846. const size = longestCellByColumn[columnIndex] - (sizes2[columnIndex] || 0);
  847. const code3 = alignments[columnIndex];
  848. if (code3 === 114) {
  849. before = " ".repeat(size);
  850. } else if (code3 === 99) {
  851. if (size % 2) {
  852. before = " ".repeat(size / 2 + 0.5);
  853. after = " ".repeat(size / 2 - 0.5);
  854. } else {
  855. before = " ".repeat(size / 2);
  856. after = before;
  857. }
  858. } else {
  859. after = " ".repeat(size);
  860. }
  861. }
  862. if (options.delimiterStart !== false && !columnIndex) {
  863. line.push("|");
  864. }
  865. if (options.padding !== false && // Don’t add the opening space if we’re not aligning and the cell is
  866. // empty: there will be a closing space.
  867. !(options.alignDelimiters === false && cell === "") && (options.delimiterStart !== false || columnIndex)) {
  868. line.push(" ");
  869. }
  870. if (options.alignDelimiters !== false) {
  871. line.push(before);
  872. }
  873. line.push(cell);
  874. if (options.alignDelimiters !== false) {
  875. line.push(after);
  876. }
  877. if (options.padding !== false) {
  878. line.push(" ");
  879. }
  880. if (options.delimiterEnd !== false || columnIndex !== mostCellsPerRow - 1) {
  881. line.push("|");
  882. }
  883. }
  884. lines.push(
  885. options.delimiterEnd === false ? line.join("").replace(/ +$/, "") : line.join("")
  886. );
  887. }
  888. return lines.join("\n");
  889. }
  890. function serialize(value) {
  891. return value === null || value === void 0 ? "" : String(value);
  892. }
  893. function defaultStringLength(value) {
  894. return value.length;
  895. }
  896. function toAlignment(value) {
  897. const code3 = typeof value === "string" ? value.codePointAt(0) : 0;
  898. return code3 === 67 || code3 === 99 ? 99 : code3 === 76 || code3 === 108 ? 108 : code3 === 82 || code3 === 114 ? 114 : 0;
  899. }
  900. // node_modules/mdast-util-to-markdown/lib/handle/blockquote.js
  901. function blockquote(node2, _, state, info) {
  902. const exit2 = state.enter("blockquote");
  903. const tracker = state.createTracker(info);
  904. tracker.move("> ");
  905. tracker.shift(2);
  906. const value = state.indentLines(
  907. state.containerFlow(node2, tracker.current()),
  908. map2
  909. );
  910. exit2();
  911. return value;
  912. }
  913. function map2(line, _, blank) {
  914. return ">" + (blank ? "" : " ") + line;
  915. }
  916. // node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js
  917. function patternInScope(stack, pattern) {
  918. return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false);
  919. }
  920. function listInScope(stack, list2, none) {
  921. if (typeof list2 === "string") {
  922. list2 = [list2];
  923. }
  924. if (!list2 || list2.length === 0) {
  925. return none;
  926. }
  927. let index = -1;
  928. while (++index < list2.length) {
  929. if (stack.includes(list2[index])) {
  930. return true;
  931. }
  932. }
  933. return false;
  934. }
  935. // node_modules/mdast-util-to-markdown/lib/handle/break.js
  936. function hardBreak(_, _1, state, info) {
  937. let index = -1;
  938. while (++index < state.unsafe.length) {
  939. if (state.unsafe[index].character === "\n" && patternInScope(state.stack, state.unsafe[index])) {
  940. return /[ \t]/.test(info.before) ? "" : " ";
  941. }
  942. }
  943. return "\\\n";
  944. }
  945. // node_modules/longest-streak/index.js
  946. function longestStreak(value, substring) {
  947. const source = String(value);
  948. let index = source.indexOf(substring);
  949. let expected = index;
  950. let count = 0;
  951. let max = 0;
  952. if (typeof substring !== "string") {
  953. throw new TypeError("Expected substring");
  954. }
  955. while (index !== -1) {
  956. if (index === expected) {
  957. if (++count > max) {
  958. max = count;
  959. }
  960. } else {
  961. count = 1;
  962. }
  963. expected = index + substring.length;
  964. index = source.indexOf(substring, expected);
  965. }
  966. return max;
  967. }
  968. // node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js
  969. function formatCodeAsIndented(node2, state) {
  970. return Boolean(
  971. state.options.fences === false && node2.value && // If there’s no info…
  972. !node2.lang && // And there’s a non-whitespace character…
  973. /[^ \r\n]/.test(node2.value) && // And the value doesn’t start or end in a blank…
  974. !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(node2.value)
  975. );
  976. }
  977. // node_modules/mdast-util-to-markdown/lib/util/check-fence.js
  978. function checkFence(state) {
  979. const marker = state.options.fence || "`";
  980. if (marker !== "`" && marker !== "~") {
  981. throw new Error(
  982. "Cannot serialize code with `" + marker + "` for `options.fence`, expected `` ` `` or `~`"
  983. );
  984. }
  985. return marker;
  986. }
  987. // node_modules/mdast-util-to-markdown/lib/handle/code.js
  988. function code(node2, _, state, info) {
  989. const marker = checkFence(state);
  990. const raw = node2.value || "";
  991. const suffix = marker === "`" ? "GraveAccent" : "Tilde";
  992. if (formatCodeAsIndented(node2, state)) {
  993. const exit3 = state.enter("codeIndented");
  994. const value2 = state.indentLines(raw, map3);
  995. exit3();
  996. return value2;
  997. }
  998. const tracker = state.createTracker(info);
  999. const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3));
  1000. const exit2 = state.enter("codeFenced");
  1001. let value = tracker.move(sequence);
  1002. if (node2.lang) {
  1003. const subexit = state.enter(`codeFencedLang${suffix}`);
  1004. value += tracker.move(
  1005. state.safe(node2.lang, {
  1006. before: value,
  1007. after: " ",
  1008. encode: ["`"],
  1009. ...tracker.current()
  1010. })
  1011. );
  1012. subexit();
  1013. }
  1014. if (node2.lang && node2.meta) {
  1015. const subexit = state.enter(`codeFencedMeta${suffix}`);
  1016. value += tracker.move(" ");
  1017. value += tracker.move(
  1018. state.safe(node2.meta, {
  1019. before: value,
  1020. after: "\n",
  1021. encode: ["`"],
  1022. ...tracker.current()
  1023. })
  1024. );
  1025. subexit();
  1026. }
  1027. value += tracker.move("\n");
  1028. if (raw) {
  1029. value += tracker.move(raw + "\n");
  1030. }
  1031. value += tracker.move(sequence);
  1032. exit2();
  1033. return value;
  1034. }
  1035. function map3(line, _, blank) {
  1036. return (blank ? "" : " ") + line;
  1037. }
  1038. // node_modules/mdast-util-to-markdown/lib/util/check-quote.js
  1039. function checkQuote(state) {
  1040. const marker = state.options.quote || '"';
  1041. if (marker !== '"' && marker !== "'") {
  1042. throw new Error(
  1043. "Cannot serialize title with `" + marker + "` for `options.quote`, expected `\"`, or `'`"
  1044. );
  1045. }
  1046. return marker;
  1047. }
  1048. // node_modules/mdast-util-to-markdown/lib/handle/definition.js
  1049. function definition(node2, _, state, info) {
  1050. const quote = checkQuote(state);
  1051. const suffix = quote === '"' ? "Quote" : "Apostrophe";
  1052. const exit2 = state.enter("definition");
  1053. let subexit = state.enter("label");
  1054. const tracker = state.createTracker(info);
  1055. let value = tracker.move("[");
  1056. value += tracker.move(
  1057. state.safe(state.associationId(node2), {
  1058. before: value,
  1059. after: "]",
  1060. ...tracker.current()
  1061. })
  1062. );
  1063. value += tracker.move("]: ");
  1064. subexit();
  1065. if (
  1066. // If there’s no url, or…
  1067. !node2.url || // If there are control characters or whitespace.
  1068. /[\0- \u007F]/.test(node2.url)
  1069. ) {
  1070. subexit = state.enter("destinationLiteral");
  1071. value += tracker.move("<");
  1072. value += tracker.move(
  1073. state.safe(node2.url, { before: value, after: ">", ...tracker.current() })
  1074. );
  1075. value += tracker.move(">");
  1076. } else {
  1077. subexit = state.enter("destinationRaw");
  1078. value += tracker.move(
  1079. state.safe(node2.url, {
  1080. before: value,
  1081. after: node2.title ? " " : "\n",
  1082. ...tracker.current()
  1083. })
  1084. );
  1085. }
  1086. subexit();
  1087. if (node2.title) {
  1088. subexit = state.enter(`title${suffix}`);
  1089. value += tracker.move(" " + quote);
  1090. value += tracker.move(
  1091. state.safe(node2.title, {
  1092. before: value,
  1093. after: quote,
  1094. ...tracker.current()
  1095. })
  1096. );
  1097. value += tracker.move(quote);
  1098. subexit();
  1099. }
  1100. exit2();
  1101. return value;
  1102. }
  1103. // node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js
  1104. function checkEmphasis(state) {
  1105. const marker = state.options.emphasis || "*";
  1106. if (marker !== "*" && marker !== "_") {
  1107. throw new Error(
  1108. "Cannot serialize emphasis with `" + marker + "` for `options.emphasis`, expected `*`, or `_`"
  1109. );
  1110. }
  1111. return marker;
  1112. }
  1113. // node_modules/mdast-util-to-markdown/lib/handle/emphasis.js
  1114. emphasis.peek = emphasisPeek;
  1115. function emphasis(node2, _, state, info) {
  1116. const marker = checkEmphasis(state);
  1117. const exit2 = state.enter("emphasis");
  1118. const tracker = state.createTracker(info);
  1119. let value = tracker.move(marker);
  1120. value += tracker.move(
  1121. state.containerPhrasing(node2, {
  1122. before: value,
  1123. after: marker,
  1124. ...tracker.current()
  1125. })
  1126. );
  1127. value += tracker.move(marker);
  1128. exit2();
  1129. return value;
  1130. }
  1131. function emphasisPeek(_, _1, state) {
  1132. return state.options.emphasis || "*";
  1133. }
  1134. // node_modules/mdast-util-to-markdown/node_modules/unist-util-visit/lib/index.js
  1135. function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
  1136. let reverse;
  1137. let test;
  1138. let visitor;
  1139. if (typeof testOrVisitor === "function" && typeof visitorOrReverse !== "function") {
  1140. test = void 0;
  1141. visitor = testOrVisitor;
  1142. reverse = visitorOrReverse;
  1143. } else {
  1144. test = testOrVisitor;
  1145. visitor = visitorOrReverse;
  1146. reverse = maybeReverse;
  1147. }
  1148. visitParents(tree, test, overload, reverse);
  1149. function overload(node2, parents) {
  1150. const parent = parents[parents.length - 1];
  1151. const index = parent ? parent.children.indexOf(node2) : void 0;
  1152. return visitor(node2, index, parent);
  1153. }
  1154. }
  1155. // node_modules/mdast-util-to-markdown/node_modules/mdast-util-to-string/lib/index.js
  1156. var emptyOptions = {};
  1157. function toString(value, options) {
  1158. const settings = options || emptyOptions;
  1159. const includeImageAlt = typeof settings.includeImageAlt === "boolean" ? settings.includeImageAlt : true;
  1160. const includeHtml = typeof settings.includeHtml === "boolean" ? settings.includeHtml : true;
  1161. return one(value, includeImageAlt, includeHtml);
  1162. }
  1163. function one(value, includeImageAlt, includeHtml) {
  1164. if (node(value)) {
  1165. if ("value" in value) {
  1166. return value.type === "html" && !includeHtml ? "" : value.value;
  1167. }
  1168. if (includeImageAlt && "alt" in value && value.alt) {
  1169. return value.alt;
  1170. }
  1171. if ("children" in value) {
  1172. return all(value.children, includeImageAlt, includeHtml);
  1173. }
  1174. }
  1175. if (Array.isArray(value)) {
  1176. return all(value, includeImageAlt, includeHtml);
  1177. }
  1178. return "";
  1179. }
  1180. function all(values, includeImageAlt, includeHtml) {
  1181. const result = [];
  1182. let index = -1;
  1183. while (++index < values.length) {
  1184. result[index] = one(values[index], includeImageAlt, includeHtml);
  1185. }
  1186. return result.join("");
  1187. }
  1188. function node(value) {
  1189. return Boolean(value && typeof value === "object");
  1190. }
  1191. // node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js
  1192. function formatHeadingAsSetext(node2, state) {
  1193. let literalWithBreak = false;
  1194. visit(node2, function(node3) {
  1195. if ("value" in node3 && /\r?\n|\r/.test(node3.value) || node3.type === "break") {
  1196. literalWithBreak = true;
  1197. return EXIT;
  1198. }
  1199. });
  1200. return Boolean(
  1201. (!node2.depth || node2.depth < 3) && toString(node2) && (state.options.setext || literalWithBreak)
  1202. );
  1203. }
  1204. // node_modules/mdast-util-to-markdown/lib/handle/heading.js
  1205. function heading(node2, _, state, info) {
  1206. const rank = Math.max(Math.min(6, node2.depth || 1), 1);
  1207. const tracker = state.createTracker(info);
  1208. if (formatHeadingAsSetext(node2, state)) {
  1209. const exit3 = state.enter("headingSetext");
  1210. const subexit2 = state.enter("phrasing");
  1211. const value2 = state.containerPhrasing(node2, {
  1212. ...tracker.current(),
  1213. before: "\n",
  1214. after: "\n"
  1215. });
  1216. subexit2();
  1217. exit3();
  1218. return value2 + "\n" + (rank === 1 ? "=" : "-").repeat(
  1219. // The whole size…
  1220. value2.length - // Minus the position of the character after the last EOL (or
  1221. // 0 if there is none)…
  1222. (Math.max(value2.lastIndexOf("\r"), value2.lastIndexOf("\n")) + 1)
  1223. );
  1224. }
  1225. const sequence = "#".repeat(rank);
  1226. const exit2 = state.enter("headingAtx");
  1227. const subexit = state.enter("phrasing");
  1228. tracker.move(sequence + " ");
  1229. let value = state.containerPhrasing(node2, {
  1230. before: "# ",
  1231. after: "\n",
  1232. ...tracker.current()
  1233. });
  1234. if (/^[\t ]/.test(value)) {
  1235. value = "&#x" + value.charCodeAt(0).toString(16).toUpperCase() + ";" + value.slice(1);
  1236. }
  1237. value = value ? sequence + " " + value : sequence;
  1238. if (state.options.closeAtx) {
  1239. value += " " + sequence;
  1240. }
  1241. subexit();
  1242. exit2();
  1243. return value;
  1244. }
  1245. // node_modules/mdast-util-to-markdown/lib/handle/html.js
  1246. html.peek = htmlPeek;
  1247. function html(node2) {
  1248. return node2.value || "";
  1249. }
  1250. function htmlPeek() {
  1251. return "<";
  1252. }
  1253. // node_modules/mdast-util-to-markdown/lib/handle/image.js
  1254. image.peek = imagePeek;
  1255. function image(node2, _, state, info) {
  1256. const quote = checkQuote(state);
  1257. const suffix = quote === '"' ? "Quote" : "Apostrophe";
  1258. const exit2 = state.enter("image");
  1259. let subexit = state.enter("label");
  1260. const tracker = state.createTracker(info);
  1261. let value = tracker.move("![");
  1262. value += tracker.move(
  1263. state.safe(node2.alt, { before: value, after: "]", ...tracker.current() })
  1264. );
  1265. value += tracker.move("](");
  1266. subexit();
  1267. if (
  1268. // If there’s no url but there is a title…
  1269. !node2.url && node2.title || // If there are control characters or whitespace.
  1270. /[\0- \u007F]/.test(node2.url)
  1271. ) {
  1272. subexit = state.enter("destinationLiteral");
  1273. value += tracker.move("<");
  1274. value += tracker.move(
  1275. state.safe(node2.url, { before: value, after: ">", ...tracker.current() })
  1276. );
  1277. value += tracker.move(">");
  1278. } else {
  1279. subexit = state.enter("destinationRaw");
  1280. value += tracker.move(
  1281. state.safe(node2.url, {
  1282. before: value,
  1283. after: node2.title ? " " : ")",
  1284. ...tracker.current()
  1285. })
  1286. );
  1287. }
  1288. subexit();
  1289. if (node2.title) {
  1290. subexit = state.enter(`title${suffix}`);
  1291. value += tracker.move(" " + quote);
  1292. value += tracker.move(
  1293. state.safe(node2.title, {
  1294. before: value,
  1295. after: quote,
  1296. ...tracker.current()
  1297. })
  1298. );
  1299. value += tracker.move(quote);
  1300. subexit();
  1301. }
  1302. value += tracker.move(")");
  1303. exit2();
  1304. return value;
  1305. }
  1306. function imagePeek() {
  1307. return "!";
  1308. }
  1309. // node_modules/mdast-util-to-markdown/lib/handle/image-reference.js
  1310. imageReference.peek = imageReferencePeek;
  1311. function imageReference(node2, _, state, info) {
  1312. const type = node2.referenceType;
  1313. const exit2 = state.enter("imageReference");
  1314. let subexit = state.enter("label");
  1315. const tracker = state.createTracker(info);
  1316. let value = tracker.move("![");
  1317. const alt = state.safe(node2.alt, {
  1318. before: value,
  1319. after: "]",
  1320. ...tracker.current()
  1321. });
  1322. value += tracker.move(alt + "][");
  1323. subexit();
  1324. const stack = state.stack;
  1325. state.stack = [];
  1326. subexit = state.enter("reference");
  1327. const reference = state.safe(state.associationId(node2), {
  1328. before: value,
  1329. after: "]",
  1330. ...tracker.current()
  1331. });
  1332. subexit();
  1333. state.stack = stack;
  1334. exit2();
  1335. if (type === "full" || !alt || alt !== reference) {
  1336. value += tracker.move(reference + "]");
  1337. } else if (type === "shortcut") {
  1338. value = value.slice(0, -1);
  1339. } else {
  1340. value += tracker.move("]");
  1341. }
  1342. return value;
  1343. }
  1344. function imageReferencePeek() {
  1345. return "!";
  1346. }
  1347. // node_modules/mdast-util-to-markdown/lib/handle/inline-code.js
  1348. inlineCode.peek = inlineCodePeek;
  1349. function inlineCode(node2, _, state) {
  1350. let value = node2.value || "";
  1351. let sequence = "`";
  1352. let index = -1;
  1353. while (new RegExp("(^|[^`])" + sequence + "([^`]|$)").test(value)) {
  1354. sequence += "`";
  1355. }
  1356. if (/[^ \r\n]/.test(value) && (/^[ \r\n]/.test(value) && /[ \r\n]$/.test(value) || /^`|`$/.test(value))) {
  1357. value = " " + value + " ";
  1358. }
  1359. while (++index < state.unsafe.length) {
  1360. const pattern = state.unsafe[index];
  1361. const expression = state.compilePattern(pattern);
  1362. let match;
  1363. if (!pattern.atBreak) continue;
  1364. while (match = expression.exec(value)) {
  1365. let position = match.index;
  1366. if (value.charCodeAt(position) === 10 && value.charCodeAt(position - 1) === 13) {
  1367. position--;
  1368. }
  1369. value = value.slice(0, position) + " " + value.slice(match.index + 1);
  1370. }
  1371. }
  1372. return sequence + value + sequence;
  1373. }
  1374. function inlineCodePeek() {
  1375. return "`";
  1376. }
  1377. // node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js
  1378. function formatLinkAsAutolink(node2, state) {
  1379. const raw = toString(node2);
  1380. return Boolean(
  1381. !state.options.resourceLink && // If there’s a url…
  1382. node2.url && // And there’s a no title…
  1383. !node2.title && // And the content of `node` is a single text node…
  1384. node2.children && node2.children.length === 1 && node2.children[0].type === "text" && // And if the url is the same as the content…
  1385. (raw === node2.url || "mailto:" + raw === node2.url) && // And that starts w/ a protocol…
  1386. /^[a-z][a-z+.-]+:/i.test(node2.url) && // And that doesn’t contain ASCII control codes (character escapes and
  1387. // references don’t work), space, or angle brackets…
  1388. !/[\0- <>\u007F]/.test(node2.url)
  1389. );
  1390. }
  1391. // node_modules/mdast-util-to-markdown/lib/handle/link.js
  1392. link.peek = linkPeek;
  1393. function link(node2, _, state, info) {
  1394. const quote = checkQuote(state);
  1395. const suffix = quote === '"' ? "Quote" : "Apostrophe";
  1396. const tracker = state.createTracker(info);
  1397. let exit2;
  1398. let subexit;
  1399. if (formatLinkAsAutolink(node2, state)) {
  1400. const stack = state.stack;
  1401. state.stack = [];
  1402. exit2 = state.enter("autolink");
  1403. let value2 = tracker.move("<");
  1404. value2 += tracker.move(
  1405. state.containerPhrasing(node2, {
  1406. before: value2,
  1407. after: ">",
  1408. ...tracker.current()
  1409. })
  1410. );
  1411. value2 += tracker.move(">");
  1412. exit2();
  1413. state.stack = stack;
  1414. return value2;
  1415. }
  1416. exit2 = state.enter("link");
  1417. subexit = state.enter("label");
  1418. let value = tracker.move("[");
  1419. value += tracker.move(
  1420. state.containerPhrasing(node2, {
  1421. before: value,
  1422. after: "](",
  1423. ...tracker.current()
  1424. })
  1425. );
  1426. value += tracker.move("](");
  1427. subexit();
  1428. if (
  1429. // If there’s no url but there is a title…
  1430. !node2.url && node2.title || // If there are control characters or whitespace.
  1431. /[\0- \u007F]/.test(node2.url)
  1432. ) {
  1433. subexit = state.enter("destinationLiteral");
  1434. value += tracker.move("<");
  1435. value += tracker.move(
  1436. state.safe(node2.url, { before: value, after: ">", ...tracker.current() })
  1437. );
  1438. value += tracker.move(">");
  1439. } else {
  1440. subexit = state.enter("destinationRaw");
  1441. value += tracker.move(
  1442. state.safe(node2.url, {
  1443. before: value,
  1444. after: node2.title ? " " : ")",
  1445. ...tracker.current()
  1446. })
  1447. );
  1448. }
  1449. subexit();
  1450. if (node2.title) {
  1451. subexit = state.enter(`title${suffix}`);
  1452. value += tracker.move(" " + quote);
  1453. value += tracker.move(
  1454. state.safe(node2.title, {
  1455. before: value,
  1456. after: quote,
  1457. ...tracker.current()
  1458. })
  1459. );
  1460. value += tracker.move(quote);
  1461. subexit();
  1462. }
  1463. value += tracker.move(")");
  1464. exit2();
  1465. return value;
  1466. }
  1467. function linkPeek(node2, _, state) {
  1468. return formatLinkAsAutolink(node2, state) ? "<" : "[";
  1469. }
  1470. // node_modules/mdast-util-to-markdown/lib/handle/link-reference.js
  1471. linkReference.peek = linkReferencePeek;
  1472. function linkReference(node2, _, state, info) {
  1473. const type = node2.referenceType;
  1474. const exit2 = state.enter("linkReference");
  1475. let subexit = state.enter("label");
  1476. const tracker = state.createTracker(info);
  1477. let value = tracker.move("[");
  1478. const text3 = state.containerPhrasing(node2, {
  1479. before: value,
  1480. after: "]",
  1481. ...tracker.current()
  1482. });
  1483. value += tracker.move(text3 + "][");
  1484. subexit();
  1485. const stack = state.stack;
  1486. state.stack = [];
  1487. subexit = state.enter("reference");
  1488. const reference = state.safe(state.associationId(node2), {
  1489. before: value,
  1490. after: "]",
  1491. ...tracker.current()
  1492. });
  1493. subexit();
  1494. state.stack = stack;
  1495. exit2();
  1496. if (type === "full" || !text3 || text3 !== reference) {
  1497. value += tracker.move(reference + "]");
  1498. } else if (type === "shortcut") {
  1499. value = value.slice(0, -1);
  1500. } else {
  1501. value += tracker.move("]");
  1502. }
  1503. return value;
  1504. }
  1505. function linkReferencePeek() {
  1506. return "[";
  1507. }
  1508. // node_modules/mdast-util-to-markdown/lib/util/check-bullet.js
  1509. function checkBullet(state) {
  1510. const marker = state.options.bullet || "*";
  1511. if (marker !== "*" && marker !== "+" && marker !== "-") {
  1512. throw new Error(
  1513. "Cannot serialize items with `" + marker + "` for `options.bullet`, expected `*`, `+`, or `-`"
  1514. );
  1515. }
  1516. return marker;
  1517. }
  1518. // node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js
  1519. function checkBulletOther(state) {
  1520. const bullet = checkBullet(state);
  1521. const bulletOther = state.options.bulletOther;
  1522. if (!bulletOther) {
  1523. return bullet === "*" ? "-" : "*";
  1524. }
  1525. if (bulletOther !== "*" && bulletOther !== "+" && bulletOther !== "-") {
  1526. throw new Error(
  1527. "Cannot serialize items with `" + bulletOther + "` for `options.bulletOther`, expected `*`, `+`, or `-`"
  1528. );
  1529. }
  1530. if (bulletOther === bullet) {
  1531. throw new Error(
  1532. "Expected `bullet` (`" + bullet + "`) and `bulletOther` (`" + bulletOther + "`) to be different"
  1533. );
  1534. }
  1535. return bulletOther;
  1536. }
  1537. // node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js
  1538. function checkBulletOrdered(state) {
  1539. const marker = state.options.bulletOrdered || ".";
  1540. if (marker !== "." && marker !== ")") {
  1541. throw new Error(
  1542. "Cannot serialize items with `" + marker + "` for `options.bulletOrdered`, expected `.` or `)`"
  1543. );
  1544. }
  1545. return marker;
  1546. }
  1547. // node_modules/mdast-util-to-markdown/lib/util/check-rule.js
  1548. function checkRule(state) {
  1549. const marker = state.options.rule || "*";
  1550. if (marker !== "*" && marker !== "-" && marker !== "_") {
  1551. throw new Error(
  1552. "Cannot serialize rules with `" + marker + "` for `options.rule`, expected `*`, `-`, or `_`"
  1553. );
  1554. }
  1555. return marker;
  1556. }
  1557. // node_modules/mdast-util-to-markdown/lib/handle/list.js
  1558. function list(node2, parent, state, info) {
  1559. const exit2 = state.enter("list");
  1560. const bulletCurrent = state.bulletCurrent;
  1561. let bullet = node2.ordered ? checkBulletOrdered(state) : checkBullet(state);
  1562. const bulletOther = node2.ordered ? bullet === "." ? ")" : "." : checkBulletOther(state);
  1563. let useDifferentMarker = parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false;
  1564. if (!node2.ordered) {
  1565. const firstListItem = node2.children ? node2.children[0] : void 0;
  1566. if (
  1567. // Bullet could be used as a thematic break marker:
  1568. (bullet === "*" || bullet === "-") && // Empty first list item:
  1569. firstListItem && (!firstListItem.children || !firstListItem.children[0]) && // Directly in two other list items:
  1570. state.stack[state.stack.length - 1] === "list" && state.stack[state.stack.length - 2] === "listItem" && state.stack[state.stack.length - 3] === "list" && state.stack[state.stack.length - 4] === "listItem" && // That are each the first child.
  1571. state.indexStack[state.indexStack.length - 1] === 0 && state.indexStack[state.indexStack.length - 2] === 0 && state.indexStack[state.indexStack.length - 3] === 0
  1572. ) {
  1573. useDifferentMarker = true;
  1574. }
  1575. if (checkRule(state) === bullet && firstListItem) {
  1576. let index = -1;
  1577. while (++index < node2.children.length) {
  1578. const item = node2.children[index];
  1579. if (item && item.type === "listItem" && item.children && item.children[0] && item.children[0].type === "thematicBreak") {
  1580. useDifferentMarker = true;
  1581. break;
  1582. }
  1583. }
  1584. }
  1585. }
  1586. if (useDifferentMarker) {
  1587. bullet = bulletOther;
  1588. }
  1589. state.bulletCurrent = bullet;
  1590. const value = state.containerFlow(node2, info);
  1591. state.bulletLastUsed = bullet;
  1592. state.bulletCurrent = bulletCurrent;
  1593. exit2();
  1594. return value;
  1595. }
  1596. // node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js
  1597. function checkListItemIndent(state) {
  1598. const style = state.options.listItemIndent || "one";
  1599. if (style !== "tab" && style !== "one" && style !== "mixed") {
  1600. throw new Error(
  1601. "Cannot serialize items with `" + style + "` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`"
  1602. );
  1603. }
  1604. return style;
  1605. }
  1606. // node_modules/mdast-util-to-markdown/lib/handle/list-item.js
  1607. function listItem(node2, parent, state, info) {
  1608. const listItemIndent = checkListItemIndent(state);
  1609. let bullet = state.bulletCurrent || checkBullet(state);
  1610. if (parent && parent.type === "list" && parent.ordered) {
  1611. bullet = (typeof parent.start === "number" && parent.start > -1 ? parent.start : 1) + (state.options.incrementListMarker === false ? 0 : parent.children.indexOf(node2)) + bullet;
  1612. }
  1613. let size = bullet.length + 1;
  1614. if (listItemIndent === "tab" || listItemIndent === "mixed" && (parent && parent.type === "list" && parent.spread || node2.spread)) {
  1615. size = Math.ceil(size / 4) * 4;
  1616. }
  1617. const tracker = state.createTracker(info);
  1618. tracker.move(bullet + " ".repeat(size - bullet.length));
  1619. tracker.shift(size);
  1620. const exit2 = state.enter("listItem");
  1621. const value = state.indentLines(
  1622. state.containerFlow(node2, tracker.current()),
  1623. map4
  1624. );
  1625. exit2();
  1626. return value;
  1627. function map4(line, index, blank) {
  1628. if (index) {
  1629. return (blank ? "" : " ".repeat(size)) + line;
  1630. }
  1631. return (blank ? bullet : bullet + " ".repeat(size - bullet.length)) + line;
  1632. }
  1633. }
  1634. // node_modules/mdast-util-to-markdown/lib/handle/paragraph.js
  1635. function paragraph(node2, _, state, info) {
  1636. const exit2 = state.enter("paragraph");
  1637. const subexit = state.enter("phrasing");
  1638. const value = state.containerPhrasing(node2, info);
  1639. subexit();
  1640. exit2();
  1641. return value;
  1642. }
  1643. // node_modules/mdast-util-phrasing/node_modules/unist-util-is/lib/index.js
  1644. var convert3 = (
  1645. // Note: overloads in JSDoc can’t yet use different `@template`s.
  1646. /**
  1647. * @type {(
  1648. * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
  1649. * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
  1650. * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
  1651. * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
  1652. * ((test?: Test) => Check)
  1653. * )}
  1654. */
  1655. /**
  1656. * @param {Test} [test]
  1657. * @returns {Check}
  1658. */
  1659. function(test) {
  1660. if (test === null || test === void 0) {
  1661. return ok4;
  1662. }
  1663. if (typeof test === "function") {
  1664. return castFactory3(test);
  1665. }
  1666. if (typeof test === "object") {
  1667. return Array.isArray(test) ? anyFactory3(test) : propsFactory3(test);
  1668. }
  1669. if (typeof test === "string") {
  1670. return typeFactory3(test);
  1671. }
  1672. throw new Error("Expected function, string, or object as test");
  1673. }
  1674. );
  1675. function anyFactory3(tests) {
  1676. const checks = [];
  1677. let index = -1;
  1678. while (++index < tests.length) {
  1679. checks[index] = convert3(tests[index]);
  1680. }
  1681. return castFactory3(any);
  1682. function any(...parameters) {
  1683. let index2 = -1;
  1684. while (++index2 < checks.length) {
  1685. if (checks[index2].apply(this, parameters)) return true;
  1686. }
  1687. return false;
  1688. }
  1689. }
  1690. function propsFactory3(check) {
  1691. const checkAsRecord = (
  1692. /** @type {Record<string, unknown>} */
  1693. check
  1694. );
  1695. return castFactory3(all2);
  1696. function all2(node2) {
  1697. const nodeAsRecord = (
  1698. /** @type {Record<string, unknown>} */
  1699. /** @type {unknown} */
  1700. node2
  1701. );
  1702. let key;
  1703. for (key in check) {
  1704. if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
  1705. }
  1706. return true;
  1707. }
  1708. }
  1709. function typeFactory3(check) {
  1710. return castFactory3(type);
  1711. function type(node2) {
  1712. return node2 && node2.type === check;
  1713. }
  1714. }
  1715. function castFactory3(testFunction) {
  1716. return check;
  1717. function check(value, index, parent) {
  1718. return Boolean(
  1719. looksLikeANode3(value) && testFunction.call(
  1720. this,
  1721. value,
  1722. typeof index === "number" ? index : void 0,
  1723. parent || void 0
  1724. )
  1725. );
  1726. }
  1727. }
  1728. function ok4() {
  1729. return true;
  1730. }
  1731. function looksLikeANode3(value) {
  1732. return value !== null && typeof value === "object" && "type" in value;
  1733. }
  1734. // node_modules/mdast-util-phrasing/lib/index.js
  1735. var phrasing = (
  1736. /** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */
  1737. convert3([
  1738. "break",
  1739. "delete",
  1740. "emphasis",
  1741. // To do: next major: removed since footnotes were added to GFM.
  1742. "footnote",
  1743. "footnoteReference",
  1744. "image",
  1745. "imageReference",
  1746. "inlineCode",
  1747. // Enabled by `mdast-util-math`:
  1748. "inlineMath",
  1749. "link",
  1750. "linkReference",
  1751. // Enabled by `mdast-util-mdx`:
  1752. "mdxJsxTextElement",
  1753. // Enabled by `mdast-util-mdx`:
  1754. "mdxTextExpression",
  1755. "strong",
  1756. "text",
  1757. // Enabled by `mdast-util-directive`:
  1758. "textDirective"
  1759. ])
  1760. );
  1761. // node_modules/mdast-util-to-markdown/lib/handle/root.js
  1762. function root(node2, _, state, info) {
  1763. const hasPhrasing = node2.children.some(function(d) {
  1764. return phrasing(d);
  1765. });
  1766. const fn = hasPhrasing ? state.containerPhrasing : state.containerFlow;
  1767. return fn.call(state, node2, info);
  1768. }
  1769. // node_modules/mdast-util-to-markdown/lib/util/check-strong.js
  1770. function checkStrong(state) {
  1771. const marker = state.options.strong || "*";
  1772. if (marker !== "*" && marker !== "_") {
  1773. throw new Error(
  1774. "Cannot serialize strong with `" + marker + "` for `options.strong`, expected `*`, or `_`"
  1775. );
  1776. }
  1777. return marker;
  1778. }
  1779. // node_modules/mdast-util-to-markdown/lib/handle/strong.js
  1780. strong.peek = strongPeek;
  1781. function strong(node2, _, state, info) {
  1782. const marker = checkStrong(state);
  1783. const exit2 = state.enter("strong");
  1784. const tracker = state.createTracker(info);
  1785. let value = tracker.move(marker + marker);
  1786. value += tracker.move(
  1787. state.containerPhrasing(node2, {
  1788. before: value,
  1789. after: marker,
  1790. ...tracker.current()
  1791. })
  1792. );
  1793. value += tracker.move(marker + marker);
  1794. exit2();
  1795. return value;
  1796. }
  1797. function strongPeek(_, _1, state) {
  1798. return state.options.strong || "*";
  1799. }
  1800. // node_modules/mdast-util-to-markdown/lib/handle/text.js
  1801. function text(node2, _, state, info) {
  1802. return state.safe(node2.value, info);
  1803. }
  1804. // node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js
  1805. function checkRuleRepetition(state) {
  1806. const repetition = state.options.ruleRepetition || 3;
  1807. if (repetition < 3) {
  1808. throw new Error(
  1809. "Cannot serialize rules with repetition `" + repetition + "` for `options.ruleRepetition`, expected `3` or more"
  1810. );
  1811. }
  1812. return repetition;
  1813. }
  1814. // node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js
  1815. function thematicBreak(_, _1, state) {
  1816. const value = (checkRule(state) + (state.options.ruleSpaces ? " " : "")).repeat(checkRuleRepetition(state));
  1817. return state.options.ruleSpaces ? value.slice(0, -1) : value;
  1818. }
  1819. // node_modules/mdast-util-to-markdown/lib/handle/index.js
  1820. var handle = {
  1821. blockquote,
  1822. break: hardBreak,
  1823. code,
  1824. definition,
  1825. emphasis,
  1826. hardBreak,
  1827. heading,
  1828. html,
  1829. image,
  1830. imageReference,
  1831. inlineCode,
  1832. link,
  1833. linkReference,
  1834. list,
  1835. listItem,
  1836. paragraph,
  1837. root,
  1838. strong,
  1839. text,
  1840. thematicBreak
  1841. };
  1842. // node_modules/mdast-util-gfm-table/lib/index.js
  1843. function gfmTableFromMarkdown() {
  1844. return {
  1845. enter: {
  1846. table: enterTable,
  1847. tableData: enterCell,
  1848. tableHeader: enterCell,
  1849. tableRow: enterRow
  1850. },
  1851. exit: {
  1852. codeText: exitCodeText,
  1853. table: exitTable,
  1854. tableData: exit,
  1855. tableHeader: exit,
  1856. tableRow: exit
  1857. }
  1858. };
  1859. }
  1860. function enterTable(token) {
  1861. const align = token._align;
  1862. ok(align, "expected `_align` on table");
  1863. this.enter(
  1864. {
  1865. type: "table",
  1866. align: align.map(function(d) {
  1867. return d === "none" ? null : d;
  1868. }),
  1869. children: []
  1870. },
  1871. token
  1872. );
  1873. this.data.inTable = true;
  1874. }
  1875. function exitTable(token) {
  1876. this.exit(token);
  1877. this.data.inTable = void 0;
  1878. }
  1879. function enterRow(token) {
  1880. this.enter({ type: "tableRow", children: [] }, token);
  1881. }
  1882. function exit(token) {
  1883. this.exit(token);
  1884. }
  1885. function enterCell(token) {
  1886. this.enter({ type: "tableCell", children: [] }, token);
  1887. }
  1888. function exitCodeText(token) {
  1889. let value = this.resume();
  1890. if (this.data.inTable) {
  1891. value = value.replace(/\\([\\|])/g, replace);
  1892. }
  1893. const node2 = this.stack[this.stack.length - 1];
  1894. ok(node2.type === "inlineCode");
  1895. node2.value = value;
  1896. this.exit(token);
  1897. }
  1898. function replace($0, $1) {
  1899. return $1 === "|" ? $1 : $0;
  1900. }
  1901. function gfmTableToMarkdown(options) {
  1902. const settings = options || {};
  1903. const padding = settings.tableCellPadding;
  1904. const alignDelimiters = settings.tablePipeAlign;
  1905. const stringLength = settings.stringLength;
  1906. const around = padding ? " " : "|";
  1907. return {
  1908. unsafe: [
  1909. { character: "\r", inConstruct: "tableCell" },
  1910. { character: "\n", inConstruct: "tableCell" },
  1911. // A pipe, when followed by a tab or space (padding), or a dash or colon
  1912. // (unpadded delimiter row), could result in a table.
  1913. { atBreak: true, character: "|", after: "[ :-]" },
  1914. // A pipe in a cell must be encoded.
  1915. { character: "|", inConstruct: "tableCell" },
  1916. // A colon must be followed by a dash, in which case it could start a
  1917. // delimiter row.
  1918. { atBreak: true, character: ":", after: "-" },
  1919. // A delimiter row can also start with a dash, when followed by more
  1920. // dashes, a colon, or a pipe.
  1921. // This is a stricter version than the built in check for lists, thematic
  1922. // breaks, and setex heading underlines though:
  1923. // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/51a2038/lib/unsafe.js#L57>
  1924. { atBreak: true, character: "-", after: "[:|-]" }
  1925. ],
  1926. handlers: {
  1927. inlineCode: inlineCodeWithTable,
  1928. table: handleTable,
  1929. tableCell: handleTableCell,
  1930. tableRow: handleTableRow
  1931. }
  1932. };
  1933. function handleTable(node2, _, state, info) {
  1934. return serializeData(handleTableAsData(node2, state, info), node2.align);
  1935. }
  1936. function handleTableRow(node2, _, state, info) {
  1937. const row = handleTableRowAsData(node2, state, info);
  1938. const value = serializeData([row]);
  1939. return value.slice(0, value.indexOf("\n"));
  1940. }
  1941. function handleTableCell(node2, _, state, info) {
  1942. const exit2 = state.enter("tableCell");
  1943. const subexit = state.enter("phrasing");
  1944. const value = state.containerPhrasing(node2, {
  1945. ...info,
  1946. before: around,
  1947. after: around
  1948. });
  1949. subexit();
  1950. exit2();
  1951. return value;
  1952. }
  1953. function serializeData(matrix, align) {
  1954. return markdownTable(matrix, {
  1955. align,
  1956. // @ts-expect-error: `markdown-table` types should support `null`.
  1957. alignDelimiters,
  1958. // @ts-expect-error: `markdown-table` types should support `null`.
  1959. padding,
  1960. // @ts-expect-error: `markdown-table` types should support `null`.
  1961. stringLength
  1962. });
  1963. }
  1964. function handleTableAsData(node2, state, info) {
  1965. const children = node2.children;
  1966. let index = -1;
  1967. const result = [];
  1968. const subexit = state.enter("table");
  1969. while (++index < children.length) {
  1970. result[index] = handleTableRowAsData(children[index], state, info);
  1971. }
  1972. subexit();
  1973. return result;
  1974. }
  1975. function handleTableRowAsData(node2, state, info) {
  1976. const children = node2.children;
  1977. let index = -1;
  1978. const result = [];
  1979. const subexit = state.enter("tableRow");
  1980. while (++index < children.length) {
  1981. result[index] = handleTableCell(children[index], node2, state, info);
  1982. }
  1983. subexit();
  1984. return result;
  1985. }
  1986. function inlineCodeWithTable(node2, parent, state) {
  1987. let value = handle.inlineCode(node2, parent, state);
  1988. if (state.stack.includes("tableCell")) {
  1989. value = value.replace(/\|/g, "\\$&");
  1990. }
  1991. return value;
  1992. }
  1993. }
  1994. // node_modules/mdast-util-gfm-task-list-item/lib/index.js
  1995. function gfmTaskListItemFromMarkdown() {
  1996. return {
  1997. exit: {
  1998. taskListCheckValueChecked: exitCheck,
  1999. taskListCheckValueUnchecked: exitCheck,
  2000. paragraph: exitParagraphWithTaskListItem
  2001. }
  2002. };
  2003. }
  2004. function gfmTaskListItemToMarkdown() {
  2005. return {
  2006. unsafe: [{ atBreak: true, character: "-", after: "[:|-]" }],
  2007. handlers: { listItem: listItemWithTaskListItem }
  2008. };
  2009. }
  2010. function exitCheck(token) {
  2011. const node2 = this.stack[this.stack.length - 2];
  2012. ok(node2.type === "listItem");
  2013. node2.checked = token.type === "taskListCheckValueChecked";
  2014. }
  2015. function exitParagraphWithTaskListItem(token) {
  2016. const parent = this.stack[this.stack.length - 2];
  2017. if (parent && parent.type === "listItem" && typeof parent.checked === "boolean") {
  2018. const node2 = this.stack[this.stack.length - 1];
  2019. ok(node2.type === "paragraph");
  2020. const head = node2.children[0];
  2021. if (head && head.type === "text") {
  2022. const siblings = parent.children;
  2023. let index = -1;
  2024. let firstParaghraph;
  2025. while (++index < siblings.length) {
  2026. const sibling = siblings[index];
  2027. if (sibling.type === "paragraph") {
  2028. firstParaghraph = sibling;
  2029. break;
  2030. }
  2031. }
  2032. if (firstParaghraph === node2) {
  2033. head.value = head.value.slice(1);
  2034. if (head.value.length === 0) {
  2035. node2.children.shift();
  2036. } else if (node2.position && head.position && typeof head.position.start.offset === "number") {
  2037. head.position.start.column++;
  2038. head.position.start.offset++;
  2039. node2.position.start = Object.assign({}, head.position.start);
  2040. }
  2041. }
  2042. }
  2043. }
  2044. this.exit(token);
  2045. }
  2046. function listItemWithTaskListItem(node2, parent, state, info) {
  2047. const head = node2.children[0];
  2048. const checkable = typeof node2.checked === "boolean" && head && head.type === "paragraph";
  2049. const checkbox = "[" + (node2.checked ? "x" : " ") + "] ";
  2050. const tracker = state.createTracker(info);
  2051. if (checkable) {
  2052. tracker.move(checkbox);
  2053. }
  2054. let value = handle.listItem(node2, parent, state, {
  2055. ...info,
  2056. ...tracker.current()
  2057. });
  2058. if (checkable) {
  2059. value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check);
  2060. }
  2061. return value;
  2062. function check($0) {
  2063. return $0 + checkbox;
  2064. }
  2065. }
  2066. // node_modules/mdast-util-gfm/lib/index.js
  2067. function gfmFromMarkdown() {
  2068. return [
  2069. gfmAutolinkLiteralFromMarkdown(),
  2070. gfmFootnoteFromMarkdown(),
  2071. gfmStrikethroughFromMarkdown(),
  2072. gfmTableFromMarkdown(),
  2073. gfmTaskListItemFromMarkdown()
  2074. ];
  2075. }
  2076. function gfmToMarkdown(options) {
  2077. return {
  2078. extensions: [
  2079. gfmAutolinkLiteralToMarkdown(),
  2080. gfmFootnoteToMarkdown(),
  2081. gfmStrikethroughToMarkdown(),
  2082. gfmTableToMarkdown(options),
  2083. gfmTaskListItemToMarkdown()
  2084. ]
  2085. };
  2086. }
  2087. // node_modules/micromark-util-chunked/index.js
  2088. function splice(list2, start, remove, items) {
  2089. const end = list2.length;
  2090. let chunkStart = 0;
  2091. let parameters;
  2092. if (start < 0) {
  2093. start = -start > end ? 0 : end + start;
  2094. } else {
  2095. start = start > end ? end : start;
  2096. }
  2097. remove = remove > 0 ? remove : 0;
  2098. if (items.length < 1e4) {
  2099. parameters = Array.from(items);
  2100. parameters.unshift(start, remove);
  2101. list2.splice(...parameters);
  2102. } else {
  2103. if (remove) list2.splice(start, remove);
  2104. while (chunkStart < items.length) {
  2105. parameters = items.slice(chunkStart, chunkStart + 1e4);
  2106. parameters.unshift(start, 0);
  2107. list2.splice(...parameters);
  2108. chunkStart += 1e4;
  2109. start += 1e4;
  2110. }
  2111. }
  2112. }
  2113. // node_modules/micromark-util-combine-extensions/index.js
  2114. var hasOwnProperty = {}.hasOwnProperty;
  2115. function combineExtensions(extensions) {
  2116. const all2 = {};
  2117. let index = -1;
  2118. while (++index < extensions.length) {
  2119. syntaxExtension(all2, extensions[index]);
  2120. }
  2121. return all2;
  2122. }
  2123. function syntaxExtension(all2, extension) {
  2124. let hook;
  2125. for (hook in extension) {
  2126. const maybe = hasOwnProperty.call(all2, hook) ? all2[hook] : void 0;
  2127. const left = maybe || (all2[hook] = {});
  2128. const right = extension[hook];
  2129. let code3;
  2130. if (right) {
  2131. for (code3 in right) {
  2132. if (!hasOwnProperty.call(left, code3)) left[code3] = [];
  2133. const value = right[code3];
  2134. constructs(
  2135. // @ts-expect-error Looks like a list.
  2136. left[code3],
  2137. Array.isArray(value) ? value : value ? [value] : []
  2138. );
  2139. }
  2140. }
  2141. }
  2142. }
  2143. function constructs(existing, list2) {
  2144. let index = -1;
  2145. const before = [];
  2146. while (++index < list2.length) {
  2147. ;
  2148. (list2[index].add === "after" ? existing : before).push(list2[index]);
  2149. }
  2150. splice(existing, 0, 0, before);
  2151. }
  2152. // node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js
  2153. var wwwPrefix = {
  2154. tokenize: tokenizeWwwPrefix,
  2155. partial: true
  2156. };
  2157. var domain = {
  2158. tokenize: tokenizeDomain,
  2159. partial: true
  2160. };
  2161. var path = {
  2162. tokenize: tokenizePath,
  2163. partial: true
  2164. };
  2165. var trail = {
  2166. tokenize: tokenizeTrail,
  2167. partial: true
  2168. };
  2169. var emailDomainDotTrail = {
  2170. tokenize: tokenizeEmailDomainDotTrail,
  2171. partial: true
  2172. };
  2173. var wwwAutolink = {
  2174. name: "wwwAutolink",
  2175. tokenize: tokenizeWwwAutolink,
  2176. previous: previousWww
  2177. };
  2178. var protocolAutolink = {
  2179. name: "protocolAutolink",
  2180. tokenize: tokenizeProtocolAutolink,
  2181. previous: previousProtocol
  2182. };
  2183. var emailAutolink = {
  2184. name: "emailAutolink",
  2185. tokenize: tokenizeEmailAutolink,
  2186. previous: previousEmail
  2187. };
  2188. var text2 = {};
  2189. function gfmAutolinkLiteral() {
  2190. return {
  2191. text: text2
  2192. };
  2193. }
  2194. var code2 = 48;
  2195. while (code2 < 123) {
  2196. text2[code2] = emailAutolink;
  2197. code2++;
  2198. if (code2 === 58) code2 = 65;
  2199. else if (code2 === 91) code2 = 97;
  2200. }
  2201. text2[43] = emailAutolink;
  2202. text2[45] = emailAutolink;
  2203. text2[46] = emailAutolink;
  2204. text2[95] = emailAutolink;
  2205. text2[72] = [emailAutolink, protocolAutolink];
  2206. text2[104] = [emailAutolink, protocolAutolink];
  2207. text2[87] = [emailAutolink, wwwAutolink];
  2208. text2[119] = [emailAutolink, wwwAutolink];
  2209. function tokenizeEmailAutolink(effects, ok5, nok) {
  2210. const self = this;
  2211. let dot;
  2212. let data;
  2213. return start;
  2214. function start(code3) {
  2215. if (!gfmAtext(code3) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) {
  2216. return nok(code3);
  2217. }
  2218. effects.enter("literalAutolink");
  2219. effects.enter("literalAutolinkEmail");
  2220. return atext(code3);
  2221. }
  2222. function atext(code3) {
  2223. if (gfmAtext(code3)) {
  2224. effects.consume(code3);
  2225. return atext;
  2226. }
  2227. if (code3 === 64) {
  2228. effects.consume(code3);
  2229. return emailDomain;
  2230. }
  2231. return nok(code3);
  2232. }
  2233. function emailDomain(code3) {
  2234. if (code3 === 46) {
  2235. return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code3);
  2236. }
  2237. if (code3 === 45 || code3 === 95 || asciiAlphanumeric(code3)) {
  2238. data = true;
  2239. effects.consume(code3);
  2240. return emailDomain;
  2241. }
  2242. return emailDomainAfter(code3);
  2243. }
  2244. function emailDomainDot(code3) {
  2245. effects.consume(code3);
  2246. dot = true;
  2247. return emailDomain;
  2248. }
  2249. function emailDomainAfter(code3) {
  2250. if (data && dot && asciiAlpha(self.previous)) {
  2251. effects.exit("literalAutolinkEmail");
  2252. effects.exit("literalAutolink");
  2253. return ok5(code3);
  2254. }
  2255. return nok(code3);
  2256. }
  2257. }
  2258. function tokenizeWwwAutolink(effects, ok5, nok) {
  2259. const self = this;
  2260. return wwwStart;
  2261. function wwwStart(code3) {
  2262. if (code3 !== 87 && code3 !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) {
  2263. return nok(code3);
  2264. }
  2265. effects.enter("literalAutolink");
  2266. effects.enter("literalAutolinkWww");
  2267. return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path, wwwAfter), nok), nok)(code3);
  2268. }
  2269. function wwwAfter(code3) {
  2270. effects.exit("literalAutolinkWww");
  2271. effects.exit("literalAutolink");
  2272. return ok5(code3);
  2273. }
  2274. }
  2275. function tokenizeProtocolAutolink(effects, ok5, nok) {
  2276. const self = this;
  2277. let buffer = "";
  2278. let seen = false;
  2279. return protocolStart;
  2280. function protocolStart(code3) {
  2281. if ((code3 === 72 || code3 === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) {
  2282. effects.enter("literalAutolink");
  2283. effects.enter("literalAutolinkHttp");
  2284. buffer += String.fromCodePoint(code3);
  2285. effects.consume(code3);
  2286. return protocolPrefixInside;
  2287. }
  2288. return nok(code3);
  2289. }
  2290. function protocolPrefixInside(code3) {
  2291. if (asciiAlpha(code3) && buffer.length < 5) {
  2292. buffer += String.fromCodePoint(code3);
  2293. effects.consume(code3);
  2294. return protocolPrefixInside;
  2295. }
  2296. if (code3 === 58) {
  2297. const protocol = buffer.toLowerCase();
  2298. if (protocol === "http" || protocol === "https") {
  2299. effects.consume(code3);
  2300. return protocolSlashesInside;
  2301. }
  2302. }
  2303. return nok(code3);
  2304. }
  2305. function protocolSlashesInside(code3) {
  2306. if (code3 === 47) {
  2307. effects.consume(code3);
  2308. if (seen) {
  2309. return afterProtocol;
  2310. }
  2311. seen = true;
  2312. return protocolSlashesInside;
  2313. }
  2314. return nok(code3);
  2315. }
  2316. function afterProtocol(code3) {
  2317. return code3 === null || asciiControl(code3) || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3) || unicodePunctuation(code3) ? nok(code3) : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code3);
  2318. }
  2319. function protocolAfter(code3) {
  2320. effects.exit("literalAutolinkHttp");
  2321. effects.exit("literalAutolink");
  2322. return ok5(code3);
  2323. }
  2324. }
  2325. function tokenizeWwwPrefix(effects, ok5, nok) {
  2326. let size = 0;
  2327. return wwwPrefixInside;
  2328. function wwwPrefixInside(code3) {
  2329. if ((code3 === 87 || code3 === 119) && size < 3) {
  2330. size++;
  2331. effects.consume(code3);
  2332. return wwwPrefixInside;
  2333. }
  2334. if (code3 === 46 && size === 3) {
  2335. effects.consume(code3);
  2336. return wwwPrefixAfter;
  2337. }
  2338. return nok(code3);
  2339. }
  2340. function wwwPrefixAfter(code3) {
  2341. return code3 === null ? nok(code3) : ok5(code3);
  2342. }
  2343. }
  2344. function tokenizeDomain(effects, ok5, nok) {
  2345. let underscoreInLastSegment;
  2346. let underscoreInLastLastSegment;
  2347. let seen;
  2348. return domainInside;
  2349. function domainInside(code3) {
  2350. if (code3 === 46 || code3 === 95) {
  2351. return effects.check(trail, domainAfter, domainAtPunctuation)(code3);
  2352. }
  2353. if (code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3) || code3 !== 45 && unicodePunctuation(code3)) {
  2354. return domainAfter(code3);
  2355. }
  2356. seen = true;
  2357. effects.consume(code3);
  2358. return domainInside;
  2359. }
  2360. function domainAtPunctuation(code3) {
  2361. if (code3 === 95) {
  2362. underscoreInLastSegment = true;
  2363. } else {
  2364. underscoreInLastLastSegment = underscoreInLastSegment;
  2365. underscoreInLastSegment = void 0;
  2366. }
  2367. effects.consume(code3);
  2368. return domainInside;
  2369. }
  2370. function domainAfter(code3) {
  2371. if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {
  2372. return nok(code3);
  2373. }
  2374. return ok5(code3);
  2375. }
  2376. }
  2377. function tokenizePath(effects, ok5) {
  2378. let sizeOpen = 0;
  2379. let sizeClose = 0;
  2380. return pathInside;
  2381. function pathInside(code3) {
  2382. if (code3 === 40) {
  2383. sizeOpen++;
  2384. effects.consume(code3);
  2385. return pathInside;
  2386. }
  2387. if (code3 === 41 && sizeClose < sizeOpen) {
  2388. return pathAtPunctuation(code3);
  2389. }
  2390. if (code3 === 33 || code3 === 34 || code3 === 38 || code3 === 39 || code3 === 41 || code3 === 42 || code3 === 44 || code3 === 46 || code3 === 58 || code3 === 59 || code3 === 60 || code3 === 63 || code3 === 93 || code3 === 95 || code3 === 126) {
  2391. return effects.check(trail, ok5, pathAtPunctuation)(code3);
  2392. }
  2393. if (code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)) {
  2394. return ok5(code3);
  2395. }
  2396. effects.consume(code3);
  2397. return pathInside;
  2398. }
  2399. function pathAtPunctuation(code3) {
  2400. if (code3 === 41) {
  2401. sizeClose++;
  2402. }
  2403. effects.consume(code3);
  2404. return pathInside;
  2405. }
  2406. }
  2407. function tokenizeTrail(effects, ok5, nok) {
  2408. return trail2;
  2409. function trail2(code3) {
  2410. if (code3 === 33 || code3 === 34 || code3 === 39 || code3 === 41 || code3 === 42 || code3 === 44 || code3 === 46 || code3 === 58 || code3 === 59 || code3 === 63 || code3 === 95 || code3 === 126) {
  2411. effects.consume(code3);
  2412. return trail2;
  2413. }
  2414. if (code3 === 38) {
  2415. effects.consume(code3);
  2416. return trailCharacterReferenceStart;
  2417. }
  2418. if (code3 === 93) {
  2419. effects.consume(code3);
  2420. return trailBracketAfter;
  2421. }
  2422. if (
  2423. // `<` is an end.
  2424. code3 === 60 || // So is whitespace.
  2425. code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)
  2426. ) {
  2427. return ok5(code3);
  2428. }
  2429. return nok(code3);
  2430. }
  2431. function trailBracketAfter(code3) {
  2432. if (code3 === null || code3 === 40 || code3 === 91 || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)) {
  2433. return ok5(code3);
  2434. }
  2435. return trail2(code3);
  2436. }
  2437. function trailCharacterReferenceStart(code3) {
  2438. return asciiAlpha(code3) ? trailCharacterReferenceInside(code3) : nok(code3);
  2439. }
  2440. function trailCharacterReferenceInside(code3) {
  2441. if (code3 === 59) {
  2442. effects.consume(code3);
  2443. return trail2;
  2444. }
  2445. if (asciiAlpha(code3)) {
  2446. effects.consume(code3);
  2447. return trailCharacterReferenceInside;
  2448. }
  2449. return nok(code3);
  2450. }
  2451. }
  2452. function tokenizeEmailDomainDotTrail(effects, ok5, nok) {
  2453. return start;
  2454. function start(code3) {
  2455. effects.consume(code3);
  2456. return after;
  2457. }
  2458. function after(code3) {
  2459. return asciiAlphanumeric(code3) ? nok(code3) : ok5(code3);
  2460. }
  2461. }
  2462. function previousWww(code3) {
  2463. return code3 === null || code3 === 40 || code3 === 42 || code3 === 95 || code3 === 91 || code3 === 93 || code3 === 126 || markdownLineEndingOrSpace(code3);
  2464. }
  2465. function previousProtocol(code3) {
  2466. return !asciiAlpha(code3);
  2467. }
  2468. function previousEmail(code3) {
  2469. return !(code3 === 47 || gfmAtext(code3));
  2470. }
  2471. function gfmAtext(code3) {
  2472. return code3 === 43 || code3 === 45 || code3 === 46 || code3 === 95 || asciiAlphanumeric(code3);
  2473. }
  2474. function previousUnbalanced(events) {
  2475. let index = events.length;
  2476. let result = false;
  2477. while (index--) {
  2478. const token = events[index][1];
  2479. if ((token.type === "labelLink" || token.type === "labelImage") && !token._balanced) {
  2480. result = true;
  2481. break;
  2482. }
  2483. if (token._gfmAutolinkLiteralWalkedInto) {
  2484. result = false;
  2485. break;
  2486. }
  2487. }
  2488. if (events.length > 0 && !result) {
  2489. events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;
  2490. }
  2491. return result;
  2492. }
  2493. // node_modules/micromark-util-classify-character/index.js
  2494. function classifyCharacter(code3) {
  2495. if (code3 === null || markdownLineEndingOrSpace(code3) || unicodeWhitespace(code3)) {
  2496. return 1;
  2497. }
  2498. if (unicodePunctuation(code3)) {
  2499. return 2;
  2500. }
  2501. }
  2502. // node_modules/micromark-util-resolve-all/index.js
  2503. function resolveAll(constructs2, events, context) {
  2504. const called = [];
  2505. let index = -1;
  2506. while (++index < constructs2.length) {
  2507. const resolve = constructs2[index].resolveAll;
  2508. if (resolve && !called.includes(resolve)) {
  2509. events = resolve(events, context);
  2510. called.push(resolve);
  2511. }
  2512. }
  2513. return events;
  2514. }
  2515. // node_modules/micromark-factory-space/index.js
  2516. function factorySpace(effects, ok5, type, max) {
  2517. const limit = max ? max - 1 : Number.POSITIVE_INFINITY;
  2518. let size = 0;
  2519. return start;
  2520. function start(code3) {
  2521. if (markdownSpace(code3)) {
  2522. effects.enter(type);
  2523. return prefix(code3);
  2524. }
  2525. return ok5(code3);
  2526. }
  2527. function prefix(code3) {
  2528. if (markdownSpace(code3) && size++ < limit) {
  2529. effects.consume(code3);
  2530. return prefix;
  2531. }
  2532. effects.exit(type);
  2533. return ok5(code3);
  2534. }
  2535. }
  2536. // node_modules/micromark-core-commonmark/lib/blank-line.js
  2537. var blankLine = {
  2538. tokenize: tokenizeBlankLine,
  2539. partial: true
  2540. };
  2541. function tokenizeBlankLine(effects, ok5, nok) {
  2542. return start;
  2543. function start(code3) {
  2544. return markdownSpace(code3) ? factorySpace(effects, after, "linePrefix")(code3) : after(code3);
  2545. }
  2546. function after(code3) {
  2547. return code3 === null || markdownLineEnding(code3) ? ok5(code3) : nok(code3);
  2548. }
  2549. }
  2550. // node_modules/micromark-extension-gfm-footnote/lib/syntax.js
  2551. var indent = {
  2552. tokenize: tokenizeIndent,
  2553. partial: true
  2554. };
  2555. function gfmFootnote() {
  2556. return {
  2557. document: {
  2558. [91]: {
  2559. name: "gfmFootnoteDefinition",
  2560. tokenize: tokenizeDefinitionStart,
  2561. continuation: {
  2562. tokenize: tokenizeDefinitionContinuation
  2563. },
  2564. exit: gfmFootnoteDefinitionEnd
  2565. }
  2566. },
  2567. text: {
  2568. [91]: {
  2569. name: "gfmFootnoteCall",
  2570. tokenize: tokenizeGfmFootnoteCall
  2571. },
  2572. [93]: {
  2573. name: "gfmPotentialFootnoteCall",
  2574. add: "after",
  2575. tokenize: tokenizePotentialGfmFootnoteCall,
  2576. resolveTo: resolveToPotentialGfmFootnoteCall
  2577. }
  2578. }
  2579. };
  2580. }
  2581. function tokenizePotentialGfmFootnoteCall(effects, ok5, nok) {
  2582. const self = this;
  2583. let index = self.events.length;
  2584. const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
  2585. let labelStart;
  2586. while (index--) {
  2587. const token = self.events[index][1];
  2588. if (token.type === "labelImage") {
  2589. labelStart = token;
  2590. break;
  2591. }
  2592. if (token.type === "gfmFootnoteCall" || token.type === "labelLink" || token.type === "label" || token.type === "image" || token.type === "link") {
  2593. break;
  2594. }
  2595. }
  2596. return start;
  2597. function start(code3) {
  2598. if (!labelStart || !labelStart._balanced) {
  2599. return nok(code3);
  2600. }
  2601. const id = normalizeIdentifier(self.sliceSerialize({
  2602. start: labelStart.end,
  2603. end: self.now()
  2604. }));
  2605. if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {
  2606. return nok(code3);
  2607. }
  2608. effects.enter("gfmFootnoteCallLabelMarker");
  2609. effects.consume(code3);
  2610. effects.exit("gfmFootnoteCallLabelMarker");
  2611. return ok5(code3);
  2612. }
  2613. }
  2614. function resolveToPotentialGfmFootnoteCall(events, context) {
  2615. let index = events.length;
  2616. let labelStart;
  2617. while (index--) {
  2618. if (events[index][1].type === "labelImage" && events[index][0] === "enter") {
  2619. labelStart = events[index][1];
  2620. break;
  2621. }
  2622. }
  2623. events[index + 1][1].type = "data";
  2624. events[index + 3][1].type = "gfmFootnoteCallLabelMarker";
  2625. const call = {
  2626. type: "gfmFootnoteCall",
  2627. start: Object.assign({}, events[index + 3][1].start),
  2628. end: Object.assign({}, events[events.length - 1][1].end)
  2629. };
  2630. const marker = {
  2631. type: "gfmFootnoteCallMarker",
  2632. start: Object.assign({}, events[index + 3][1].end),
  2633. end: Object.assign({}, events[index + 3][1].end)
  2634. };
  2635. marker.end.column++;
  2636. marker.end.offset++;
  2637. marker.end._bufferIndex++;
  2638. const string = {
  2639. type: "gfmFootnoteCallString",
  2640. start: Object.assign({}, marker.end),
  2641. end: Object.assign({}, events[events.length - 1][1].start)
  2642. };
  2643. const chunk = {
  2644. type: "chunkString",
  2645. contentType: "string",
  2646. start: Object.assign({}, string.start),
  2647. end: Object.assign({}, string.end)
  2648. };
  2649. const replacement = [
  2650. // Take the `labelImageMarker` (now `data`, the `!`)
  2651. events[index + 1],
  2652. events[index + 2],
  2653. ["enter", call, context],
  2654. // The `[`
  2655. events[index + 3],
  2656. events[index + 4],
  2657. // The `^`.
  2658. ["enter", marker, context],
  2659. ["exit", marker, context],
  2660. // Everything in between.
  2661. ["enter", string, context],
  2662. ["enter", chunk, context],
  2663. ["exit", chunk, context],
  2664. ["exit", string, context],
  2665. // The ending (`]`, properly parsed and labelled).
  2666. events[events.length - 2],
  2667. events[events.length - 1],
  2668. ["exit", call, context]
  2669. ];
  2670. events.splice(index, events.length - index + 1, ...replacement);
  2671. return events;
  2672. }
  2673. function tokenizeGfmFootnoteCall(effects, ok5, nok) {
  2674. const self = this;
  2675. const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
  2676. let size = 0;
  2677. let data;
  2678. return start;
  2679. function start(code3) {
  2680. effects.enter("gfmFootnoteCall");
  2681. effects.enter("gfmFootnoteCallLabelMarker");
  2682. effects.consume(code3);
  2683. effects.exit("gfmFootnoteCallLabelMarker");
  2684. return callStart;
  2685. }
  2686. function callStart(code3) {
  2687. if (code3 !== 94) return nok(code3);
  2688. effects.enter("gfmFootnoteCallMarker");
  2689. effects.consume(code3);
  2690. effects.exit("gfmFootnoteCallMarker");
  2691. effects.enter("gfmFootnoteCallString");
  2692. effects.enter("chunkString").contentType = "string";
  2693. return callData;
  2694. }
  2695. function callData(code3) {
  2696. if (
  2697. // Too long.
  2698. size > 999 || // Closing brace with nothing.
  2699. code3 === 93 && !data || // Space or tab is not supported by GFM for some reason.
  2700. // `\n` and `[` not being supported makes sense.
  2701. code3 === null || code3 === 91 || markdownLineEndingOrSpace(code3)
  2702. ) {
  2703. return nok(code3);
  2704. }
  2705. if (code3 === 93) {
  2706. effects.exit("chunkString");
  2707. const token = effects.exit("gfmFootnoteCallString");
  2708. if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {
  2709. return nok(code3);
  2710. }
  2711. effects.enter("gfmFootnoteCallLabelMarker");
  2712. effects.consume(code3);
  2713. effects.exit("gfmFootnoteCallLabelMarker");
  2714. effects.exit("gfmFootnoteCall");
  2715. return ok5;
  2716. }
  2717. if (!markdownLineEndingOrSpace(code3)) {
  2718. data = true;
  2719. }
  2720. size++;
  2721. effects.consume(code3);
  2722. return code3 === 92 ? callEscape : callData;
  2723. }
  2724. function callEscape(code3) {
  2725. if (code3 === 91 || code3 === 92 || code3 === 93) {
  2726. effects.consume(code3);
  2727. size++;
  2728. return callData;
  2729. }
  2730. return callData(code3);
  2731. }
  2732. }
  2733. function tokenizeDefinitionStart(effects, ok5, nok) {
  2734. const self = this;
  2735. const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
  2736. let identifier;
  2737. let size = 0;
  2738. let data;
  2739. return start;
  2740. function start(code3) {
  2741. effects.enter("gfmFootnoteDefinition")._container = true;
  2742. effects.enter("gfmFootnoteDefinitionLabel");
  2743. effects.enter("gfmFootnoteDefinitionLabelMarker");
  2744. effects.consume(code3);
  2745. effects.exit("gfmFootnoteDefinitionLabelMarker");
  2746. return labelAtMarker;
  2747. }
  2748. function labelAtMarker(code3) {
  2749. if (code3 === 94) {
  2750. effects.enter("gfmFootnoteDefinitionMarker");
  2751. effects.consume(code3);
  2752. effects.exit("gfmFootnoteDefinitionMarker");
  2753. effects.enter("gfmFootnoteDefinitionLabelString");
  2754. effects.enter("chunkString").contentType = "string";
  2755. return labelInside;
  2756. }
  2757. return nok(code3);
  2758. }
  2759. function labelInside(code3) {
  2760. if (
  2761. // Too long.
  2762. size > 999 || // Closing brace with nothing.
  2763. code3 === 93 && !data || // Space or tab is not supported by GFM for some reason.
  2764. // `\n` and `[` not being supported makes sense.
  2765. code3 === null || code3 === 91 || markdownLineEndingOrSpace(code3)
  2766. ) {
  2767. return nok(code3);
  2768. }
  2769. if (code3 === 93) {
  2770. effects.exit("chunkString");
  2771. const token = effects.exit("gfmFootnoteDefinitionLabelString");
  2772. identifier = normalizeIdentifier(self.sliceSerialize(token));
  2773. effects.enter("gfmFootnoteDefinitionLabelMarker");
  2774. effects.consume(code3);
  2775. effects.exit("gfmFootnoteDefinitionLabelMarker");
  2776. effects.exit("gfmFootnoteDefinitionLabel");
  2777. return labelAfter;
  2778. }
  2779. if (!markdownLineEndingOrSpace(code3)) {
  2780. data = true;
  2781. }
  2782. size++;
  2783. effects.consume(code3);
  2784. return code3 === 92 ? labelEscape : labelInside;
  2785. }
  2786. function labelEscape(code3) {
  2787. if (code3 === 91 || code3 === 92 || code3 === 93) {
  2788. effects.consume(code3);
  2789. size++;
  2790. return labelInside;
  2791. }
  2792. return labelInside(code3);
  2793. }
  2794. function labelAfter(code3) {
  2795. if (code3 === 58) {
  2796. effects.enter("definitionMarker");
  2797. effects.consume(code3);
  2798. effects.exit("definitionMarker");
  2799. if (!defined.includes(identifier)) {
  2800. defined.push(identifier);
  2801. }
  2802. return factorySpace(effects, whitespaceAfter, "gfmFootnoteDefinitionWhitespace");
  2803. }
  2804. return nok(code3);
  2805. }
  2806. function whitespaceAfter(code3) {
  2807. return ok5(code3);
  2808. }
  2809. }
  2810. function tokenizeDefinitionContinuation(effects, ok5, nok) {
  2811. return effects.check(blankLine, ok5, effects.attempt(indent, ok5, nok));
  2812. }
  2813. function gfmFootnoteDefinitionEnd(effects) {
  2814. effects.exit("gfmFootnoteDefinition");
  2815. }
  2816. function tokenizeIndent(effects, ok5, nok) {
  2817. const self = this;
  2818. return factorySpace(effects, afterPrefix, "gfmFootnoteDefinitionIndent", 4 + 1);
  2819. function afterPrefix(code3) {
  2820. const tail = self.events[self.events.length - 1];
  2821. return tail && tail[1].type === "gfmFootnoteDefinitionIndent" && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok5(code3) : nok(code3);
  2822. }
  2823. }
  2824. // node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
  2825. function gfmStrikethrough(options) {
  2826. const options_ = options || {};
  2827. let single = options_.singleTilde;
  2828. const tokenizer = {
  2829. name: "strikethrough",
  2830. tokenize: tokenizeStrikethrough,
  2831. resolveAll: resolveAllStrikethrough
  2832. };
  2833. if (single === null || single === void 0) {
  2834. single = true;
  2835. }
  2836. return {
  2837. text: {
  2838. [126]: tokenizer
  2839. },
  2840. insideSpan: {
  2841. null: [tokenizer]
  2842. },
  2843. attentionMarkers: {
  2844. null: [126]
  2845. }
  2846. };
  2847. function resolveAllStrikethrough(events, context) {
  2848. let index = -1;
  2849. while (++index < events.length) {
  2850. if (events[index][0] === "enter" && events[index][1].type === "strikethroughSequenceTemporary" && events[index][1]._close) {
  2851. let open = index;
  2852. while (open--) {
  2853. if (events[open][0] === "exit" && events[open][1].type === "strikethroughSequenceTemporary" && events[open][1]._open && // If the sizes are the same:
  2854. events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {
  2855. events[index][1].type = "strikethroughSequence";
  2856. events[open][1].type = "strikethroughSequence";
  2857. const strikethrough = {
  2858. type: "strikethrough",
  2859. start: Object.assign({}, events[open][1].start),
  2860. end: Object.assign({}, events[index][1].end)
  2861. };
  2862. const text3 = {
  2863. type: "strikethroughText",
  2864. start: Object.assign({}, events[open][1].end),
  2865. end: Object.assign({}, events[index][1].start)
  2866. };
  2867. const nextEvents = [["enter", strikethrough, context], ["enter", events[open][1], context], ["exit", events[open][1], context], ["enter", text3, context]];
  2868. const insideSpan = context.parser.constructs.insideSpan.null;
  2869. if (insideSpan) {
  2870. splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context));
  2871. }
  2872. splice(nextEvents, nextEvents.length, 0, [["exit", text3, context], ["enter", events[index][1], context], ["exit", events[index][1], context], ["exit", strikethrough, context]]);
  2873. splice(events, open - 1, index - open + 3, nextEvents);
  2874. index = open + nextEvents.length - 2;
  2875. break;
  2876. }
  2877. }
  2878. }
  2879. }
  2880. index = -1;
  2881. while (++index < events.length) {
  2882. if (events[index][1].type === "strikethroughSequenceTemporary") {
  2883. events[index][1].type = "data";
  2884. }
  2885. }
  2886. return events;
  2887. }
  2888. function tokenizeStrikethrough(effects, ok5, nok) {
  2889. const previous2 = this.previous;
  2890. const events = this.events;
  2891. let size = 0;
  2892. return start;
  2893. function start(code3) {
  2894. if (previous2 === 126 && events[events.length - 1][1].type !== "characterEscape") {
  2895. return nok(code3);
  2896. }
  2897. effects.enter("strikethroughSequenceTemporary");
  2898. return more(code3);
  2899. }
  2900. function more(code3) {
  2901. const before = classifyCharacter(previous2);
  2902. if (code3 === 126) {
  2903. if (size > 1) return nok(code3);
  2904. effects.consume(code3);
  2905. size++;
  2906. return more;
  2907. }
  2908. if (size < 2 && !single) return nok(code3);
  2909. const token = effects.exit("strikethroughSequenceTemporary");
  2910. const after = classifyCharacter(code3);
  2911. token._open = !after || after === 2 && Boolean(before);
  2912. token._close = !before || before === 2 && Boolean(after);
  2913. return ok5(code3);
  2914. }
  2915. }
  2916. }
  2917. // node_modules/micromark-extension-gfm-table/lib/edit-map.js
  2918. var EditMap = class {
  2919. /**
  2920. * Create a new edit map.
  2921. */
  2922. constructor() {
  2923. this.map = [];
  2924. }
  2925. /**
  2926. * Create an edit: a remove and/or add at a certain place.
  2927. *
  2928. * @param {number} index
  2929. * @param {number} remove
  2930. * @param {Array<Event>} add
  2931. * @returns {undefined}
  2932. */
  2933. add(index, remove, add) {
  2934. addImplementation(this, index, remove, add);
  2935. }
  2936. // To do: add this when moving to `micromark`.
  2937. // /**
  2938. // * Create an edit: but insert `add` before existing additions.
  2939. // *
  2940. // * @param {number} index
  2941. // * @param {number} remove
  2942. // * @param {Array<Event>} add
  2943. // * @returns {undefined}
  2944. // */
  2945. // addBefore(index, remove, add) {
  2946. // addImplementation(this, index, remove, add, true)
  2947. // }
  2948. /**
  2949. * Done, change the events.
  2950. *
  2951. * @param {Array<Event>} events
  2952. * @returns {undefined}
  2953. */
  2954. consume(events) {
  2955. this.map.sort(function(a, b) {
  2956. return a[0] - b[0];
  2957. });
  2958. if (this.map.length === 0) {
  2959. return;
  2960. }
  2961. let index = this.map.length;
  2962. const vecs = [];
  2963. while (index > 0) {
  2964. index -= 1;
  2965. vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);
  2966. events.length = this.map[index][0];
  2967. }
  2968. vecs.push([...events]);
  2969. events.length = 0;
  2970. let slice = vecs.pop();
  2971. while (slice) {
  2972. events.push(...slice);
  2973. slice = vecs.pop();
  2974. }
  2975. this.map.length = 0;
  2976. }
  2977. };
  2978. function addImplementation(editMap, at, remove, add) {
  2979. let index = 0;
  2980. if (remove === 0 && add.length === 0) {
  2981. return;
  2982. }
  2983. while (index < editMap.map.length) {
  2984. if (editMap.map[index][0] === at) {
  2985. editMap.map[index][1] += remove;
  2986. editMap.map[index][2].push(...add);
  2987. return;
  2988. }
  2989. index += 1;
  2990. }
  2991. editMap.map.push([at, remove, add]);
  2992. }
  2993. // node_modules/micromark-extension-gfm-table/lib/infer.js
  2994. function gfmTableAlign(events, index) {
  2995. let inDelimiterRow = false;
  2996. const align = [];
  2997. while (index < events.length) {
  2998. const event = events[index];
  2999. if (inDelimiterRow) {
  3000. if (event[0] === "enter") {
  3001. if (event[1].type === "tableContent") {
  3002. align.push(events[index + 1][1].type === "tableDelimiterMarker" ? "left" : "none");
  3003. }
  3004. } else if (event[1].type === "tableContent") {
  3005. if (events[index - 1][1].type === "tableDelimiterMarker") {
  3006. const alignIndex = align.length - 1;
  3007. align[alignIndex] = align[alignIndex] === "left" ? "center" : "right";
  3008. }
  3009. } else if (event[1].type === "tableDelimiterRow") {
  3010. break;
  3011. }
  3012. } else if (event[0] === "enter" && event[1].type === "tableDelimiterRow") {
  3013. inDelimiterRow = true;
  3014. }
  3015. index += 1;
  3016. }
  3017. return align;
  3018. }
  3019. // node_modules/micromark-extension-gfm-table/lib/syntax.js
  3020. function gfmTable() {
  3021. return {
  3022. flow: {
  3023. null: {
  3024. name: "table",
  3025. tokenize: tokenizeTable,
  3026. resolveAll: resolveTable
  3027. }
  3028. }
  3029. };
  3030. }
  3031. function tokenizeTable(effects, ok5, nok) {
  3032. const self = this;
  3033. let size = 0;
  3034. let sizeB = 0;
  3035. let seen;
  3036. return start;
  3037. function start(code3) {
  3038. let index = self.events.length - 1;
  3039. while (index > -1) {
  3040. const type = self.events[index][1].type;
  3041. if (type === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
  3042. type === "linePrefix") index--;
  3043. else break;
  3044. }
  3045. const tail = index > -1 ? self.events[index][1].type : null;
  3046. const next = tail === "tableHead" || tail === "tableRow" ? bodyRowStart : headRowBefore;
  3047. if (next === bodyRowStart && self.parser.lazy[self.now().line]) {
  3048. return nok(code3);
  3049. }
  3050. return next(code3);
  3051. }
  3052. function headRowBefore(code3) {
  3053. effects.enter("tableHead");
  3054. effects.enter("tableRow");
  3055. return headRowStart(code3);
  3056. }
  3057. function headRowStart(code3) {
  3058. if (code3 === 124) {
  3059. return headRowBreak(code3);
  3060. }
  3061. seen = true;
  3062. sizeB += 1;
  3063. return headRowBreak(code3);
  3064. }
  3065. function headRowBreak(code3) {
  3066. if (code3 === null) {
  3067. return nok(code3);
  3068. }
  3069. if (markdownLineEnding(code3)) {
  3070. if (sizeB > 1) {
  3071. sizeB = 0;
  3072. self.interrupt = true;
  3073. effects.exit("tableRow");
  3074. effects.enter("lineEnding");
  3075. effects.consume(code3);
  3076. effects.exit("lineEnding");
  3077. return headDelimiterStart;
  3078. }
  3079. return nok(code3);
  3080. }
  3081. if (markdownSpace(code3)) {
  3082. return factorySpace(effects, headRowBreak, "whitespace")(code3);
  3083. }
  3084. sizeB += 1;
  3085. if (seen) {
  3086. seen = false;
  3087. size += 1;
  3088. }
  3089. if (code3 === 124) {
  3090. effects.enter("tableCellDivider");
  3091. effects.consume(code3);
  3092. effects.exit("tableCellDivider");
  3093. seen = true;
  3094. return headRowBreak;
  3095. }
  3096. effects.enter("data");
  3097. return headRowData(code3);
  3098. }
  3099. function headRowData(code3) {
  3100. if (code3 === null || code3 === 124 || markdownLineEndingOrSpace(code3)) {
  3101. effects.exit("data");
  3102. return headRowBreak(code3);
  3103. }
  3104. effects.consume(code3);
  3105. return code3 === 92 ? headRowEscape : headRowData;
  3106. }
  3107. function headRowEscape(code3) {
  3108. if (code3 === 92 || code3 === 124) {
  3109. effects.consume(code3);
  3110. return headRowData;
  3111. }
  3112. return headRowData(code3);
  3113. }
  3114. function headDelimiterStart(code3) {
  3115. self.interrupt = false;
  3116. if (self.parser.lazy[self.now().line]) {
  3117. return nok(code3);
  3118. }
  3119. effects.enter("tableDelimiterRow");
  3120. seen = false;
  3121. if (markdownSpace(code3)) {
  3122. return factorySpace(effects, headDelimiterBefore, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code3);
  3123. }
  3124. return headDelimiterBefore(code3);
  3125. }
  3126. function headDelimiterBefore(code3) {
  3127. if (code3 === 45 || code3 === 58) {
  3128. return headDelimiterValueBefore(code3);
  3129. }
  3130. if (code3 === 124) {
  3131. seen = true;
  3132. effects.enter("tableCellDivider");
  3133. effects.consume(code3);
  3134. effects.exit("tableCellDivider");
  3135. return headDelimiterCellBefore;
  3136. }
  3137. return headDelimiterNok(code3);
  3138. }
  3139. function headDelimiterCellBefore(code3) {
  3140. if (markdownSpace(code3)) {
  3141. return factorySpace(effects, headDelimiterValueBefore, "whitespace")(code3);
  3142. }
  3143. return headDelimiterValueBefore(code3);
  3144. }
  3145. function headDelimiterValueBefore(code3) {
  3146. if (code3 === 58) {
  3147. sizeB += 1;
  3148. seen = true;
  3149. effects.enter("tableDelimiterMarker");
  3150. effects.consume(code3);
  3151. effects.exit("tableDelimiterMarker");
  3152. return headDelimiterLeftAlignmentAfter;
  3153. }
  3154. if (code3 === 45) {
  3155. sizeB += 1;
  3156. return headDelimiterLeftAlignmentAfter(code3);
  3157. }
  3158. if (code3 === null || markdownLineEnding(code3)) {
  3159. return headDelimiterCellAfter(code3);
  3160. }
  3161. return headDelimiterNok(code3);
  3162. }
  3163. function headDelimiterLeftAlignmentAfter(code3) {
  3164. if (code3 === 45) {
  3165. effects.enter("tableDelimiterFiller");
  3166. return headDelimiterFiller(code3);
  3167. }
  3168. return headDelimiterNok(code3);
  3169. }
  3170. function headDelimiterFiller(code3) {
  3171. if (code3 === 45) {
  3172. effects.consume(code3);
  3173. return headDelimiterFiller;
  3174. }
  3175. if (code3 === 58) {
  3176. seen = true;
  3177. effects.exit("tableDelimiterFiller");
  3178. effects.enter("tableDelimiterMarker");
  3179. effects.consume(code3);
  3180. effects.exit("tableDelimiterMarker");
  3181. return headDelimiterRightAlignmentAfter;
  3182. }
  3183. effects.exit("tableDelimiterFiller");
  3184. return headDelimiterRightAlignmentAfter(code3);
  3185. }
  3186. function headDelimiterRightAlignmentAfter(code3) {
  3187. if (markdownSpace(code3)) {
  3188. return factorySpace(effects, headDelimiterCellAfter, "whitespace")(code3);
  3189. }
  3190. return headDelimiterCellAfter(code3);
  3191. }
  3192. function headDelimiterCellAfter(code3) {
  3193. if (code3 === 124) {
  3194. return headDelimiterBefore(code3);
  3195. }
  3196. if (code3 === null || markdownLineEnding(code3)) {
  3197. if (!seen || size !== sizeB) {
  3198. return headDelimiterNok(code3);
  3199. }
  3200. effects.exit("tableDelimiterRow");
  3201. effects.exit("tableHead");
  3202. return ok5(code3);
  3203. }
  3204. return headDelimiterNok(code3);
  3205. }
  3206. function headDelimiterNok(code3) {
  3207. return nok(code3);
  3208. }
  3209. function bodyRowStart(code3) {
  3210. effects.enter("tableRow");
  3211. return bodyRowBreak(code3);
  3212. }
  3213. function bodyRowBreak(code3) {
  3214. if (code3 === 124) {
  3215. effects.enter("tableCellDivider");
  3216. effects.consume(code3);
  3217. effects.exit("tableCellDivider");
  3218. return bodyRowBreak;
  3219. }
  3220. if (code3 === null || markdownLineEnding(code3)) {
  3221. effects.exit("tableRow");
  3222. return ok5(code3);
  3223. }
  3224. if (markdownSpace(code3)) {
  3225. return factorySpace(effects, bodyRowBreak, "whitespace")(code3);
  3226. }
  3227. effects.enter("data");
  3228. return bodyRowData(code3);
  3229. }
  3230. function bodyRowData(code3) {
  3231. if (code3 === null || code3 === 124 || markdownLineEndingOrSpace(code3)) {
  3232. effects.exit("data");
  3233. return bodyRowBreak(code3);
  3234. }
  3235. effects.consume(code3);
  3236. return code3 === 92 ? bodyRowEscape : bodyRowData;
  3237. }
  3238. function bodyRowEscape(code3) {
  3239. if (code3 === 92 || code3 === 124) {
  3240. effects.consume(code3);
  3241. return bodyRowData;
  3242. }
  3243. return bodyRowData(code3);
  3244. }
  3245. }
  3246. function resolveTable(events, context) {
  3247. let index = -1;
  3248. let inFirstCellAwaitingPipe = true;
  3249. let rowKind = 0;
  3250. let lastCell = [0, 0, 0, 0];
  3251. let cell = [0, 0, 0, 0];
  3252. let afterHeadAwaitingFirstBodyRow = false;
  3253. let lastTableEnd = 0;
  3254. let currentTable;
  3255. let currentBody;
  3256. let currentCell;
  3257. const map4 = new EditMap();
  3258. while (++index < events.length) {
  3259. const event = events[index];
  3260. const token = event[1];
  3261. if (event[0] === "enter") {
  3262. if (token.type === "tableHead") {
  3263. afterHeadAwaitingFirstBodyRow = false;
  3264. if (lastTableEnd !== 0) {
  3265. flushTableEnd(map4, context, lastTableEnd, currentTable, currentBody);
  3266. currentBody = void 0;
  3267. lastTableEnd = 0;
  3268. }
  3269. currentTable = {
  3270. type: "table",
  3271. start: Object.assign({}, token.start),
  3272. // Note: correct end is set later.
  3273. end: Object.assign({}, token.end)
  3274. };
  3275. map4.add(index, 0, [["enter", currentTable, context]]);
  3276. } else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
  3277. inFirstCellAwaitingPipe = true;
  3278. currentCell = void 0;
  3279. lastCell = [0, 0, 0, 0];
  3280. cell = [0, index + 1, 0, 0];
  3281. if (afterHeadAwaitingFirstBodyRow) {
  3282. afterHeadAwaitingFirstBodyRow = false;
  3283. currentBody = {
  3284. type: "tableBody",
  3285. start: Object.assign({}, token.start),
  3286. // Note: correct end is set later.
  3287. end: Object.assign({}, token.end)
  3288. };
  3289. map4.add(index, 0, [["enter", currentBody, context]]);
  3290. }
  3291. rowKind = token.type === "tableDelimiterRow" ? 2 : currentBody ? 3 : 1;
  3292. } else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
  3293. inFirstCellAwaitingPipe = false;
  3294. if (cell[2] === 0) {
  3295. if (lastCell[1] !== 0) {
  3296. cell[0] = cell[1];
  3297. currentCell = flushCell(map4, context, lastCell, rowKind, void 0, currentCell);
  3298. lastCell = [0, 0, 0, 0];
  3299. }
  3300. cell[2] = index;
  3301. }
  3302. } else if (token.type === "tableCellDivider") {
  3303. if (inFirstCellAwaitingPipe) {
  3304. inFirstCellAwaitingPipe = false;
  3305. } else {
  3306. if (lastCell[1] !== 0) {
  3307. cell[0] = cell[1];
  3308. currentCell = flushCell(map4, context, lastCell, rowKind, void 0, currentCell);
  3309. }
  3310. lastCell = cell;
  3311. cell = [lastCell[1], index, 0, 0];
  3312. }
  3313. }
  3314. } else if (token.type === "tableHead") {
  3315. afterHeadAwaitingFirstBodyRow = true;
  3316. lastTableEnd = index;
  3317. } else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
  3318. lastTableEnd = index;
  3319. if (lastCell[1] !== 0) {
  3320. cell[0] = cell[1];
  3321. currentCell = flushCell(map4, context, lastCell, rowKind, index, currentCell);
  3322. } else if (cell[1] !== 0) {
  3323. currentCell = flushCell(map4, context, cell, rowKind, index, currentCell);
  3324. }
  3325. rowKind = 0;
  3326. } else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
  3327. cell[3] = index;
  3328. }
  3329. }
  3330. if (lastTableEnd !== 0) {
  3331. flushTableEnd(map4, context, lastTableEnd, currentTable, currentBody);
  3332. }
  3333. map4.consume(context.events);
  3334. index = -1;
  3335. while (++index < context.events.length) {
  3336. const event = context.events[index];
  3337. if (event[0] === "enter" && event[1].type === "table") {
  3338. event[1]._align = gfmTableAlign(context.events, index);
  3339. }
  3340. }
  3341. return events;
  3342. }
  3343. function flushCell(map4, context, range, rowKind, rowEnd, previousCell) {
  3344. const groupName = rowKind === 1 ? "tableHeader" : rowKind === 2 ? "tableDelimiter" : "tableData";
  3345. const valueName = "tableContent";
  3346. if (range[0] !== 0) {
  3347. previousCell.end = Object.assign({}, getPoint(context.events, range[0]));
  3348. map4.add(range[0], 0, [["exit", previousCell, context]]);
  3349. }
  3350. const now = getPoint(context.events, range[1]);
  3351. previousCell = {
  3352. type: groupName,
  3353. start: Object.assign({}, now),
  3354. // Note: correct end is set later.
  3355. end: Object.assign({}, now)
  3356. };
  3357. map4.add(range[1], 0, [["enter", previousCell, context]]);
  3358. if (range[2] !== 0) {
  3359. const relatedStart = getPoint(context.events, range[2]);
  3360. const relatedEnd = getPoint(context.events, range[3]);
  3361. const valueToken = {
  3362. type: valueName,
  3363. start: Object.assign({}, relatedStart),
  3364. end: Object.assign({}, relatedEnd)
  3365. };
  3366. map4.add(range[2], 0, [["enter", valueToken, context]]);
  3367. if (rowKind !== 2) {
  3368. const start = context.events[range[2]];
  3369. const end = context.events[range[3]];
  3370. start[1].end = Object.assign({}, end[1].end);
  3371. start[1].type = "chunkText";
  3372. start[1].contentType = "text";
  3373. if (range[3] > range[2] + 1) {
  3374. const a = range[2] + 1;
  3375. const b = range[3] - range[2] - 1;
  3376. map4.add(a, b, []);
  3377. }
  3378. }
  3379. map4.add(range[3] + 1, 0, [["exit", valueToken, context]]);
  3380. }
  3381. if (rowEnd !== void 0) {
  3382. previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));
  3383. map4.add(rowEnd, 0, [["exit", previousCell, context]]);
  3384. previousCell = void 0;
  3385. }
  3386. return previousCell;
  3387. }
  3388. function flushTableEnd(map4, context, index, table, tableBody) {
  3389. const exits = [];
  3390. const related = getPoint(context.events, index);
  3391. if (tableBody) {
  3392. tableBody.end = Object.assign({}, related);
  3393. exits.push(["exit", tableBody, context]);
  3394. }
  3395. table.end = Object.assign({}, related);
  3396. exits.push(["exit", table, context]);
  3397. map4.add(index + 1, 0, exits);
  3398. }
  3399. function getPoint(events, index) {
  3400. const event = events[index];
  3401. const side = event[0] === "enter" ? "start" : "end";
  3402. return event[1][side];
  3403. }
  3404. // node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js
  3405. var tasklistCheck = {
  3406. name: "tasklistCheck",
  3407. tokenize: tokenizeTasklistCheck
  3408. };
  3409. function gfmTaskListItem() {
  3410. return {
  3411. text: {
  3412. [91]: tasklistCheck
  3413. }
  3414. };
  3415. }
  3416. function tokenizeTasklistCheck(effects, ok5, nok) {
  3417. const self = this;
  3418. return open;
  3419. function open(code3) {
  3420. if (
  3421. // Exit if there’s stuff before.
  3422. self.previous !== null || // Exit if not in the first content that is the first child of a list
  3423. // item.
  3424. !self._gfmTasklistFirstContentOfListItem
  3425. ) {
  3426. return nok(code3);
  3427. }
  3428. effects.enter("taskListCheck");
  3429. effects.enter("taskListCheckMarker");
  3430. effects.consume(code3);
  3431. effects.exit("taskListCheckMarker");
  3432. return inside;
  3433. }
  3434. function inside(code3) {
  3435. if (markdownLineEndingOrSpace(code3)) {
  3436. effects.enter("taskListCheckValueUnchecked");
  3437. effects.consume(code3);
  3438. effects.exit("taskListCheckValueUnchecked");
  3439. return close;
  3440. }
  3441. if (code3 === 88 || code3 === 120) {
  3442. effects.enter("taskListCheckValueChecked");
  3443. effects.consume(code3);
  3444. effects.exit("taskListCheckValueChecked");
  3445. return close;
  3446. }
  3447. return nok(code3);
  3448. }
  3449. function close(code3) {
  3450. if (code3 === 93) {
  3451. effects.enter("taskListCheckMarker");
  3452. effects.consume(code3);
  3453. effects.exit("taskListCheckMarker");
  3454. effects.exit("taskListCheck");
  3455. return after;
  3456. }
  3457. return nok(code3);
  3458. }
  3459. function after(code3) {
  3460. if (markdownLineEnding(code3)) {
  3461. return ok5(code3);
  3462. }
  3463. if (markdownSpace(code3)) {
  3464. return effects.check({
  3465. tokenize: spaceThenNonSpace
  3466. }, ok5, nok)(code3);
  3467. }
  3468. return nok(code3);
  3469. }
  3470. }
  3471. function spaceThenNonSpace(effects, ok5, nok) {
  3472. return factorySpace(effects, after, "whitespace");
  3473. function after(code3) {
  3474. return code3 === null ? nok(code3) : ok5(code3);
  3475. }
  3476. }
  3477. // node_modules/micromark-extension-gfm/index.js
  3478. function gfm(options) {
  3479. return combineExtensions([
  3480. gfmAutolinkLiteral(),
  3481. gfmFootnote(),
  3482. gfmStrikethrough(options),
  3483. gfmTable(),
  3484. gfmTaskListItem()
  3485. ]);
  3486. }
  3487. // node_modules/remark-gfm/lib/index.js
  3488. var emptyOptions2 = {};
  3489. function remarkGfm(options) {
  3490. const self = (
  3491. /** @type {Processor} */
  3492. this
  3493. );
  3494. const settings = options || emptyOptions2;
  3495. const data = self.data();
  3496. const micromarkExtensions = data.micromarkExtensions || (data.micromarkExtensions = []);
  3497. const fromMarkdownExtensions = data.fromMarkdownExtensions || (data.fromMarkdownExtensions = []);
  3498. const toMarkdownExtensions = data.toMarkdownExtensions || (data.toMarkdownExtensions = []);
  3499. micromarkExtensions.push(gfm(settings));
  3500. fromMarkdownExtensions.push(gfmFromMarkdown());
  3501. toMarkdownExtensions.push(gfmToMarkdown(settings));
  3502. }
  3503. // remark-gfm.js
  3504. var remark_gfm_default = remarkGfm;