{"version":3,"sources":["https://lively-kernel.org/lively4/lively4-tom/src/external/markdown-it-sourcemap.js"],"names":["sourceMapPlugin","md","originalFunc","renderer","renderToken","bind","tokens","idx","options","token","map","type","endsWith","attrPush"],"mappings":";;;;;;;;AAAA,YAAMA,kBAAmBC,EAAD,IAAQ;AAC9B,cAAMC,eAAeD,GAAGE,QAAH,CAAYC,WAAZ,CAAwBC,IAAxB,CAA6BJ,GAAGE,QAAhC,CAArB;AACAF,WAAGE,QAAH,CAAYC,WAAZ,GAA0B,UAAUE,MAAV,EAAkBC,GAAlB,EAAuBC,OAAvB,EAAgC;AACxD,cAAIC,QAAQH,OAAOC,GAAP,CAAZ;AACA,cAAIE,MAAMC,GAAN,KAAc,IAAd,IAAsBD,MAAME,IAAN,CAAWC,QAAX,CAAoB,OAApB,CAA1B,EAAwD;AACtDH,kBAAMI,QAAN,CAAe,CAAC,kBAAD,EAAsBJ,MAAMC,GAAN,CAAU,CAAV,IAAe,CAAhB,GAAqB,GAArB,IAA4BD,MAAMC,GAAN,CAAU,CAAV,IAAe,CAA3C,CAArB,CAAf;AACD;AACD,iBAAOR,aAAaI,MAAb,EAAqBC,GAArB,EAA0BC,OAA1B,CAAP;AACD,SAND;AAOD,OATD;;;;;;;;;;;;;;;;yBAWeR,e","file":"markdown-it-sourcemap.js","sourcesContent":["const sourceMapPlugin = (md) => {\n  const originalFunc = md.renderer.renderToken.bind(md.renderer)\n  md.renderer.renderToken = function (tokens, idx, options) {\n    let token = tokens[idx]\n    if (token.map !== null && token.type.endsWith('_open')) {\n      token.attrPush(['data-source-line', (token.map[0] + 1) + \"-\" + (token.map[1] + 1)])\n    }\n    return originalFunc(tokens, idx, options)\n  }\n}\n\nexport default sourceMapPlugin"]}