{"version":3,"sources":["../src/render.js"],"names":["render","node","options","adapter","renderer","createRenderer","mode","html","context"],"mappings":";;;;;qBAiBwBA,M;;;;;;AAjBxB;;;;AACA;;;;AAEA;;;;;;;;;;;;;;AAce,SAASA,MAAT,CAAgBC,IAAhB,EAAoC;AAAA,MAAdC,OAAc,uEAAJ,EAAI;;AACjD,MAAMC,UAAU,6BAAWD,OAAX,CAAhB;AACA,MAAME,WAAWD,QAAQE,cAAR,4BAAyBC,MAAM,QAA/B,IAA4CJ,OAA5C,EAAjB;AACA,MAAMK,OAAOH,SAASJ,MAAT,CAAgBC,IAAhB,EAAsBC,QAAQM,OAA9B,CAAb;AACA,SAAO,4BAAgBD,IAAhB,CAAP;AACD","file":"render.js","sourcesContent":["import getAdapter from './getAdapter';\nimport { loadCheerioRoot } from './Utils';\n\n/**\n * Renders a react component into static HTML and provides a cheerio wrapper around it. This is\n * somewhat asymmetric with `mount` and `shallow`, which don't use any external libraries, but\n * Cheerio's API is pretty close to what we actually want and has a significant amount of utility\n * that would be recreating the wheel if we didn't use it.\n *\n * I think there are a lot of good use cases to use `render` instead of `shallow` or `mount`, and\n * thus I'd like to keep this API in here even though it's not really \"ours\".\n *\n * @param node\n * @param options\n * @returns {Cheerio}\n */\n\nexport default function render(node, options = {}) {\n const adapter = getAdapter(options);\n const renderer = adapter.createRenderer({ mode: 'string', ...options });\n const html = renderer.render(node, options.context);\n return loadCheerioRoot(html);\n}\n"]}