{"version":3,"sources":["lib/ContentSection/ContentSection.tsx","lib/Benzin/Benzin.tsx","lib/Markdown/CodeBlock.tsx","lib/Markdown/SyntacticSpan.tsx","lib/Markdown/Text.tsx","lib/Markdown/Content.tsx","lib/Markdown/Section.tsx","lib/Markdown/Markdown.tsx","demo/Header/Header.tsx","demo/Window/WindowSurface.tsx","demo/Window/Window.tsx","assets/icon.svg","index.tsx"],"names":["useStyles","makeStyles","theme","content","padding","spacing","marginBottom","ContentSection","sectionName","children","level","classes","adjustedLevel","variant","Typography","Divider","component","className","benzinTheme","createMuiTheme","palette","type","primary","main","orange","secondary","purple","background","default","paper","elevation1","elevation2","elevation3","text","Benzin","ThemeProvider","CssBaseline","root","overflowX","fontFamily","scrollbarColor","CodeBlock","rawLines","Paper","map","line","enclosureRegex","e","local","RegExp","global","regex","conceal","rawLink","emoji","bold","italic","code","strikeThrough","splitter","Object","values","pair","source","join","emojiList","keys","emojiLib","forEach","name","push","char","borderRadius","image","maxWidth","maxHeight","SyntacticSpan","span","matchConceal","exec","src","alt","Link","href","matchEmoji","match","find","matchCode","matchBold","matchItalic","matchStrikeThrough","style","textDecoration","Text","split","denotesCodeBlock","denotesDottedList","denotesClosingHtml","tag","declaresNoLineBreak","Content","length","buffer","splice","closeIndex","findIndex","rawLine","codeBlockLines","slice","dottedListLines","unshift","li","denotesOpenHtml","htmlLines","dangerouslySetInnerHTML","__html","denotesSelfClosingHtml","before","after","lineBreakLines","lineBreakLine","getHeaderLevel","header","SectionMapper","SectionComponent","reduce","sections","sectionLines","Section","deeperLevelIndex","rawContent","trim","deeperLevel","Markdown","data","url","useState","markdown","setMarkdown","axios","get","then","response","useEffect","baseUrl","lastIndexOf","lines","replace","resolveUrls","color","paddingLeft","logo","margin","tab","flexDirection","fontSize","marginRight","Header","contents","page","setPage","AppBar","position","Toolbar","icon","title","Tabs","onChange","event","newPage","value","item","Tab","label","surface","display","overflowY","dark","light","WindowSurface","size","Window","height","bottom","width","left","right","window","promoButton","justifyContent","marginTop","Icon","headerContents","home","spacevim","custom","pageMap","CustomPage","setUrl","inputEl","useRef","TextField","fullWidth","inputRef","Button","onClick","current","LivePreviewPage","setLivePreviewData","multiline","App","livePreviewData","fileName","info","primaryWindowContent","ReactDOM","render","document","getElementById"],"mappings":"2NAcMA,EAAYC,aAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,QAASF,EAAMG,QAAQ,EAAG,EAAG,EAAG,GAChCC,aAAcJ,EAAMG,QAAQ,QAyBjBE,EArB6B,SAAC,GAA0C,IAAxCC,EAAuC,EAAvCA,YAAaC,EAA0B,EAA1BA,SAA0B,IAAhBC,aAAgB,MAAR,EAAQ,EAC9EC,EAAUX,IAEZY,EAAgBF,EAAQ,EACxBE,EAAgB,IAAGA,EAAgB,GAGvC,IAAMC,EAAgB,WAAOD,GAE7B,OACE,qCACE,cAACE,EAAA,EAAD,CAAYD,QAASA,EAArB,SAA+BL,IAC/B,cAACO,EAAA,EAAD,CAASF,QAAQ,WACjB,cAACC,EAAA,EAAD,CAAYE,UAAU,MAAMC,UAAWN,EAAQR,QAA/C,SACGM,Q,4DClBHS,G,MAAcC,YAAe,CACjCC,QAAS,CACPC,KAAM,OACNC,QAAS,CACPC,KAAMC,IAAO,MAEfC,UAAW,CACTF,KAAMG,IAAO,MAEfC,WAAY,CACVC,QAAS,UACTC,MAAO,UACPC,WAAY,UACZC,WAAY,UACZC,WAAY,WAEdC,KAAM,CACJX,QAAS,UACTG,UAAW,gCAcFS,EARU,SAAC,GAAD,IAAGzB,EAAH,EAAGA,SAAH,OACvB,eAAC0B,EAAA,EAAD,CAAejC,MAAOgB,EAAtB,UACE,cAACkB,EAAA,EAAD,IACC3B,M,0BCtCCT,EAAYC,aAAW,SAAAC,GAAK,MAAK,CACrCmC,KAAM,CACJV,WAAYzB,EAAMkB,QAAQO,WAAWC,QACrCxB,QAASF,EAAMG,QAAQ,GACvBiC,UAAW,OACXC,WAAY,YACZC,eAAgB,YAaLC,EAT8B,SAAC,GAA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M6D,GAAQrC,GACdqD,EAAQ,OAAG7E,QAAH,IAAGA,OAAH,EAAGA,EAAK3B,MAAM2B,EAAIU,YAAY,KAAO,GAC7CoE,EAAO,yCAEsB9E,EAFtB,kBAEmC6E,EAFnC,mFAGX,oFACA,oIACA,gCACA,MACA,uCACA,6CACA,6EACA,OAEApJ,KAAK,MAEHsJ,EAAuB,cAAC,EAAD,CAAU/E,IAAKA,IAM1C,MALa,WAATwB,EAAmBuD,EAAuB,cAAC,GAAD,IAC5B,iBAATvD,IACPuD,EAAuB,cAAC,EAAD,CAAUhF,KAAM6E,GAAmB,yCAI1D,eAAC,EAAD,WACE,cAAC,EAAD,CACE5D,KAAM,CACJa,KAAM2B,GACN1B,MAAO,UAETP,SAAUkC,GACVjC,KAAMA,EACNC,QAASA,IAEX,cAAC,GAAD,CAAQ3I,KAAK,UAAb,SACE,qBAAKJ,UAAWN,EAAQgL,OAAxB,SAAiC2B,MAEnC,cAAC,GAAD,CAAQjM,KAAK,YAAYgD,KAAK,kBAA9B,SACE,qBAAKpD,UAAWN,EAAQgL,OAAxB,SAEc,iBAAT5B,EACG,cAAC,GAAD,CAAiBiD,mBAAoBA,IAErC,qCACE,cAAC,EAAD,CAAU1E,KAAM+E,IAChB,mBAAGpM,UAAWN,EAAQiL,YAAtB,SACE,cAACgB,EAAA,EAAD,CACE/L,QAAQ,YACRwI,MAAM,UACN+B,KAAK,QACLyB,QArDQ,WAC1B7C,EAAQ,iBAgDQ,2CAmBpBuD,IAASC,OAAO,cAAC,GAAD,IAASC,SAASC,eAAe,W","file":"static/js/main.b1c0fcc6.chunk.js","sourcesContent":["import React from 'react';\n\nimport {\n Typography,\n Divider,\n makeStyles,\n} from '@material-ui/core';\n\n\ninterface PropTypes {\n sectionName: string;\n level?: number;\n}\n\nconst useStyles = makeStyles(theme => ({\n content: {\n padding: theme.spacing(2, 2, 1, 3),\n marginBottom: theme.spacing(1),\n },\n}));\n\nconst ContentSection: React.FC = ({ sectionName, children, level = 0 }) => {\n const classes = useStyles();\n\n let adjustedLevel = level + 2; // Make everything smaller\n if (adjustedLevel > 6) adjustedLevel = 6;\n\n type Variant = 'h3' | 'h4' | 'h5' | 'h6';\n const variant: Variant = `h${adjustedLevel}` as Variant;\n\n return (\n <>\n {sectionName}\n \n \n {children}\n \n \n );\n};\n\n\nexport default ContentSection;\n","import React from 'react';\nimport orange from '@material-ui/core/colors/orange';\nimport purple from '@material-ui/core/colors/purple';\nimport { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';\nimport { CssBaseline } from '@material-ui/core';\nimport 'typeface-roboto';\n\n\ndeclare module '@material-ui/core/styles/createPalette' {\n interface TypeBackground {\n elevation1: string;\n elevation2: string;\n elevation3: string;\n }\n}\n\n\nconst benzinTheme = createMuiTheme({\n palette: {\n type: 'dark',\n primary: {\n main: orange[400],\n },\n secondary: {\n main: purple[500],\n },\n background: {\n default: '#121212',\n paper: '#1e1e1e',\n elevation1: '#1e1e1e',\n elevation2: '#232323',\n elevation3: '#252525',\n },\n text: {\n primary: '#f4f4f4',\n secondary: 'rgba(255, 255, 255, 0.6)',\n },\n },\n});\n\n\nconst Benzin: React.FC = ({ children }) => (\n \n \n {children}\n \n);\n\n\nexport default Benzin;\n\n","import React from 'react';\nimport { Paper } from '@material-ui/core';\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ParserPropTypes } from './types';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n background: theme.palette.background.default,\n padding: theme.spacing(1),\n overflowX: 'auto',\n fontFamily: 'Monospace',\n scrollbarColor: 'auto',\n },\n}));\n\nconst CodeBlock: React.FC = ({ rawLines }) => {\n const classes = useStyles();\n return (\n \n {rawLines.map(line =>
{line}
)}\n
\n );\n};\n\nexport default CodeBlock;\n\n","import React from 'react';\nimport { Link, makeStyles } from '@material-ui/core';\n\nimport { lib as emojiLib } from 'emojilib';\n\ninterface PropTypes {\n span: string;\n}\n\ninterface RegexPair {\n global: RegExp;\n local: RegExp;\n}\n\ninterface Emoji {\n name: string;\n char: string;\n}\n\nconst enclosureRegex = (e: string): RegexPair => ({\n local: new RegExp(`${e}([^${e}]+)${e}`),\n global: new RegExp(`(${e}[^${e}]+${e})`),\n});\n\nconst regex: Record = {\n conceal: {\n global: /(!?\\[.+?\\]\\(.+?\\))(?!])/g,\n local: /!?\\[(.*\\]?.*)\\]\\((.+?)\\)/,\n },\n rawLink: {\n // eslint-disable-next-line max-len\n global: /((?:(?:[A-Za-z]{3,9}:(?:\\/\\/)?)(?:[-;:&=+$,\\w]+@)?[A-Za-z0-9.-]+|(?:www\\.|[-;:&=+$,\\w]+@)[A-Za-z0-9.-]+)(?:(?:\\/[+~%/.\\w-_]*)?\\??(?:[-+=&;%@.\\w_]*)#?(?:[.!/\\\\\\w]*))?)/,\n local: /&^/,\n },\n emoji: enclosureRegex(':'),\n bold: enclosureRegex('\\\\*\\\\*'),\n italic: enclosureRegex('\\\\*'),\n code: enclosureRegex('`'),\n strikeThrough: enclosureRegex('~~'),\n};\n\nconst splitter = new RegExp(Object.values(regex).map(pair => pair.global.source).join('|'));\n\nconst emojiList: Emoji[] = [];\nObject.keys(emojiLib).forEach(name => emojiList.push({ name, char: emojiLib[name].char }));\n\nconst useStyles = makeStyles(theme => ({\n code: {\n background: theme.palette.background.default,\n borderRadius: theme.spacing(0.5),\n padding: theme.spacing(0.5),\n fontFamily: 'Monospace',\n },\n image: {\n maxWidth: '100%',\n maxHeight: '100%',\n },\n}));\n\nconst SyntacticSpan: React.FC = ({ span }) => {\n const classes = useStyles();\n if (!span) return null;\n\n const matchConceal = regex.conceal.local.exec(span);\n if (matchConceal) {\n if (span[0] === '!') return {matchConceal[1]};\n return ;\n }\n\n const matchEmoji = span.match(regex.emoji.local);\n if (matchEmoji) {\n const emoji = emojiList.find(e => e.name === matchEmoji[1]);\n return {emoji ? emoji.char : span};\n }\n\n const matchCode = span.match(regex.code.local);\n if (matchCode) return {matchCode[1]};\n\n const matchBold = span.match(regex.bold.local);\n if (matchBold) return {matchBold[1]};\n\n const matchItalic = span.match(regex.italic.local);\n if (matchItalic) return {matchItalic[1]};\n\n const matchStrikeThrough = span.match(regex.strikeThrough.local);\n if (matchStrikeThrough) return {matchStrikeThrough[1]};\n\n if (span.match(regex.rawLink.global)) return {span};\n\n return <>{span};\n};\n\n\nexport { splitter };\nexport default SyntacticSpan;\n\n","import React from 'react';\nimport SyntacticSpan, { splitter } from './SyntacticSpan';\n\ninterface PropTypes {\n line: string;\n}\n\nconst Text: React.FC = ({ line }) => {\n return <>{line.split(splitter).map(span => )};\n};\n\nexport default Text;\n\n","import React from 'react';\n\nimport CodeBlock from './CodeBlock';\nimport Text from './Text';\nimport { ParserPropTypes } from './types';\n\n\nconst denotesCodeBlock = (line: string): boolean => {\n return line.match(/^\\s*```.*$/) !== null;\n};\n\nconst denotesDottedList = (line: string): boolean => {\n return line.match(/^ ?[-*] .*$/) !== null;\n};\n\nconst denotesOpenHtml = (line: string): string => {\n const regex = /<([^/\\s]*)[^<]*[^/]>/g;\n const match = regex.exec(line);\n return match ? match[1] : '';\n};\n\nconst denotesClosingHtml = (line: string, tag: string): boolean => {\n const regex = new RegExp(``);\n return line.match(regex) !== null;\n};\n\nconst denotesSelfClosingHtml = (line: string): string[] | null => {\n const regex = /(<[^/\\s]*[^<]*\\/>)/g;\n return line.match(regex);\n};\n\nconst declaresNoLineBreak = (line: string): boolean => {\n return line.match(/\\\\\\|$/) !== null;\n};\n\nconst Content: React.FC = ({ rawLines }) => {\n if (!rawLines.length) return null;\n\n const line = rawLines.splice(0, 1)[0];\n\n let buffer;\n if (denotesCodeBlock(line)) {\n const closeIndex = rawLines.findIndex(rawLine => denotesCodeBlock(rawLine));\n const codeBlockLines = rawLines.splice(0, closeIndex + 1).slice(0, closeIndex);\n buffer = ;\n } else if (denotesDottedList(line)) {\n const closeIndex = rawLines.findIndex(rawLine => !denotesDottedList(rawLine));\n const dottedListLines = rawLines.splice(0, closeIndex).slice(0, closeIndex);\n dottedListLines.unshift(line);\n buffer =
    {dottedListLines.map(li =>
  • )}
;\n } else if ((buffer = denotesOpenHtml(line))) {\n const tag = buffer;\n const closeIndex = denotesClosingHtml(line, tag) ? -1 : rawLines.findIndex(\n rawLine => denotesClosingHtml(rawLine, tag),\n );\n const htmlLines = rawLines.splice(0, closeIndex + 1);\n htmlLines.unshift(line);\n buffer =
;\n } else if ((buffer = denotesSelfClosingHtml(line)) !== null) {\n const match = buffer[0];\n const [before, after] = line.split(match);\n buffer = (\n <>\n \n
\n \n \n );\n } else if (declaresNoLineBreak(line)) {\n const closeIndex = rawLines.findIndex(rawLine => !declaresNoLineBreak(rawLine));\n const lineBreakLines = rawLines.splice(0, closeIndex).map(rawLine => rawLine.slice(0, -2));\n lineBreakLines.unshift(line.slice(0, -2));\n lineBreakLines.push(rawLines.splice(0, 1)[0]);\n buffer =

{lineBreakLines.map(lineBreakLine => )}

;\n } else if (denotesClosingHtml(line, '')) {\n buffer = null;\n } else {\n buffer =

;\n }\n\n return (\n <>\n { buffer }\n \n \n );\n};\n\nexport default Content;\n\n","import React from 'react';\nimport { Typography } from '@material-ui/core';\nimport ContentSection from '../ContentSection/ContentSection';\nimport Content from './Content';\nimport { ParserPropTypes } from './types';\n\ninterface PropTypes extends ParserPropTypes {\n level?: number;\n}\n\ninterface MapperPropTypes extends PropTypes {\n SectionComponent: React.FC;\n}\n\nconst getHeaderLevel = (header: string): number => {\n if (!header) return 0;\n let level = 0;\n while (header[level] === '#') level += 1;\n return level;\n};\n\nconst SectionMapper: React.FC = ({ rawLines, level = 0, SectionComponent }) => {\n const children = rawLines\n .reduce((sections: string[][], line: string) => {\n if (line) {\n if (getHeaderLevel(line) === level) sections.push([]);\n if (sections.length) sections[sections.length - 1].push(line);\n }\n return sections;\n }, [])\n .map(sectionLines => );\n\n return <>{children};\n};\n\n\nconst Section: React.FC = ({ rawLines, level = 0 }) => {\n const deeperLevelIndex = rawLines.findIndex(line => line.match(`^#{${level + 1},} .*$`));\n const rawContent = rawLines.splice(0, (deeperLevelIndex < 0) ? rawLines.length : deeperLevelIndex);\n\n if (!level) {\n return (\n <>\n \n \n \n );\n }\n\n const sectionName = rawContent.splice(0, 1)[0].slice(level).trim();\n const deeperLevel = getHeaderLevel(rawLines[0]);\n return (\n \n \n \n \n );\n};\n\nexport default Section;\n\n","import React, { useState, useEffect } from 'react';\nimport axios from 'axios';\n\nimport Section from './Section';\n\ninterface PropTypes {\n data?: string;\n url?: string;\n}\n\nconst resolveUrls = (line: string, baseUrl: string): string => line.replace(\n /src=\"(?!http)(.*)\"[\\s>]/,\n (match, url) => `src=\"${baseUrl}/${url}?sanitize=true\"`,\n).replace(\n /\\[(.*\\]?.*)\\]\\((?!http)(.+?)\\)/,\n (match, text, url) => `[${text}](${baseUrl}/${url})`,\n);\n\nconst Markdown: React.FC = ({ data, url }) => {\n const [markdown, setMarkdown] = useState(data || '');\n\n if (url) axios.get(url).then(response => setMarkdown(response.data));\n\n useEffect(() => {\n if (!url) setMarkdown(data || '');\n }, [data, url]);\n\n const baseUrl = url?.slice(0, url.lastIndexOf('/')) || '';\n const lines = markdown.split(/\\r?\\n/).map(line => resolveUrls(line, baseUrl));\n return
;\n};\n\n\nexport default Markdown;\n\n","import React from 'react';\n\nimport {\n AppBar,\n Tabs,\n Tab,\n Typography,\n Toolbar,\n} from '@material-ui/core';\n\nimport { makeStyles } from '@material-ui/core/styles';\n\n\ninterface PropTypes {\n logo: {\n icon: React.ReactNode;\n title: string;\n };\n contents: {\n [key: string]: React.ReactNode | null;\n };\n page: string;\n setPage: (newPage: string) => void;\n}\n\nconst useStyles = makeStyles(theme => ({\n root: {\n background: theme.palette.background.elevation2,\n color: theme.palette.text.primary,\n paddingLeft: theme.spacing(3),\n },\n logo: {\n margin: theme.spacing(0, 3, 0, 1),\n },\n tab: {\n '& .MuiTab-wrapper': {\n padding: theme.spacing(2),\n flexDirection: 'row',\n fontSize: '0.8125rem',\n '& svg': {\n marginRight: theme.spacing(1),\n marginBottom: '0 !important',\n },\n },\n },\n}));\n\n\nconst Header: React.FC = ({\n logo, contents, page, setPage,\n}) => {\n const classes = useStyles();\n\n const handleChange = (event: React.ChangeEvent, newPage: string): void => {\n setPage(newPage);\n };\n\n return (\n \n \n {logo.icon}\n \n {logo.title}\n \n \n {contents && Object.keys(contents).map((item: string) => (\n \n ))}\n \n \n \n );\n};\n\nexport default Header;\n","import React from 'react';\n\nimport { Paper, makeStyles } from '@material-ui/core';\n\nimport { SurfaceSize, SurfacePosition } from './types';\n\n\ninterface PropTypes {\n size: SurfaceSize;\n position: SurfacePosition;\n}\n\n\nconst useStyles = makeStyles(theme => ({\n surface: {\n position: 'absolute',\n display: 'flex',\n flexDirection: 'column',\n overflowY: 'auto',\n scrollbarColor: `${theme.palette.secondary.dark} ${theme.palette.secondary.light}`,\n\n '& a.MuiTypography-root': {\n color: theme.palette.primary.light,\n },\n },\n}));\n\n\nconst WindowSurface: React.FC = ({ size, position, children }) => {\n const classes = useStyles();\n\n return (\n \n {children}\n \n );\n};\n\n\nexport default WindowSurface;\n","import React from 'react';\n\nimport { Typography, Divider, makeStyles } from '@material-ui/core';\n\nimport WindowSurface from './WindowSurface';\nimport { SurfaceSize, SurfacePosition } from './types';\n\n\ninterface PropTypes {\n type: 'primary' | 'secondary' | 'mono';\n name?: string;\n}\n\n\nconst useStyles = makeStyles(theme => ({\n header: {\n padding: theme.spacing(1, 0, 1, 2),\n background: theme.palette.background.elevation2,\n },\n}));\n\n\nconst Window: React.FC = ({ type, name, children }) => {\n const classes = useStyles();\n\n const size: SurfaceSize = {\n height: '85vh',\n };\n\n const position: SurfacePosition = {\n bottom: '3vh',\n };\n\n if (type === 'primary') {\n size.width = '63vw';\n position.left = '2vw';\n } else if (type === 'secondary') {\n size.width = '31vw';\n position.right = '2vw';\n } else if (type === 'mono') {\n position.left = '2vw';\n position.right = '2vw';\n }\n\n return (\n \n {name\n && (\n
\n {name}\n \n
\n )}\n {children}\n \n );\n};\n\nexport default Window;\n","export default __webpack_public_path__ + \"static/media/icon.50d2b01a.svg\";","import React, { useState, useRef } from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n makeStyles,\n TextField,\n Button,\n Link,\n} from '@material-ui/core';\nimport {\n Benzin,\n Markdown,\n ContentSection,\n} from './lib';\n\nimport Header from './demo/Header/Header';\nimport Window from './demo/Window/Window';\nimport icon from './assets/icon.svg';\n\nconst useStyles = makeStyles(theme => ({\n window: {\n padding: theme.spacing(4),\n },\n promoButton: {\n display: 'flex',\n justifyContent: 'center',\n marginTop: theme.spacing(4),\n },\n}));\n\n\nconst Icon = \"logo\";\n\nconst headerContents = {\n home: null,\n spacevim: null,\n 'material-ui': null,\n custom: null,\n 'live preview': null,\n};\n\nconst pageMap: Record = {\n home: 'https://raw.githubusercontent.com/eug-vs/react-benzin/develop/README.md',\n spacevim: 'https://raw.githubusercontent.com/spacevim/spacevim/master/README.md',\n 'material-ui': 'https://raw.githubusercontent.com/mui-org/material-ui/master/README.md',\n};\n\n\nconst CustomPage: React.FC = () => {\n const [url, setUrl] = useState('');\n const inputEl = useRef(null);\n\n const handleParseUrl = (): void => {\n setUrl(inputEl.current?.value || '');\n };\n\n return (\n <>\n \n

\n This should be a link to a valid markdown file. Response should give the file contents.\n If you copy README file from GitHub, make sure you provide link to raw view.\n

\n

\n \n

\n \n
\n \n \n );\n};\n\ninterface LivePropTypes {\n setLivePreviewData: (livePreviewData: string) => void;\n}\n\nconst LivePreviewPage: React.FC = ({ setLivePreviewData }) => {\n const inputEl = useRef(null);\n\n const handleRender = (): void => {\n setLivePreviewData(inputEl.current?.value || '');\n };\n\n return (\n <>\n \n

\n Start typing and see your text rendered on the left window!\n You can find the list of all Markdown features\n {' '}\n \n here\n \n . (some of them are yet in progress).\n We recommend starting with # Header.\n

\n

\n \n

\n
\n \n );\n};\n\n\nconst App: React.FC = () => {\n const classes = useStyles();\n const [page, setPage] = useState('home');\n const [livePreviewData, setLivePreviewData] = useState('');\n\n const handleGoLivePreview = (): void => {\n setPage('live preview');\n };\n\n const url = pageMap[page];\n const fileName = url?.slice(url.lastIndexOf('/') + 1);\n const info = [\n /* eslint-disable max-len */\n `## Markdown\\n [Markdown file](${url}) *(...${fileName})* that you can see on the left was parsed and rendered by **BENZIN**! :rocket:`,\n 'Switch between tabs on the header to explore other markdown templates. :recycle: ',\n 'Templates on the left are being loaded from the [GitHub](https://github.com), though this pane is generated from plaintext. :pen:',\n '## How do I use this feature?',\n '```',\n 'import Markdown from \\'react-benzin\\';',\n 'const data = \\'# Header\\\\nHello, *world!*\\';',\n 'ReactDOM.render(, document.getElementById(\\'root\\'));',\n '```',\n /* eslint-enable max-len */\n ].join('\\n');\n\n let primaryWindowContent = ;\n if (page === 'custom') primaryWindowContent = ;\n else if (page === 'live preview') {\n primaryWindowContent = ;\n }\n\n return (\n \n \n \n
{primaryWindowContent}
\n
\n \n
\n {\n (page === 'live preview')\n ? \n : (\n <>\n \n

\n \n Try it yourself!\n \n

\n \n )\n }\n
\n
\n
\n );\n};\n\n\nReactDOM.render(, document.getElementById('root'));\n\n"],"sourceRoot":""}