-
Notifications
You must be signed in to change notification settings - Fork 1
/
component---src-pages-proofing-js-1711671b6ad98534d99d.js.map
1 lines (1 loc) · 148 KB
/
component---src-pages-proofing-js-1711671b6ad98534d99d.js.map
1
{"version":3,"sources":["webpack:///./src/ui-components/loading-spinner.js","webpack:///./plugins/gatsby-transformer-tei/tei.js","webpack:///./src/pages/proofing.js","webpack:///./src/images/apils_logo.min.svg","webpack:///./src/images/simple-horizontal-light.png","webpack:///./src/components/meta.js","webpack:///./src/theme/typography.js","webpack:///./src/theme/apils-theme.js","webpack:///./src/theme/global-style.js","webpack:///./src/components/language-switcher.js","webpack:///./src/components/layout.js","webpack:///./src/ui-components/tooltip.js","webpack:///./src/ui-components/article-elements.js","webpack:///./src/ui-components/proofing-elements.js","webpack:///./src/ui-components/section-divider.js","webpack:///./src/utils/tei-renderer.js","webpack:///./plugins/gatsby-transformer-tei/jsonml.js","webpack:///./plugins/gatsby-transformer-tei/sax.js"],"names":["LoadingSpinnerContainer","styled","div","withConfig","displayName","componentId","LoadingSpinnerInner","props","customColor","LoadingSpinner","color","react_default","a","createElement","defaultProps","TeiDoc","xmlString","debug","_this","_JsonMlDoc","call","this","footnotes","skipExprs","renderToHtml","hi","children","attrs","doc","parent","rend","toHtml","concat","_toConsumableArray","console","log","constructor","renderTag","p","note","footnoteIndex","n","footnoteId","placeName","Object","keys","length","warn","name","type","role","head","figure","graphic","find","elem","url","slice","table","replace","row","cell","quote","collectFootnotes","_this2","getElemsByName","forEach","_footnote","footnote","shift","index","content","getFrontmatter","title","getFirstTextContent","author","getTitleHtml","titleElem","getElemByPath","markupChinese","getAbstractHtml","abstractElem","getKeywords","getArticleBodyHtml","bodyElem","getFootnotesHtml","footnotesHtml","entries","map","_ref","join","getImagePaths","text","anyChineseRegex","RegExp","JsonMlDoc","ENTITY_TYPES","ProofingPage","_React$Component","onNewFile","event","teiFile","target","files","setState","loading","readTeiFile","reset","onNerSubmit","preventDefault","include","Array","from","filter","checked","value","getMarkedUpTei","model","onRenderClick","onClearClick","state","teiXml","teiNode","sendFileForNerMarkup","file","formData","FormData","append","set","post","process","headers","content-type","then","response","data","makeTeiNode","document","querySelector","_this3","teiDoc","frontmatter","titleHtml","abstractHtml","articleBodyHtml","images","_this4","fileReader","FileReader","onloadend","result","readAsText","render","teiRenderer","_this$state","article","TeiRenderer","Fragment","article_elements","articleBody","layout","meta","loading_spinner","theme","colors","main","proofing_elements","onChange","onClick","classList","toggle","onSubmit","tooltip","placement","tipContent","tipStyles","controlsTipStyles","htmlFor","id","defaultChecked","_ref2","entityType","entityDesc","key","form","checkbox","React","Component","__webpack_require__","ApilsLogoMin","transform","d","version","viewBox","module","exports","default","react__WEBPACK_IMPORTED_MODULE_0__","react__WEBPACK_IMPORTED_MODULE_0___default","react_helmet__WEBPACK_IMPORTED_MODULE_1__","react_helmet__WEBPACK_IMPORTED_MODULE_1___default","gatsby_plugin_intl__WEBPACK_IMPORTED_MODULE_2__","Meta","description","intl","metaDescription","formatMessage","htmlAttributes","lang","locale","titleTemplate","property","injectIntl","deYoungTheme","headerFontFamily","bodyFontFamily","typography","Typography","scale","rhythm","options","apils_theme","mainAlt","pageBg","highlight","bodyText","bodyColor","headerText","headerColor","fonts","body","typeface","header","contentMaxWidth","contentOverhang","pageShadow","createGlobalStyle","_templateObject","languageName","en","zh","Container","LanguageButton","button","activeLocale","LanguageSwitcher","gatsby_plugin_intl","languages","currentLocale","language","changeLocale","bgImage","_ref3","_ref4","Header","_ref5","_ref6","_ref7","Branding","_ref8","_ref9","_ref10","_ref11","_ref12","Naivgation","nav","_ref13","_ref14","_ref15","_ref16","_ref17","Footer","footer","_ref18","_ref19","_ref20","_ref21","_ref22","Helmet_default","rel","href","crossOrigin","styled_components_browser_esm","ApilsTheme","global_style","layout_Container","to","apils_logo_min_default","activeClassName","language_switcher","Date","getFullYear","Tip","output","customStyles","css","Arrow","span","Tooltip","_Component","shown","_this$props","arrowStyles","preferredPlacement","react_popper__WEBPACK_IMPORTED_MODULE_2__","ref","isValidElement","cloneElement","onMouseEnter","onMouseLeave","positionFixed","style","arrowProps","data-placement","__webpack_exports__","Abstract","ArticleBody","Footnotes","footnoteTipStyles","styled_components__WEBPACK_IMPORTED_MODULE_0__","polished__WEBPACK_IMPORTED_MODULE_1__","transparentize","blockquote","lighten","_ref23","_ref24","_ref25","_ref26","_ref27","_ref28","_ref29","ControlsPanel","ToggleButton","ControlButton","NamedEntity","entityTipStyles","_tooltip__WEBPACK_IMPORTED_MODULE_2__","SectionDividerContainer","SectionDivider","domToReactWithReplace","domToReact","parserOptions","domNode","section_divider","src","img","relativePath","endsWith","attribs","publicURL","alt","test","Parser","innerHTML","colspan","footnotesParserOptions","pop","abstract","parse","_proto","prototype","node","nodeStack","parser","sax","xmlns","Buffer","partial","onopentag","_ref$attributes","attributes","newNode","push","reduce","acc","k","onclosetag","ontext","textContent","write","close","elemPath","child","getElemByName","elemName","condition","accumulator","isArray","matchedElems","currentElem","split","expr","_this4$constructor$pa","parseExpr","tag","attr","val","_elem","_this5","newHtml","includes","skipElem","trim","_this6","some","elemMatchesExpr","_wrapRegExp","exec","groups","_this$parseExpr","Stream","buffers","SAXParser","strict","opt","i","l","clearBuffers","q","c","bufferCheckPosition","MAX_BUFFER_LENGTH","lowercase","lowercasetags","looseCase","tags","closed","closedRoot","sawRoot","error","noscript","S","BEGIN","strictEntities","ENTITIES","create","XML_ENTITIES","attribList","ns","rootNS","trackPosition","position","line","column","emit","EVENTS","o","F","hasOwnProperty","end","chunk","toString","charAt","BEGIN_WHITESPACE","beginWhiteSpace","TEXT","starti","textNode","substring","isWhitespace","strictFail","TEXT_ENTITY","OPEN_WAKA","startTagPosition","SCRIPT","SCRIPT_ENDING","script","CLOSE_TAG","SGML_DECL","sgmlDecl","isMatch","nameStart","OPEN_TAG","tagName","PROC_INST","procInstName","procInstBody","pad","toUpperCase","CDATA","emitNode","cdata","COMMENT","comment","DOCTYPE","doctype","isQuote","SGML_DECL_QUOTED","DOCTYPE_DTD","DOCTYPE_QUOTED","DOCTYPE_DTD_QUOTED","COMMENT_ENDING","COMMENT_ENDED","textopts","CDATA_ENDING","CDATA_ENDING_2","PROC_INST_ENDING","PROC_INST_BODY","nameBody","newTag","openTag","OPEN_TAG_SLASH","ATTRIB","closeTag","attribName","attribValue","ATTRIB_NAME","ATTRIB_VALUE","attrib","ATTRIB_NAME_SAW_WHITE","ATTRIB_VALUE_QUOTED","ATTRIB_VALUE_UNQUOTED","ATTRIB_VALUE_ENTITY_Q","ATTRIB_VALUE_CLOSED","isAttribEnd","ATTRIB_VALUE_ENTITY_U","CLOSE_TAG_SAW_WHITE","notMatch","returnState","buffer","parseEntity","entity","entityBody","entityStart","Error","maxAllowed","Math","max","maxActual","len","closeText","m","checkBufferLength","resume","flush","require","ex","streamWraps","ev","SAXStream","apply","_parser","writable","readable","me","onend","onerror","er","_decoder","defineProperty","get","h","removeAllListeners","on","enumerable","configurable","isBuffer","SD","StringDecoder","handler","indexOf","args","arguments","splice","XML_NAMESPACE","XMLNS_NAMESPACE","xml","regex","stringFromCharCode","floor","fromCodePoint","s","STATE","COMMENT_STARTING","amp","gt","lt","quot","apos","AElig","Aacute","Acirc","Agrave","Aring","Atilde","Auml","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","Iacute","Icirc","Igrave","Iuml","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","aelig","agrave","aring","atilde","auml","ccedil","eacute","ecirc","egrave","eth","euml","iacute","icirc","igrave","iuml","ntilde","oacute","ocirc","ograve","oslash","otilde","ouml","szlig","thorn","uacute","ucirc","ugrave","uuml","yacute","yuml","copy","reg","nbsp","iexcl","cent","pound","curren","yen","brvbar","sect","uml","ordf","laquo","not","shy","macr","deg","plusmn","sup1","sup2","sup3","acute","micro","para","middot","cedil","ordm","raquo","frac14","frac12","frac34","iquest","times","divide","OElig","oelig","Scaron","scaron","Yuml","fnof","circ","tilde","Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega","alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","omicron","pi","rho","sigmaf","sigma","tau","upsilon","phi","chi","psi","omega","thetasym","upsih","piv","ensp","emsp","thinsp","zwnj","zwj","lrm","rlm","ndash","mdash","lsquo","rsquo","sbquo","ldquo","rdquo","bdquo","dagger","Dagger","bull","hellip","permil","prime","Prime","lsaquo","rsaquo","oline","frasl","euro","image","weierp","real","trade","alefsym","larr","uarr","rarr","darr","harr","crarr","lArr","uArr","rArr","dArr","hArr","forall","part","exist","empty","nabla","isin","notin","ni","prod","sum","minus","lowast","radic","prop","infin","ang","and","or","cap","cup","int","there4","sim","cong","asymp","ne","equiv","le","ge","sub","sup","nsub","sube","supe","oplus","otimes","perp","sdot","lceil","rceil","lfloor","rfloor","rang","loz","spades","clubs","hearts","diams","e","String","fromCharCode","nodeType","normalize","message","qname","attribute","qualName","prefix","local","qn","selfClosing","uri","JSON","stringify","nv","isSelfClosing","toLowerCase","t","closeTo","x","num","entityLC","numStr","parseInt","isNaN","highSurrogate","lowSurrogate","codeUnits","codePoint","Number","isFinite","RangeError","createStream"],"mappings":"iMAIMA,EAA0BC,IAAOC,IAAVC,WAAA,CAAAC,YAAA,2CAAAC,YAAA,gBAAGJ,CAAH,2FAUvBK,EAAsBL,IAAOC,IAAVC,WAAA,CAAAC,YAAA,uCAAAC,YAAA,gBAAGJ,CAAH,4aAIP,SAAAM,GAAK,OAAIA,EAAMC,aAOpB,SAAAD,GAAK,OAAIA,EAAMC,cAsC5B,SAASC,EAAeF,GAAO,IACrBG,EAAUH,EAAVG,MACR,OACEC,EAAAC,EAAAC,cAACb,EAAD,KACEW,EAAAC,EAAAC,cAACP,EAAD,CAAqBE,YAAaE,KAQxCD,EAAeK,aAAe,CAAEJ,MAAO,OAExBD,qaC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BA,GAM7B9M,EAAID,OAAS,SAASkD,EAAQC,GAC5B,OAAO,IAAIF,EAAUC,EAAQC,IAE/BlD,EAAIgD,UAAYA,EAChBhD,EAAI+K,UAAYA,EAChB/K,EAAIgf,aA15CJ,SAAsB/b,EAAQC,GAC5B,OAAO,IAAI6H,EAAU9H,EAAQC,IA25ChBlD","file":"component---src-pages-proofing-js-1711671b6ad98534d99d.js","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport styled from \"styled-components\";\n\nconst LoadingSpinnerContainer = styled.div`\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.6);\n z-index: 9;\n`;\n\nconst LoadingSpinnerInner = styled.div`\n &,\n &::before,\n &::after {\n background: ${props => props.customColor};\n animation: load1 1s infinite ease-in-out;\n width: 1em;\n height: 4em;\n }\n\n & {\n color: ${props => props.customColor};\n text-indent: -9999em;\n margin: 88px auto;\n font-size: 11px;\n transform: translateZ(0);\n animation-delay: -0.16s;\n }\n\n &::before,\n &::after {\n position: absolute;\n top: 0;\n content: \"\";\n }\n\n &::before {\n left: -1.5em;\n animation-delay: -0.32s;\n }\n\n &::after {\n left: 1.5em;\n }\n\n @keyframes load1 {\n 0%,\n 80%,\n 100% {\n box-shadow: 0 0;\n height: 4em;\n }\n 40% {\n box-shadow: 0 -2em;\n height: 5em;\n }\n }\n`;\n\nfunction LoadingSpinner(props) {\n const { color } = props;\n return (\n <LoadingSpinnerContainer>\n <LoadingSpinnerInner customColor={color} />\n </LoadingSpinnerContainer>\n );\n}\n\nLoadingSpinner.propTypes = {\n color: PropTypes.oneOfType([PropTypes.string, PropTypes.func])\n};\nLoadingSpinner.defaultProps = { color: \"red\" };\n\nexport default LoadingSpinner;\n","import JsonMlDoc from \"./jsonml\";\n\nclass TeiDoc extends JsonMlDoc {\n constructor(xmlString, debug) {\n super(xmlString, debug);\n\n this.footnotes = {};\n this.skipExprs = [\"titlePart\", \"div[@type='articleBody']\"];\n\n this.renderToHtml = {\n hi: (children, attrs, doc, parent) => {\n if (attrs.rend && attrs.rend === \"italic\")\n return `<em>${doc.toHtml([null, ...children], parent)}</em>`;\n\n if (attrs.rend && attrs.rend === \"bold\")\n return `<strong>${doc.toHtml([null, ...children], parent)}</strong>`;\n\n if (attrs.rend && attrs.rend === \"sup\")\n return `<sup>${doc.toHtml([null, ...children], parent)}</sup>`;\n\n if (this.debug)\n // eslint-disable-next-line no-console\n console.log(\n `passing through tag: ${this.constructor.renderTag([\"hi\", attrs])}`\n );\n\n return `<span>${doc.toHtml([null, ...children], parent)}</span>`;\n },\n\n p: (children, attrs, doc, parent) => {\n return `<p>${doc.toHtml([null, ...children], parent)}</p>`;\n },\n\n note: (children, attrs /* doc, parent */) => {\n const { n: footnoteIndex, \"xml:id\": footnoteId } = attrs;\n return `<sup id=\"${footnoteId}:ref\"><a href=\"#${footnoteId}\">${footnoteIndex}</a></sup>`;\n },\n\n placeName: (children, attrs, doc, parent) => {\n if (this.debug && Object.keys(attrs).length)\n // eslint-disable-next-line no-console\n console.warn(\n `Unexpected attrs: ${this.constructor.renderTag([\n \"placeName\",\n attrs\n ])}`\n );\n return `<span class=\"place-name\">${doc.toHtml(\n [null, ...children],\n parent\n )}</span>`;\n },\n\n name: (children, attrs, doc, parent) => {\n return `<span data-type=\"${attrs.type}\" data-role=\"${\n attrs.role\n }\">${doc.toHtml([null, ...children], parent)}</span>`;\n },\n\n div: (children, attrs, doc, parent) => {\n const { type } = attrs;\n if (type === \"section\")\n return `<section>${doc.toHtml(\n [null, ...children],\n parent\n )}</section>`;\n\n if (this.debug)\n // eslint-disable-next-line no-console\n console.log(\n `passing through tag: ${this.constructor.renderTag([\"div\", attrs])}`\n );\n return doc.toHtml([null, ...children], parent);\n },\n\n head: (children, attrs, doc, parent) => {\n if (this.debug && Object.keys(attrs).length)\n // eslint-disable-next-line no-console\n console.warn(\n `Unexpected attrs: ${this.constructor.renderTag([\"head\", attrs])}`\n );\n\n return `<header>${doc.toHtml([null, ...children], parent)}</header>`;\n },\n\n figure: (children, attrs, doc /* parent */) => {\n const graphic = children.find(elem => elem[0] === \"graphic\");\n const head = children.find(elem => elem[0] === \"head\");\n return `\\\n <figure>\n <img src=\"${graphic[1].url}\" alt=\"\" />\n <figcaption>${doc.toHtml(\n [null, ...head.slice(1)],\n [\"figure\", attrs, ...children]\n )}</figcaption>\n </figure>`;\n },\n\n table: (children, attrs, doc, parent) => {\n return `<table>${doc.toHtml(\n [null, ...children],\n parent\n )}</table>`.replace(/>\\s+</g, \"><\");\n },\n\n row: (children, attrs, doc, parent) => {\n return `<tr>${doc.toHtml([null, ...children], parent)}</tr>`;\n },\n\n cell: (children, attrs, doc, parent) => {\n return `<td>${doc.toHtml([null, ...children], parent)}</td>`;\n },\n\n quote: (children, attrs, doc, parent) => {\n if (attrs.rend && attrs.rend === \"inline\") {\n return `“${doc.toHtml([null, ...children], parent)}”`;\n }\n return `<blockquote>${doc.toHtml(\n [null, ...children],\n parent\n )}</blockquote>`;\n }\n };\n\n // collect footnotes on class instantiation\n this.collectFootnotes();\n }\n\n collectFootnotes() {\n this.getElemsByName(\"note\").forEach(_footnote => {\n const footnote = [..._footnote];\n footnote.shift();\n const attrs = footnote[0] instanceof Object ? footnote.shift() : {};\n const { n: footnoteIndex, \"xml:id\": footnoteId } = attrs;\n this.footnotes[footnoteId] = {\n index: footnoteIndex,\n content: this.toHtml([null, ...footnote])\n };\n });\n }\n\n getFrontmatter() {\n return {\n title: this.getFirstTextContent(\"titleStmt/title\") || \"\",\n author: this.getFirstTextContent(\"titleStmt/author\") || \"\"\n };\n }\n\n getTitleHtml() {\n const titleElem = this.getElemByPath(\"titlePart\");\n return titleElem ? TeiDoc.markupChinese(this.toHtml(titleElem)) : \"\";\n }\n\n getAbstractHtml() {\n const abstractElem = this.getElemByPath(\"div[@type='abstract']\");\n return abstractElem ? TeiDoc.markupChinese(this.toHtml(abstractElem)) : \"\";\n }\n\n // eslint-disable-next-line class-methods-use-this\n getKeywords() {\n // TODO: add this method :)\n }\n\n getArticleBodyHtml() {\n const bodyElem = this.getElemByPath(\"div[@type='articleBody']\");\n return bodyElem\n ? TeiDoc.markupChinese(this.toHtml(bodyElem))\n : TeiDoc.markupChinese(this.toHtml(this.getElemByPath(\"body\")));\n }\n\n getFootnotesHtml() {\n const footnotesHtml = Object.entries(this.footnotes)\n .map(([id, footnote]) => `<li id=\"${id}\">${footnote.content}</li>`)\n .join(\"\");\n return TeiDoc.markupChinese(`<ol>${footnotesHtml}</ol>`);\n }\n\n getImagePaths() {\n return this.getElemsByName(\"graphic\").map(graphic => graphic[1].url);\n }\n\n static markupChinese(text) {\n const chineseUnicodeRanges = [\n \"[\\u4e00-\\u9fff]\", // CJK Unified Ideographs\n \"[\\u3400-\\u4dbf]\", // CJK Unified Ideographs Extension A\n \"[\\u{20000}-\\u{2a6df}]\", // CJK Unified Ideographs Extension B\n \"[\\u{2a700}-\\u{2b73f}]\", // CJK Unified Ideographs Extension C\n \"[\\u{2b740}-\\u{2b81f}]\", // CJK Unified Ideographs Extension D\n \"[\\u{2b820}-\\u{2ceaf}]\", // CJK Unified Ideographs Extension E\n \"[\\u{2ceb0}-\\u{2ebef}]\", // CJK Unified Ideographs Extension F\n \"[\\uf900-\\ufaff]\", // CJK Compatibility Ideographs\n \"[\\u3300-\\u33ff]\", // CJK Compatibility\n \"[\\ufe30-\\ufe4f]\", // CJK Compatibility Forms\n \"[\\u{2f800}-\\u{2fa1f}]\" // CJK Compatibility Ideographs Supplement\n ];\n\n const anyChineseRegex = new RegExp(\n `(?<chinese>(?:${chineseUnicodeRanges.join(\"|\")})+)`,\n \"ug\"\n );\n return text.replace(anyChineseRegex, '<span class=\"zh\">$<chinese></span>');\n }\n}\n\nexport default TeiDoc;\n","import React from \"react\";\n\nimport { post } from \"axios\";\n\nimport Layout from \"../components/layout\";\nimport Meta from \"../components/meta\";\n\nimport { ArticleBody, Footnotes } from \"../ui-components/article-elements\";\nimport {\n ControlsPanel,\n controlsTipStyles,\n ControlButton,\n ToggleButton\n} from \"../ui-components/proofing-elements\";\nimport Tooltip from \"../ui-components/tooltip\";\nimport LoadingSpinner from \"../ui-components/loading-spinner\";\n\nimport TeiDoc from \"../../plugins/gatsby-transformer-tei/tei\";\nimport TeiRenderer from \"../utils/tei-renderer\";\n\nconst ENTITY_TYPES = [\n [\"PERSON\", \"People, including fictional.\"],\n [\"NORP\", \"Nationalities or religious or political groups.\"],\n [\"FAC\", \"Buildings, airports, highways, bridges, etc.\"],\n [\"ORG\", \"Companies, agencies, institutions, etc.\"],\n [\"GPE\", \"Countries, cities, states.\"],\n [\"LOC\", \"Non-GPE locations, mountain ranges, bodies of water.\"],\n [\"PRODUCT\", \"Objects, vehicles, foods, etc. (Not services.)\"],\n [\"EVENT\", \"Named hurricanes, battles, wars, sports events, etc.\"],\n [\"WORK_OF_ART\", \"Titles of books, songs, etc.\"],\n [\"LAW\", \"Named documents made into laws.\"],\n [\"LANGUAGE\", \"Any named language.\"],\n [\"DATE\", \"Absolute or relative dates or periods.\"],\n [\"TIME\", \"Times smaller than a day.\"],\n [\"PERCENT\", \"Percentage, including ”%“.\"],\n [\"MONEY\", \"Monetary values, including unit.\"],\n [\"QUANTITY\", \"Measurements, as of weight or distance.\"],\n [\"ORDINAL\", \"“first”, “second”, etc.\"],\n [\"CARDINAL\", \"Numerals that do not fall under another type.\"]\n];\n\nclass ProofingPage extends React.Component {\n static sendFileForNerMarkup(file, model, include) {\n const url = process.env.NLP_API_ENDPOINT;\n const formData = new FormData();\n formData.append(\"xml\", file);\n formData.set(\"model\", model);\n formData.set(\"include\", include);\n const config = {\n headers: { \"content-type\": \"multipart/form-data\" }\n };\n return post(url, formData, config);\n }\n\n constructor(props) {\n super(props);\n this.state = {\n teiFile: null,\n teiXml: null,\n teiNode: null,\n loading: false\n };\n }\n\n onNewFile = event => {\n const teiFile = event.target.files[0];\n if (teiFile) {\n this.setState({ teiFile, loading: true }, () => this.readTeiFile());\n } else {\n this.reset();\n }\n };\n\n onNerSubmit = event => {\n event.preventDefault();\n const include = Array.from(event.target.include)\n .filter(elem => elem.checked)\n .map(elem => elem.value)\n .join(\"|\");\n this.setState({ loading: true });\n this.getMarkedUpTei(event.target.model.value, include);\n };\n\n onRenderClick = (/* event */) => this.readTeiFile();\n\n onClearClick = (/* event */) => this.reset();\n\n getMarkedUpTei(model, include) {\n const { teiFile } = this.state;\n ProofingPage.sendFileForNerMarkup(teiFile, model, include).then(\n response => {\n this.setState({ teiXml: response.data }, () => this.makeTeiNode());\n }\n );\n }\n\n reset() {\n this.setState({\n teiFile: null,\n teiXml: null,\n teiNode: null,\n loading: false\n });\n document.querySelector(\"input[name='input-file']\").value = null;\n }\n\n makeTeiNode() {\n const { teiXml } = this.state;\n const teiDoc = new TeiDoc(teiXml);\n const teiNode = {\n frontmatter: teiDoc.getFrontmatter(),\n titleHtml: teiDoc.getTitleHtml(),\n abstractHtml: teiDoc.getAbstractHtml(),\n articleBodyHtml: teiDoc.getArticleBodyHtml(),\n footnotesHtml: teiDoc.getFootnotesHtml(),\n images: teiDoc.getImagePaths()\n };\n this.setState({ teiNode }, () => this.setState({ loading: false }));\n }\n\n readTeiFile() {\n const { teiFile } = this.state;\n if (teiFile) {\n const fileReader = new FileReader();\n fileReader.onloadend = (/* event */) => {\n this.setState({ teiXml: fileReader.result }, () => this.makeTeiNode());\n };\n fileReader.readAsText(teiFile);\n }\n }\n\n render() {\n const { teiFile, teiNode, loading } = this.state;\n const article = teiNode\n ? (() => {\n const teiRenderer = new TeiRenderer(teiNode);\n return (\n <>\n <ArticleBody>{teiRenderer.articleBody()}</ArticleBody>\n <Footnotes>{teiRenderer.footnotes()}</Footnotes>\n </>\n );\n })()\n : \"\";\n return (\n <Layout>\n <Meta title=\"Proofing Page\" />\n {loading ? (\n <LoadingSpinner color={({ theme }) => theme.colors.main} />\n ) : (\n \"\"\n )}\n <ControlsPanel>\n <div>\n <input type=\"file\" name=\"input-file\" onChange={this.onNewFile} />\n {teiFile && !teiNode ? (\n <ControlButton type=\"button\" onClick={this.onRenderClick}>\n Re-Render\n </ControlButton>\n ) : (\n \"\"\n )}\n {teiNode ? (\n <ControlButton type=\"button\" onClick={this.onClearClick}>\n Clear\n </ControlButton>\n ) : (\n \"\"\n )}\n </div>\n {teiNode ? (\n <>\n <ToggleButton\n onClick={event => {\n event.target.classList.toggle(\"shown\");\n }}>\n NER Tools\n </ToggleButton>\n <form onSubmit={this.onNerSubmit}>\n <div>\n <fieldset>\n <legend>Model</legend>\n <Tooltip\n placement=\"right\"\n tipContent=\"English multi-task CNN trained on OntoNotes v5 (~160mb RAM on server).\"\n tipStyles={controlsTipStyles}>\n <label htmlFor=\"en_core_web_sm\">\n <input\n type=\"radio\"\n name=\"model\"\n id=\"en_core_web_sm\"\n value=\"en_core_web_sm\"\n defaultChecked\n />\n en_core_web_sm\n </label>\n </Tooltip>\n <Tooltip\n placement=\"right\"\n tipContent=\"English multi-task CNN trained on OntoNotes v5, with GloVe vectors trained on Common Crawl. (~1.4Gb RAM on server).\"\n tipStyles={controlsTipStyles}>\n <label htmlFor=\"en_core_web_lg\">\n <input\n type=\"radio\"\n name=\"model\"\n id=\"en_core_web_lg\"\n value=\"en_core_web_lg\"\n />\n en_core_web_lg\n </label>\n </Tooltip>\n </fieldset>\n <fieldset>\n <legend>Include</legend>\n {ENTITY_TYPES.map(([entityType, entityDesc]) => (\n <div key={entityType}>\n <Tooltip\n placement=\"right\"\n tipContent={entityDesc}\n tipStyles={controlsTipStyles}>\n <label htmlFor={entityType}>\n <input\n type=\"checkbox\"\n name=\"include\"\n id={entityType}\n value={entityType}\n defaultChecked\n />\n {entityType}\n </label>\n </Tooltip>\n </div>\n ))}\n <div>\n <ControlButton\n type=\"button\"\n onClick={event =>\n Array.from(event.target.form.include).forEach(\n checkbox => {\n const cb = checkbox;\n cb.checked = true;\n }\n )\n }>\n Select All\n </ControlButton>\n <ControlButton\n type=\"button\"\n onClick={event =>\n Array.from(event.target.form.include).forEach(\n checkbox => {\n const cb = checkbox;\n cb.checked = false;\n }\n )\n }>\n Select None\n </ControlButton>\n </div>\n </fieldset>\n </div>\n <div>\n <Tooltip\n tipContent=\"Send document for NER markup and render result.\"\n tipStyles={controlsTipStyles}>\n <ControlButton type=\"submit\">Markup Entities</ControlButton>\n </Tooltip>\n </div>\n </form>\n </>\n ) : (\n \"\"\n )}\n </ControlsPanel>\n {article}\n </Layout>\n );\n }\n}\n\nexport default ProofingPage;\n","var React = require('react');\n\nfunction ApilsLogoMin (props) {\n return React.createElement(\"svg\",props,React.createElement(\"g\",{\"transform\":\"translate(-107.99891,-130.56452) matrix(0.35277777,0,0,-0.35277777,135.80385,143.10444)\"},React.createElement(\"path\",{\"d\":\"m 0,0 c -1.842,-2.212 -4.22,-3.436 -6.694,-3.45 h -0.039 c -2.458,0 -4.829,1.198 -6.681,3.376 l -6.681,7.855 c -2.467,2.9 -5.717,4.496 -9.154,4.496 -3.427,0 -6.673,-1.596 -9.14,-4.496 l -6.68,-7.855 c -1.853,-2.178 -4.224,-3.376 -6.682,-3.376 h -0.039 c -2.474,0.014 -4.851,1.238 -6.689,3.446 l -0.247,0.296 18.808,24.817 c 2.343,3.086 5.33,5.05 8.596,5.671 0.472,0.081 0.944,0.133 1.377,0.17 0.469,0.027 0.954,0.023 1.353,0.005 0.466,-0.042 0.932,-0.094 1.376,-0.168 3.319,-0.633 6.31,-2.595 8.649,-5.675 L 0.233,0.284 Z M 18.018,12.46 C 13.68,12.408 9.602,10.663 6.226,7.414 6.164,7.355 6.106,7.292 6.051,7.225 L 3.294,3.901 -14.876,27.878 c -3.028,3.981 -7.116,6.613 -11.534,7.412 -0.596,0.102 -1.193,0.172 -1.912,0.231 -0.157,0.008 -0.305,0.014 -0.452,0.018 -0.441,0.014 -0.875,0.009 -1.527,-0.027 -0.596,-0.05 -1.192,-0.12 -1.812,-0.226 -0.002,0 -0.004,-0.001 -0.006,-0.001 -0.004,-10e-4 -0.009,-10e-4 -0.014,-0.002 -0.064,-0.012 -0.125,-0.033 -0.188,-0.046 -4.355,-0.846 -8.26,-3.38 -11.304,-7.364 L -61.778,3.902 -64.534,7.225 c -0.056,0.067 -0.114,0.13 -0.175,0.189 -3.376,3.249 -7.454,4.994 -11.793,5.046 -1.298,0.062 -2.3,-0.996 -2.315,-2.26 -0.015,-1.263 0.997,-2.3 2.26,-2.315 3.116,-0.037 6.082,-1.309 8.585,-3.682 l 4.527,-5.441 c 0.066,-0.079 0.145,-0.142 0.22,-0.211 l 1.226,-1.479 c 2.721,-3.267 6.338,-5.076 10.185,-5.097 h 0.065 c 3.82,0 7.428,1.769 10.165,4.987 l 6.68,7.855 c 1.583,1.86 3.591,2.885 5.655,2.885 2.073,0 4.086,-1.025 5.669,-2.885 l 6.68,-7.855 c 2.737,-3.218 6.344,-4.987 10.166,-4.987 h 0.064 c 3.847,0.021 7.465,1.83 10.197,5.112 l 1.16,1.415 c 0.096,0.082 0.192,0.162 0.274,0.26 l 4.527,5.441 c 2.503,2.373 5.47,3.645 8.585,3.682 1.263,0.015 2.275,1.052 2.261,2.315 -0.015,1.264 -1.088,2.298 -2.316,2.26\"})));\n}\n\nApilsLogoMin.defaultProps = {\"version\":\"1.1\",\"viewBox\":\"0 0 34.978378 15.370958\"};\n\nmodule.exports = ApilsLogoMin;\n\nApilsLogoMin.default = ApilsLogoMin;\n","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAQAAAAD+Fb1AAAAGklEQVR4AWN6WgaBTAzPIJDp/xsIZGL4CoEAcqcUjTsQ+dQAAAAASUVORK5CYII=\"","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport Helmet from \"react-helmet\";\nimport { injectIntl } from \"gatsby-plugin-intl\";\nimport { intlShape } from \"react-intl\";\n\nfunction Meta({ description, meta, title, intl }) {\n const metaDescription =\n description || intl.formatMessage({ id: \"description\" });\n\n return (\n <Helmet\n htmlAttributes={{ lang: intl.locale }}\n title={title}\n titleTemplate={`%s | ${intl.formatMessage({ id: \"title\" })}`}\n meta={[\n {\n name: `description`,\n content: metaDescription\n },\n {\n property: `og:title`,\n content: title\n },\n {\n property: `og:description`,\n content: metaDescription\n },\n {\n property: `og:type`,\n content: `website`\n },\n {\n name: `twitter:card`,\n content: `summary`\n },\n {\n name: `twitter:creator`,\n content: intl.formatMessage({ id: \"author\" })\n },\n {\n name: `twitter:title`,\n content: title\n },\n {\n name: `twitter:description`,\n content: metaDescription\n }\n ].concat(meta)}\n />\n );\n}\n\nMeta.defaultProps = {\n meta: [],\n description: ``\n};\n\nMeta.propTypes = {\n description: PropTypes.string,\n meta: PropTypes.arrayOf(PropTypes.object),\n title: PropTypes.string.isRequired,\n intl: intlShape.isRequired\n};\n\nexport default injectIntl(Meta);\n","import Typography from \"typography\";\nimport deYoungTheme from \"typography-theme-de-young\";\n\ndeYoungTheme.headerFontFamily = [\n \"Alegreya Sans\",\n \"KaiTi\",\n \"楷体\",\n \"STKaiti\",\n \"华文楷体\"\n];\ndeYoungTheme.bodyFontFamily = [\n \"Alegreya\",\n \"Microsoft YaHei New\",\n \"Microsoft Yahei\",\n \"微软雅黑\",\n \"宋体\",\n \"SimHei\",\n \"STXihei\",\n \"华文细黑\"\n];\n// deYoungTheme.baseFontSize = \"8px\";\nconst typography = new Typography(deYoungTheme);\n\nexport const { scale, rhythm, options } = typography;\nexport default typography;\n","import { options, rhythm, scale } from \"./typography\";\n\nexport default {\n // main: \"hsl(230, 55%, 58%)\"\n colors: {\n main: \"#508084\",\n mainAlt: \"ghostwhite\",\n pageBg: \"white\",\n highlight: \"#f4ff99\",\n bodyText: options.bodyColor,\n headerText: options.headerColor\n },\n\n fonts: {\n body: options.bodyFontFamily.map(typeface => `\"${typeface}\"`).join(\",\"),\n header: options.headerFontFamily.map(typeface => `\"${typeface}\"`).join(\",\")\n },\n\n rhythm,\n scale,\n\n contentMaxWidth: \"960px\",\n contentOverhang: \"20px\",\n\n pageShadow: `\n position: relative;\n\n &::before,\n &::after {\n border-radius: 100px / 10px;\n bottom: 10px;\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);\n content: \"\";\n left: 0;\n position: absolute;\n right: 0;\n top: 10px;\n z-index: -1;\n }\n\n &::after {\n left: auto;\n right: 10px;\n transform: skew(8deg) rotate(3deg);\n }\n `\n};\n","// Note: using typography.js includes normalize.css by default, unless\n// the option to disable it is explicitly invoked.\n\nimport { createGlobalStyle } from \"styled-components\";\n\nexport default createGlobalStyle`\n\n html, body, #___gatsby {\n height: 100%;\n }\n\n div[role=\"group\"][tabindex] {\n height: 100%;\n }\n\n body {\n padding: 0;\n margin: 0;\n background: cadetblue;\n\n &::before {\n box-shadow: 0 0 10px rgba(0,0,0,.8);\n content: \"\";\n height: 10px;\n left: 0;\n position: fixed;\n top: -10px;\n width: 100%;\n z-index: 100;\n }\n }\n\n a {\n color: ${props => props.theme.colors.main};\n }\n`;\n","import React from \"react\";\nimport { IntlContextConsumer, changeLocale } from \"gatsby-plugin-intl\";\nimport styled from \"styled-components\";\n\nconst languageName = {\n en: \"English\",\n zh: \"中文\"\n};\n\nconst Container = styled.div`\n position: absolute;\n top: 40px;\n right: 10px;\n`;\n\nconst LanguageButton = styled.button`\n background: none;\n border: none;\n color: ${props => (props.activeLocale ? \"yellow\" : \"white\")};\n cursor: pointer;\n margin: 10;\n`;\n\nconst LanguageSwitcher = () => {\n return (\n <Container>\n <IntlContextConsumer>\n {({ languages, language: currentLocale }) =>\n languages.map(language => (\n <LanguageButton\n type=\"button\"\n key={language}\n onClick={() => changeLocale(language === \"en\" ? \"\" : language)}\n activeLocale={currentLocale === language}>\n {languageName[language]}\n </LanguageButton>\n ))\n }\n </IntlContextConsumer>\n </Container>\n );\n};\n\nexport default LanguageSwitcher;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport Helmet from \"react-helmet\";\nimport styled, { ThemeProvider } from \"styled-components\";\nimport { injectIntl, Link } from \"gatsby-plugin-intl\";\nimport { intlShape } from \"react-intl\";\n\nimport ApilsTheme from \"../theme/apils-theme\";\nimport GlobalStyle from \"../theme/global-style\";\n\nimport LanguageSwitcher from \"./language-switcher\";\n\nimport ApilsLogo from \"../images/apils_logo.min.svg\";\nimport bgImage from \"../images/simple-horizontal-light.png\";\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n min-height: 100%;\n overflow: hidden;\n\n main {\n ${({ theme }) => theme.pageShadow}\n background: ${({ theme }) => theme.colors.pageBg};\n background-image: url(${bgImage});\n border-radius: 0 0 8px 0;\n flex-grow: 1;\n margin: ${props => `-${props.theme.contentOverhang}`} auto 0;\n max-width: ${({ theme }) => theme.contentMaxWidth};\n padding: ${({ theme: { rhythm } }) =>\n `${rhythm(2)} ${rhythm(4)} ${rhythm(2 / 3)}`};\n width: 100%;\n }\n`;\n\nconst Header = styled.header`\n background: rgba(0, 0, 0, 0.8);\n border-bottom: 1px solid ${({ theme }) => theme.colors.main};\n display: flex;\n padding-bottom: ${({ theme }) => theme.contentOverhang};\n\n > div {\n flex-grow: 1;\n margin: 0 auto;\n max-width: ${({ theme }) => theme.contentMaxWidth};\n position: relative;\n }\n`;\n\nconst Branding = styled.div`\n display: flex;\n flex-direction: row-reverse;\n margin-bottom: ${({ theme }) => theme.rhythm(1 / 3)};\n align-items: center;\n\n > div {\n flex-grow: 1;\n }\n\n h1 {\n margin-bottom: 0;\n }\n\n h2 {\n ${({ theme }) => theme.scale(0.5)};\n color: ${({ theme }) => theme.colors.mainAlt};\n margin-bottom: ${({ theme }) => theme.rhythm(1 / 8)};\n margin-top: 0;\n }\n\n svg {\n fill: ${({ theme }) => theme.colors.main};\n margin: 5px 20px 5px 0;\n width: 100px;\n }\n`;\n\nconst Naivgation = styled.nav`\n background: ${({ theme }) => theme.colors.main};\n border-radius: 0 8px 0 0;\n color: ${({ theme }) => theme.colors.mainAlt};\n font-family: ${({ theme }) => theme.fonts.header};\n\n ul {\n display: flex;\n margin: 0;\n }\n li {\n border-right: 1px solid rgba(255, 255, 255, 0.07);\n display: inline-block;\n list-style: none;\n margin-bottom: 0;\n text-align: center;\n\n a {\n color: ${({ theme }) => theme.colors.mainAlt};\n display: inline-block;\n padding: ${({ theme: { rhythm } }) =>\n `${rhythm(1 / 8)} ${rhythm(1 / 3)}`};\n transition: background-color 0.25s ease;\n\n &:hover,\n &.active {\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: none;\n }\n }\n }\n`;\n\nconst Footer = styled.footer`\n background: rgba(0, 0, 0, 0.7);\n color: ${({ theme }) => theme.colors.mainAlt};\n padding-top: ${({ theme }) => theme.contentOverhang};\n margin-top: -${({ theme }) => theme.contentOverhang};\n\n > div {\n margin: 0 auto;\n max-width: ${({ theme }) => theme.contentMaxWidth};\n line-height: 50px;\n text-align: right;\n }\n`;\n\nconst Layout = ({ children, intl }) => {\n return (\n <>\n <Helmet>\n <link\n rel=\"preconnect\"\n href=\"https://fonts.googleapis.com\"\n crossOrigin\n />\n </Helmet>\n <ThemeProvider theme={ApilsTheme}>\n <>\n <GlobalStyle />\n <Container>\n <Header>\n <div>\n <Branding>\n <div>\n <h1>\n <Link to=\"/\">{intl.formatMessage({ id: \"title\" })}</Link>\n </h1>\n <h2>{intl.formatMessage({ id: \"subtitle\" })}</h2>\n </div>\n <ApilsLogo />\n </Branding>\n <Naivgation>\n <ul>\n <li>\n <Link to=\"/\" activeClassName=\"active\">\n {intl.formatMessage({ id: \"nav.home\" })}\n </Link>\n </li>\n <li>\n <Link to=\"/about/\" activeClassName=\"active\">\n {intl.formatMessage({ id: \"nav.about\" })}\n </Link>\n </li>\n <li>\n <Link to=\"/volumes/\" activeClassName=\"active\">\n {intl.formatMessage({ id: \"nav.volumes\" })}\n </Link>\n </li>\n <li>\n <Link to=\"/submissions/\" activeClassName=\"active\">\n {intl.formatMessage({ id: \"nav.submissions\" })}\n </Link>\n </li>\n <li>\n <Link to=\"/article/\" activeClassName=\"active\">\n {intl.formatMessage({ id: \"nav.article\" })}\n </Link>\n </li>\n </ul>\n </Naivgation>\n <LanguageSwitcher />\n </div>\n </Header>\n <main>{children}</main>\n <Footer>\n <div>© {new Date().getFullYear()}, APILS</div>\n </Footer>\n </Container>\n </>\n </ThemeProvider>\n </>\n );\n};\n\nLayout.propTypes = {\n children: PropTypes.node.isRequired,\n intl: intlShape.isRequired\n};\n\nexport default injectIntl(Layout);\n","// Look out for errors when wrapping styled-components?\n// - https://github.com/FezVrasta/react-popper/issues/267\n// TODO:\n// * allow click-to-trigger?\n\nimport React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\nimport styled, { css } from \"styled-components\";\nimport { Manager, Reference, Popper } from \"react-popper\";\n\nconst color = \"rgba(0, 0, 0, 0.8)\";\n\nconst Tip = styled.output`\n background: ${color};\n border-color: ${color};\n border-radius: 6px;\n color: white;\n\n ${props =>\n props.customStyles\n ? css`\n ${props.customStyles}\n `\n : \"\"}\n`;\n\nconst Arrow = styled.span`\n border-color: inherit;\n border-style: solid;\n height: 0;\n position: absolute;\n width: 0;\n\n &[data-placement=\"top\"] {\n border-bottom-color: transparent;\n border-left-color: transparent;\n border-right-color: transparent;\n border-width: 5px 5px 0 5px;\n bottom: -5px;\n left: calc(50% - 5px);\n margin: 0 5px;\n }\n\n &[data-placement=\"bottom\"] {\n border-left-color: transparent;\n border-right-color: transparent;\n border-top-color: transparent;\n border-width: 0 5px 5px 5px;\n left: calc(50% - 5px);\n margin: 0 5px;\n top: -5px;\n }\n\n &[data-placement=\"right\"] {\n border-bottom-color: transparent;\n border-left-color: transparent;\n border-top-color: transparent;\n border-width: 5px 5px 5px 0;\n left: -5px;\n margin: 5px 0;\n top: calc(50% - 5px);\n }\n\n &[data-placement=\"left\"] {\n border-bottom-color: transparent;\n border-right-color: transparent;\n border-top-color: transparent;\n border-width: 5px 0 5px 5px;\n margin: 5px 0;\n right: -5px;\n top: calc(50% - 5px);\n }\n\n ${props =>\n props.customStyles\n ? css`\n ${props.customStyles}\n `\n : \"\"}\n`;\n\nclass Tooltip extends Component {\n constructor(props) {\n super(props);\n this.state = { shown: false };\n }\n\n render() {\n const {\n arrowStyles,\n children,\n placement: preferredPlacement,\n tipContent,\n tipStyles\n } = this.props;\n const { shown } = this.state;\n return (\n <Manager>\n <Reference>\n {({ ref }) =>\n React.isValidElement(children) ? (\n React.cloneElement(children, {\n ref,\n onMouseEnter: () => this.setState({ shown: true }),\n onMouseLeave: () => this.setState({ shown: false })\n })\n ) : (\n <span\n ref={ref}\n onMouseEnter={() => this.setState({ shown: true })}\n onMouseLeave={() => this.setState({ shown: false })}>\n {children}\n </span>\n )\n }\n </Reference>\n <Popper placement={preferredPlacement} positionFixed>\n {({ ref, style, placement, arrowProps }) => {\n if (!shown) return null;\n return (\n <Tip\n customStyles={tipStyles}\n data-placement={placement}\n ref={ref}\n style={style}\n onMouseEnter={() => this.setState({ shown: true })}\n onMouseLeave={() => this.setState({ shown: false })}>\n {typeof tipContent === \"function\" ? tipContent() : tipContent}\n <Arrow\n customStyles={arrowStyles}\n data-placement={placement}\n ref={arrowProps.ref}\n style={arrowProps.style}\n />\n </Tip>\n );\n }}\n </Popper>\n </Manager>\n );\n }\n}\n\nTooltip.defaultProps = {\n arrowStyles: \"\",\n placement: \"top\",\n tipStyles: \"\"\n};\n\nTooltip.propTypes = {\n arrowStyles: PropTypes.string,\n children: PropTypes.node.isRequired,\n placement: PropTypes.string,\n tipContent: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node,\n PropTypes.string,\n PropTypes.func\n ]).isRequired,\n tipStyles: PropTypes.oneOfType([PropTypes.string, PropTypes.array])\n};\n\nexport { Tip };\nexport default Tooltip;\n","import styled, { css } from \"styled-components\";\nimport { lighten, transparentize } from \"polished\";\n\nconst footnoteTipStyles = css`\n ${({ theme }) => theme.scale(-0.3)};\n background: ${({ theme }) => transparentize(0.05, theme.colors.main)};\n border-color: ${({ theme }) => transparentize(0.05, theme.colors.main)};\n font-family: ${({ theme }) => theme.fonts.body};\n font-style: normal;\n max-width: 20rem;\n padding: 0.5rem 1rem;\n z-index: 2;\n\n a[href^=\"#ftn\"] {\n display: none;\n }\n\n p {\n margin-bottom: ${({ theme }) => theme.rhythm(1 / 2)};\n &:last-of-type {\n margin-bottom: 0;\n }\n }\n`;\n\nconst Abstract = styled.blockquote`\n ${({ theme }) => theme.scale(-0.1)}\n font-family: ${({ theme }) => theme.fonts.header};\n margin: ${({ theme: { rhythm } }) =>\n `${rhythm(1)} ${rhythm(2)} ${rhythm(1)} ${rhythm(1)}`};\n text-align: justify;\n\n em,\n span.zh {\n font-style: normal;\n }\n`;\n\nconst ArticleBody = styled.div`\n ${({ theme }) => theme.scale(0)};\n\n header {\n ${({ theme }) => theme.scale(0.5)};\n font-family: ${({ theme }) => theme.fonts.header};\n margin: ${({ theme }) => theme.rhythm(2 / 3)} 0;\n }\n\n figure {\n border: 1px solid ${({ theme }) => theme.colors.bodyText};\n border-radius: 5px;\n display: inline-block;\n margin: 0 0.5%;\n max-width: 48%;\n padding: ${({ theme }) => theme.rhythm(1 / 5)};\n\n img {\n margin-bottom: 0;\n }\n\n figcaption {\n background: ${({ theme }) => lighten(0.4, theme.colors.main)};\n font-family: ${({ theme }) => theme.fonts.header};\n ${({ theme }) => theme.scale(-0.2)};\n padding: ${({ theme }) => theme.rhythm(1 / 5)};\n }\n }\n\n table {\n ${({ theme }) => theme.scale(-0.1)};\n font-family: ${({ theme }) => theme.fonts.header};\n\n tr:nth-child(odd) {\n background: #eaeaea;\n }\n\n tr:first-child {\n background: ${({ theme }) => lighten(0.4, theme.colors.main)};\n font-weight: bold;\n }\n\n td {\n padding: ${({ theme: { rhythm } }) =>\n `${rhythm(1 / 6)} ${rhythm(1 / 3)}`};\n\n &[colspan=\"100%\"] {\n text-align: center;\n }\n }\n }\n\n blockquote {\n border: none;\n margin: ${({ theme: { rhythm } }) => `0 ${rhythm(1)} ${rhythm(1)}`};\n padding: 0;\n\n span.zh {\n font-style: normal;\n }\n }\n`;\n\nconst Footnotes = styled.div`\n ${({ theme }) => theme.scale(-0.2)};\n border-top: 1px solid #000;\n color: rgba(0, 0, 0, 0.6);\n margin-top: ${({ theme }) => theme.rhythm(2)};\n padding-top: ${({ theme }) => theme.rhythm(2 / 3)};\n\n li:target {\n background-color: ${({ theme }) => theme.colors.highlight};\n border: 8px solid ${({ theme }) => theme.colors.highlight};\n color: ${({ theme }) => theme.colors.bodyText};\n }\n`;\n\nexport { Abstract, ArticleBody, Footnotes, footnoteTipStyles };\n","import styled, { css } from \"styled-components\";\nimport { lighten } from \"polished\";\nimport { Tip } from \"./tooltip\";\n\nconst ToggleButton = styled.button`\n background: none;\n border: none;\n margin: 1em 0 0;\n\n &::before {\n color: ${({ theme }) => theme.colors.main};\n content: \"⧐\";\n display: inline-block;\n margin-right: 4px;\n transition: transform 0.5s ease;\n }\n\n &.shown {\n &::before {\n transform: rotate(90deg);\n }\n }\n`;\n\nconst ControlsPanel = styled.div`\n background: #eaeaea;\n margin: 10px;\n padding: 10px;\n ${({ theme }) => theme.scale(-0.3)};\n ${\"\" /* font-family: ${({ theme }) => theme.fonts.header}; */}\n font-family: \"Source Sans Pro\", sans-serif;\n overflow: hidden;\n\n div {\n display: flex;\n align-items: center;\n }\n\n ${ToggleButton}.shown + form {\n height: 650px;\n }\n\n form {\n transition: height 0.5s ease;\n overflow: hidden;\n height: 0;\n padding: 0;\n margin-bottom: 0;\n\n div {\n align-items: start;\n }\n }\n\n fieldset {\n display: flex;\n flex: 1 0 auto;\n padding: 0 2em 1em;\n margin: 0 1em 1em;\n\n div:last-child {\n margin-top: 1em;\n }\n }\n\n input[type=\"checkbox\"],\n input[type=\"radio\"] {\n margin-right: 5px;\n }\n\n input[type=\"file\"] {\n flex-grow: 1;\n line-height: 1.2;\n }\n\n label {\n cursor: pointer;\n padding-right: 10px;\n }\n`;\n\nconst controlsTipStyles = css`\n ${({ theme }) => theme.scale(-0.3)};\n background: black;\n color: white;\n font-style: normal;\n line-height: 1.5;\n max-width: 20rem;\n padding: 0 8px;\n z-index: 2;\n`;\n\nconst ControlButton = styled.button`\n background: ${({ theme }) => theme.colors.main};\n color: white;\n\n border: 0;\n border-radius: 3px;\n margin: 0 4px;\n\n line-height: 1.2;\n cursor: pointer;\n\n &:hover {\n background: ${({ theme }) => lighten(0.1, theme.colors.main)};\n }\n`;\n\nconst entityTipStyles = css`\n ${({ theme }) => theme.scale(-0.5)};\n background: #eaeaea;\n border: 1px solid darkgrey;\n color: black;\n font-family: sans-serif;\n font-style: normal;\n max-width: 20rem;\n padding: 0.1rem 0.5rem;\n z-index: 2;\n`;\n\nconst NamedEntity = styled.span`\n ${({ theme }) => theme.scale(-0.4)}\n font-family: sans-serif;\n font-style: normal;\n display: inline-block;\n padding: 0 4px;\n border-radius: 5px;\n position: relative;\n background-color: ${props =>\n (props.type === \"GPE\" && \"lightblue\") ||\n (props.type === \"LOC\" && \"thistle\") ||\n (props.type === \"ORG\" && \"darkseagreen\") ||\n (props.type === \"NORP\" && \"darkkhaki\") ||\n (props.type === \"PERSON\" && \"lightsteelblue\") ||\n \"lightgrey\"};\n padding-right: ${props => props.type.length * 7 + 18}px;\n line-height: 1rem;\n\n ${Tip} & {\n color: black;\n }\n\n &::after {\n ${({ theme }) => theme.scale(-1)}\n content: '${props => props.type}';\n background: #eaeaea;\n border-radius: 2px;\n display: inline-block;\n margin: 4px;\n line-height: 1.1;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-73%);\n padding: 3px 4px;\n }\n`;\n\nexport {\n ControlsPanel,\n controlsTipStyles,\n ToggleButton,\n ControlButton,\n NamedEntity,\n entityTipStyles\n // FileInput\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport styled from \"styled-components\";\n\nconst SectionDividerContainer = styled.div`\n display: table;\n font-size: 24px;\n text-align: center;\n width: 75%;\n margin: 40px auto;\n height: 10px;\n\n span {\n display: table-cell;\n position: relative;\n\n &:first-child,\n &:last-child {\n width: 50%;\n top: 13px;\n background-size: 100% 2px;\n background-position: 0 0, 0 100%;\n background-repeat: no-repeat;\n }\n\n &:first-child {\n background-image: linear-gradient(\n 90deg,\n transparent,\n ${props => props.customColor}\n );\n }\n\n &:last-child {\n background-image: linear-gradient(\n 90deg,\n ${props => props.customColor},\n transparent\n );\n }\n }\n`;\n\nfunction SectionDivider(props) {\n const { color } = props;\n return (\n <SectionDividerContainer customColor={color}>\n <span />\n <span />\n </SectionDividerContainer>\n );\n}\n\nSectionDivider.propTypes = {\n color: PropTypes.oneOfType([PropTypes.string, PropTypes.func])\n};\nSectionDivider.defaultProps = { color: \"black\" };\n\nexport default SectionDivider;\n","import React from \"react\";\nimport Parser, { domToReact } from \"html-react-parser\";\n\nimport SectionDivider from \"../ui-components/section-divider\";\nimport Tooltip from \"../ui-components/tooltip\";\nimport { footnoteTipStyles } from \"../ui-components/article-elements\";\nimport {\n NamedEntity,\n entityTipStyles\n} from \"../ui-components/proofing-elements\";\n\nclass TeiRenderer {\n constructor(teiDoc) {\n this.teiDoc = teiDoc;\n\n this.parserOptions = {\n /* domNode = {\n type: 'tag',\n name: 'br',\n attribs: {},\n children: [],\n next: null,\n prev: null,\n parent: null } */\n\n replace: domNode => {\n if (domNode.name === \"section\")\n return (\n <>\n {/* eslint-disable-next-line no-use-before-define */}\n <section>{this.domToReactWithReplace(domNode.children)}</section>\n <SectionDivider color={({ theme }) => theme.colors.main} />\n </>\n );\n\n if (domNode.name === \"img\")\n return (\n <img\n src={\n this.teiDoc.images.find(img =>\n // ! hack, because when proofing the images haven't been processed by Gatsby / Sharp / whatever\n (img.relativePath || img).endsWith(domNode.attribs.src)\n ).publicURL\n }\n alt=\"\"\n />\n // <Img\n // fluid={\n // tei.images.find(img =>\n // img.relativePath.endsWith(domNode.attribs.src)\n // ).childImageSharp.fluid\n // }\n // alt=\"\"\n // />\n );\n\n if (domNode.name === \"a\" && /#ftn\\d+/.test(domNode.attribs.href)) {\n return (\n <Tooltip\n tipContent={() =>\n Parser(document.querySelector(domNode.attribs.href).innerHTML)\n }\n tipStyles={footnoteTipStyles}>\n <a href={domNode.attribs.href}>\n {/* eslint-disable-next-line no-use-before-define */}\n {this.domToReactWithReplace(domNode.children)}\n </a>\n </Tooltip>\n );\n }\n\n if (domNode.name === \"td\" && domNode.parent.children.length === 1) {\n // eslint-disable-next-line no-param-reassign\n domNode.attribs.colspan = \"100%\";\n }\n\n if (domNode.name === \"span\" && \"data-type\" in domNode.attribs) {\n return (\n <Tooltip\n tipContent={domNode.attribs[`data-role`]}\n tipStyles={entityTipStyles}>\n <NamedEntity type={domNode.attribs[`data-type`]}>\n {/* eslint-disable-next-line no-use-before-define */}\n {this.domToReactWithReplace(domNode.children)}\n </NamedEntity>\n </Tooltip>\n );\n }\n\n return false;\n }\n };\n\n this.footnotesParserOptions = {\n replace: domNode => {\n if (domNode.name === \"li\") {\n const content = this.domToReactWithReplace(domNode.children);\n if (\n typeof content === \"object\" &&\n typeof content[content.length - 1] === \"object\"\n ) {\n return (\n <li id={domNode.attribs.id}>\n {content}\n <p>\n {content.pop().props.children}\n <a href={`#${domNode.attribs.id}:ref`}>↩</a>\n </p>\n </li>\n );\n }\n return (\n <li id={domNode.attribs.id}>\n {content}\n <a href={`#${domNode.attribs.id}:ref`}>↩</a>\n </li>\n );\n }\n return false;\n }\n };\n }\n\n domToReactWithReplace = children => domToReact(children, this.parserOptions);\n\n title() {\n return Parser(this.teiDoc.titleHtml, this.parserOptions);\n }\n\n abstract() {\n return Parser(this.teiDoc.abstractHtml);\n }\n\n articleBody() {\n return Parser(this.teiDoc.articleBodyHtml, this.parserOptions);\n }\n\n footnotes() {\n return Parser(this.teiDoc.footnotesHtml, this.footnotesParserOptions);\n }\n}\n\nexport default TeiRenderer;\n","import sax from \"./sax\";\n\nconst JsonMlDoc = class {\n constructor(xmlString, debug = false) {\n this.debug = debug;\n this.renderToHtml = {};\n this.skipExprs = [];\n this.parse(xmlString);\n }\n\n parse(content) {\n const nodeStack = [];\n const encoding = \"UTF-8\";\n const parser = sax.parser(true, { xmlns: true });\n const data = Buffer.from(content, encoding);\n\n let node;\n let partial = \"\";\n\n parser.onopentag = ({ name, attributes = {} }) => {\n const newNode = [name];\n\n if (partial) {\n node.push(partial);\n partial = \"\";\n }\n\n if (Object.entries(attributes).length > 0) {\n newNode.push(\n Object.keys(attributes).reduce((acc, k) => {\n acc[k] = attributes[k].value;\n return acc;\n }, {})\n );\n }\n\n if (node) {\n node.push(newNode);\n nodeStack.push(node);\n }\n\n node = newNode;\n };\n\n parser.onclosetag = (/* name */) => {\n if (partial) {\n node.push(partial);\n partial = \"\";\n }\n\n if (nodeStack.length === 0) this.doc = node;\n\n node = nodeStack.pop();\n };\n\n parser.ontext = function _text(text) {\n const textContent = text.replace(/[\\r\\n\\t]*/, \"\");\n partial += textContent;\n };\n\n parser.write(data).close();\n // if (!parser.parse(data, true)) {\n // throw new Error(`Could not parse XML: ${parser.getError()}`);\n // }\n }\n\n getFirstTextContent(elemPath) {\n let elem = this.getElemByPath(elemPath);\n if (!elem) return \"\";\n elem = [...this.getElemByPath(elemPath)];\n elem.shift(); // drop the tag\n // return first element which is a string\n return elem.find(child => typeof child === \"string\");\n }\n\n getElemByName(elemName, parent = this.doc, condition = () => true) {\n return parent.reduce((accumulator, elem) => {\n if (accumulator) return accumulator;\n if (Array.isArray(elem)) {\n if (elem[0] === elemName && condition(elem)) return elem;\n return this.getElemByName(elemName, elem, condition);\n }\n return false;\n }, null);\n }\n\n getElemsByName(elemName, parent = this.doc, condition = () => true) {\n let matchedElems = [];\n parent.forEach(elem => {\n if (Array.isArray(elem)) {\n if (elem[0] === elemName && condition(elem)) {\n matchedElems.push(elem);\n } else {\n matchedElems = matchedElems.concat(\n this.getElemsByName(elemName, elem, condition)\n );\n }\n }\n });\n return matchedElems;\n }\n\n getElemByPath(elemPath) {\n // elemPath is an xPath-like expression, currently limited to descendant\n // selectors (i.e. tag/tag/tag) and attribute equality (tag[@attr='val'])\n // Missing (not necessarily todo...):\n // - distinguish prefixes (/, //, ./ -- root, anywhere, relative)\n // - more-or-less everything else\n let currentElem = this.doc;\n elemPath.split(\"/\").forEach(expr => {\n if (!expr) return;\n const { tag, attr, val } = this.constructor.parseExpr(expr);\n currentElem = this.getElemByName(\n tag,\n currentElem,\n attr && val ? elem => elem[1][attr] === val : () => true\n );\n });\n return currentElem;\n }\n\n toHtml(_elem = this.doc, parent = null) {\n const elem = [..._elem];\n const tag = elem.shift();\n const attrs = elem[0] instanceof Object ? elem.shift() : {};\n\n let newHtml = \"\";\n\n if (Object.keys(this.renderToHtml).includes(tag) && !this.skipElem(_elem)) {\n newHtml += this.renderToHtml[tag](elem, attrs, this, parent);\n } else {\n if (this.debug && tag !== null && !this.skipElem(_elem))\n // eslint-disable-next-line no-console\n console.log(\n `passing through tag: ${this.constructor.renderTag(_elem)}`\n );\n elem.forEach(child => {\n if (Array.isArray(child)) {\n newHtml += this.toHtml(child, _elem);\n } else if (typeof child === \"string\") {\n newHtml += child;\n }\n });\n }\n return newHtml.replace(/\\s+/g, \" \").trim();\n }\n\n skipElem(elem) {\n return this.skipExprs.some(expr =>\n this.constructor.elemMatchesExpr(elem, expr)\n );\n }\n\n static parseExpr(expr) {\n return /(?<tag>[^[]+)(?:\\[@(?<attr>[^=]+)=[\"'](?<val>[^'\"]+)[\"']\\])?/.exec(\n expr\n ).groups;\n }\n\n static elemMatchesExpr(elem, expr) {\n const { tag, attr, val } = this.parseExpr(expr);\n return elem[0] === tag && elem[1][attr] === val;\n }\n\n static renderTag(elem) {\n // convenience method for development/debugging\n const tag = elem[0];\n const attrsString =\n elem[1] instanceof Object\n ? ` ${Object.entries(elem[1])\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(\" \")}`\n : \"\";\n return `<${tag}${attrsString} />`;\n }\n};\n\nexport default JsonMlDoc;\n","// Based on: https://github.com/isaacs/sax-js\n/* eslint-disable */\nconst sax = {};\n\n// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\n// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\n// since that's the earliest that a buffer overrun could occur. This way, checks are\n// as rare as required, but as often as necessary to ensure never crossing this bound.\n// Furthermore, buffers are only tested at most once per write(), so passing a very\n// large string into write() might have undesirable effects, but this is manageable by\n// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme\n// edge case, result in creating at most one complete copy of the string passed in.\n// Set to Infinity to have unlimited buffers.\nsax.MAX_BUFFER_LENGTH = 64 * 1024;\n\nvar buffers = [\n \"comment\",\n \"sgmlDecl\",\n \"textNode\",\n \"tagName\",\n \"doctype\",\n \"procInstName\",\n \"procInstBody\",\n \"entity\",\n \"attribName\",\n \"attribValue\",\n \"cdata\",\n \"script\"\n];\n\nsax.EVENTS = [\n \"text\",\n \"processinginstruction\",\n \"sgmldeclaration\",\n \"doctype\",\n \"comment\",\n \"opentagstart\",\n \"attribute\",\n \"opentag\",\n \"closetag\",\n \"opencdata\",\n \"cdata\",\n \"closecdata\",\n \"error\",\n \"end\",\n \"ready\",\n \"script\",\n \"opennamespace\",\n \"closenamespace\"\n];\n\nfunction SAXParser(strict, opt) {\n if (!(this instanceof SAXParser)) {\n return new SAXParser(strict, opt);\n }\n\n var parser = this;\n clearBuffers(parser);\n parser.q = parser.c = \"\";\n parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH;\n parser.opt = opt || {};\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;\n parser.looseCase = parser.opt.lowercase ? \"toLowerCase\" : \"toUpperCase\";\n parser.tags = [];\n parser.closed = parser.closedRoot = parser.sawRoot = false;\n parser.tag = parser.error = null;\n parser.strict = !!strict;\n parser.noscript = !!(strict || parser.opt.noscript);\n parser.state = S.BEGIN;\n parser.strictEntities = parser.opt.strictEntities;\n parser.ENTITIES = parser.strictEntities\n ? Object.create(sax.XML_ENTITIES)\n : Object.create(sax.ENTITIES);\n parser.attribList = [];\n\n // namespaces form a prototype chain.\n // it always points at the current tag,\n // which protos to its parent tag.\n if (parser.opt.xmlns) {\n parser.ns = Object.create(rootNS);\n }\n\n // mostly just for error reporting\n parser.trackPosition = parser.opt.position !== false;\n if (parser.trackPosition) {\n parser.position = parser.line = parser.column = 0;\n }\n emit(parser, \"onready\");\n}\n\nif (!Object.create) {\n Object.create = function(o) {\n function F() {}\n F.prototype = o;\n var newf = new F();\n return newf;\n };\n}\n\nif (!Object.keys) {\n Object.keys = function(o) {\n var a = [];\n for (var i in o) if (o.hasOwnProperty(i)) a.push(i);\n return a;\n };\n}\n\nfunction checkBufferLength(parser) {\n var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10);\n var maxActual = 0;\n for (var i = 0, l = buffers.length; i < l; i++) {\n var len = parser[buffers[i]].length;\n if (len > maxAllowed) {\n // Text/cdata nodes can get big, and since they're buffered,\n // we can get here under normal conditions.\n // Avoid issues by emitting the text node now,\n // so at least it won't get any bigger.\n switch (buffers[i]) {\n case \"textNode\":\n closeText(parser);\n break;\n\n case \"cdata\":\n emitNode(parser, \"oncdata\", parser.cdata);\n parser.cdata = \"\";\n break;\n\n case \"script\":\n emitNode(parser, \"onscript\", parser.script);\n parser.script = \"\";\n break;\n\n default:\n error(parser, \"Max buffer length exceeded: \" + buffers[i]);\n }\n }\n maxActual = Math.max(maxActual, len);\n }\n // schedule the next check for the earliest possible buffer overrun.\n var m = sax.MAX_BUFFER_LENGTH - maxActual;\n parser.bufferCheckPosition = m + parser.position;\n}\n\nfunction clearBuffers(parser) {\n for (var i = 0, l = buffers.length; i < l; i++) {\n parser[buffers[i]] = \"\";\n }\n}\n\nfunction flushBuffers(parser) {\n closeText(parser);\n if (parser.cdata !== \"\") {\n emitNode(parser, \"oncdata\", parser.cdata);\n parser.cdata = \"\";\n }\n if (parser.script !== \"\") {\n emitNode(parser, \"onscript\", parser.script);\n parser.script = \"\";\n }\n}\n\nSAXParser.prototype = {\n end: function() {\n end(this);\n },\n write: write,\n resume: function() {\n this.error = null;\n return this;\n },\n close: function() {\n return this.write(null);\n },\n flush: function() {\n flushBuffers(this);\n }\n};\n\nvar Stream;\ntry {\n Stream = require(\"stream\").Stream;\n} catch (ex) {\n Stream = function() {};\n}\n\nvar streamWraps = sax.EVENTS.filter(function(ev) {\n return ev !== \"error\" && ev !== \"end\";\n});\n\nfunction createStream(strict, opt) {\n return new SAXStream(strict, opt);\n}\n\nfunction SAXStream(strict, opt) {\n if (!(this instanceof SAXStream)) {\n return new SAXStream(strict, opt);\n }\n\n Stream.apply(this);\n\n this._parser = new SAXParser(strict, opt);\n this.writable = true;\n this.readable = true;\n\n var me = this;\n\n this._parser.onend = function() {\n me.emit(\"end\");\n };\n\n this._parser.onerror = function(er) {\n me.emit(\"error\", er);\n\n // if didn't throw, then means error was handled.\n // go ahead and clear error, so we can write again.\n me._parser.error = null;\n };\n\n this._decoder = null;\n\n streamWraps.forEach(function(ev) {\n Object.defineProperty(me, \"on\" + ev, {\n get: function() {\n return me._parser[\"on\" + ev];\n },\n set: function(h) {\n if (!h) {\n me.removeAllListeners(ev);\n me._parser[\"on\" + ev] = h;\n return h;\n }\n me.on(ev, h);\n },\n enumerable: true,\n configurable: false\n });\n });\n}\n\nSAXStream.prototype = Object.create(Stream.prototype, {\n constructor: {\n value: SAXStream\n }\n});\n\nSAXStream.prototype.write = function(data) {\n if (\n typeof Buffer === \"function\" &&\n typeof Buffer.isBuffer === \"function\" &&\n Buffer.isBuffer(data)\n ) {\n if (!this._decoder) {\n var SD = require(\"string_decoder\").StringDecoder;\n this._decoder = new SD(\"utf8\");\n }\n data = this._decoder.write(data);\n }\n\n this._parser.write(data.toString());\n this.emit(\"data\", data);\n return true;\n};\n\nSAXStream.prototype.end = function(chunk) {\n if (chunk && chunk.length) {\n this.write(chunk);\n }\n this._parser.end();\n return true;\n};\n\nSAXStream.prototype.on = function(ev, handler) {\n var me = this;\n if (!me._parser[\"on\" + ev] && streamWraps.indexOf(ev) !== -1) {\n me._parser[\"on\" + ev] = function() {\n var args =\n arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);\n args.splice(0, 0, ev);\n me.emit.apply(me, args);\n };\n }\n\n return Stream.prototype.on.call(me, ev, handler);\n};\n\n// this really needs to be replaced with character classes.\n// XML allows all manner of ridiculous numbers and digits.\nvar CDATA = \"[CDATA[\";\nvar DOCTYPE = \"DOCTYPE\";\nvar XML_NAMESPACE = \"http://www.w3.org/XML/1998/namespace\";\nvar XMLNS_NAMESPACE = \"http://www.w3.org/2000/xmlns/\";\nvar rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE };\n\n// http://www.w3.org/TR/REC-xml/#NT-NameStartChar\n// This implementation works on strings, a single character at a time\n// as such, it cannot ever support astral-plane characters (10000-EFFFF)\n// without a significant breaking change to either this parser, or the\n// JavaScript language. Implementation of an emoji-capable xml parser\n// is left as an exercise for the reader.\nvar nameStart = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\n\nvar nameBody = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\n\nvar entityStart = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\nvar entityBody = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\n\nfunction isWhitespace(c) {\n return c === \" \" || c === \"\\n\" || c === \"\\r\" || c === \"\\t\";\n}\n\nfunction isQuote(c) {\n return c === '\"' || c === \"'\";\n}\n\nfunction isAttribEnd(c) {\n return c === \">\" || isWhitespace(c);\n}\n\nfunction isMatch(regex, c) {\n return regex.test(c);\n}\n\nfunction notMatch(regex, c) {\n return !isMatch(regex, c);\n}\n\nvar S = 0;\nsax.STATE = {\n BEGIN: S++, // leading byte order mark or whitespace\n BEGIN_WHITESPACE: S++, // leading whitespace\n TEXT: S++, // general stuff\n TEXT_ENTITY: S++, // & and such.\n OPEN_WAKA: S++, // <\n SGML_DECL: S++, // <!BLARG\n SGML_DECL_QUOTED: S++, // <!BLARG foo \"bar\n DOCTYPE: S++, // <!DOCTYPE\n DOCTYPE_QUOTED: S++, // <!DOCTYPE \"//blah\n DOCTYPE_DTD: S++, // <!DOCTYPE \"//blah\" [ ...\n DOCTYPE_DTD_QUOTED: S++, // <!DOCTYPE \"//blah\" [ \"foo\n COMMENT_STARTING: S++, // <!-\n COMMENT: S++, // <!--\n COMMENT_ENDING: S++, // <!-- blah -\n COMMENT_ENDED: S++, // <!-- blah --\n CDATA: S++, // <![CDATA[ something\n CDATA_ENDING: S++, // ]\n CDATA_ENDING_2: S++, // ]]\n PROC_INST: S++, // <?hi\n PROC_INST_BODY: S++, // <?hi there\n PROC_INST_ENDING: S++, // <?hi \"there\" ?\n OPEN_TAG: S++, // <strong\n OPEN_TAG_SLASH: S++, // <strong /\n ATTRIB: S++, // <a\n ATTRIB_NAME: S++, // <a foo\n ATTRIB_NAME_SAW_WHITE: S++, // <a foo _\n ATTRIB_VALUE: S++, // <a foo=\n ATTRIB_VALUE_QUOTED: S++, // <a foo=\"bar\n ATTRIB_VALUE_CLOSED: S++, // <a foo=\"bar\"\n ATTRIB_VALUE_UNQUOTED: S++, // <a foo=bar\n ATTRIB_VALUE_ENTITY_Q: S++, // <foo bar=\""\"\n ATTRIB_VALUE_ENTITY_U: S++, // <foo bar="\n CLOSE_TAG: S++, // </a\n CLOSE_TAG_SAW_WHITE: S++, // </a >\n SCRIPT: S++, // <script> ...\n SCRIPT_ENDING: S++ // <script> ... <\n};\n\nsax.XML_ENTITIES = {\n amp: \"&\",\n gt: \">\",\n lt: \"<\",\n quot: '\"',\n apos: \"'\"\n};\n\nsax.ENTITIES = {\n amp: \"&\",\n gt: \">\",\n lt: \"<\",\n quot: '\"',\n apos: \"'\",\n AElig: 198,\n Aacute: 193,\n Acirc: 194,\n Agrave: 192,\n Aring: 197,\n Atilde: 195,\n Auml: 196,\n Ccedil: 199,\n ETH: 208,\n Eacute: 201,\n Ecirc: 202,\n Egrave: 200,\n Euml: 203,\n Iacute: 205,\n Icirc: 206,\n Igrave: 204,\n Iuml: 207,\n Ntilde: 209,\n Oacute: 211,\n Ocirc: 212,\n Ograve: 210,\n Oslash: 216,\n Otilde: 213,\n Ouml: 214,\n THORN: 222,\n Uacute: 218,\n Ucirc: 219,\n Ugrave: 217,\n Uuml: 220,\n Yacute: 221,\n aacute: 225,\n acirc: 226,\n aelig: 230,\n agrave: 224,\n aring: 229,\n atilde: 227,\n auml: 228,\n ccedil: 231,\n eacute: 233,\n ecirc: 234,\n egrave: 232,\n eth: 240,\n euml: 235,\n iacute: 237,\n icirc: 238,\n igrave: 236,\n iuml: 239,\n ntilde: 241,\n oacute: 243,\n ocirc: 244,\n ograve: 242,\n oslash: 248,\n otilde: 245,\n ouml: 246,\n szlig: 223,\n thorn: 254,\n uacute: 250,\n ucirc: 251,\n ugrave: 249,\n uuml: 252,\n yacute: 253,\n yuml: 255,\n copy: 169,\n reg: 174,\n nbsp: 160,\n iexcl: 161,\n cent: 162,\n pound: 163,\n curren: 164,\n yen: 165,\n brvbar: 166,\n sect: 167,\n uml: 168,\n ordf: 170,\n laquo: 171,\n not: 172,\n shy: 173,\n macr: 175,\n deg: 176,\n plusmn: 177,\n sup1: 185,\n sup2: 178,\n sup3: 179,\n acute: 180,\n micro: 181,\n para: 182,\n middot: 183,\n cedil: 184,\n ordm: 186,\n raquo: 187,\n frac14: 188,\n frac12: 189,\n frac34: 190,\n iquest: 191,\n times: 215,\n divide: 247,\n OElig: 338,\n oelig: 339,\n Scaron: 352,\n scaron: 353,\n Yuml: 376,\n fnof: 402,\n circ: 710,\n tilde: 732,\n Alpha: 913,\n Beta: 914,\n Gamma: 915,\n Delta: 916,\n Epsilon: 917,\n Zeta: 918,\n Eta: 919,\n Theta: 920,\n Iota: 921,\n Kappa: 922,\n Lambda: 923,\n Mu: 924,\n Nu: 925,\n Xi: 926,\n Omicron: 927,\n Pi: 928,\n Rho: 929,\n Sigma: 931,\n Tau: 932,\n Upsilon: 933,\n Phi: 934,\n Chi: 935,\n Psi: 936,\n Omega: 937,\n alpha: 945,\n beta: 946,\n gamma: 947,\n delta: 948,\n epsilon: 949,\n zeta: 950,\n eta: 951,\n theta: 952,\n iota: 953,\n kappa: 954,\n lambda: 955,\n mu: 956,\n nu: 957,\n xi: 958,\n omicron: 959,\n pi: 960,\n rho: 961,\n sigmaf: 962,\n sigma: 963,\n tau: 964,\n upsilon: 965,\n phi: 966,\n chi: 967,\n psi: 968,\n omega: 969,\n thetasym: 977,\n upsih: 978,\n piv: 982,\n ensp: 8194,\n emsp: 8195,\n thinsp: 8201,\n zwnj: 8204,\n zwj: 8205,\n lrm: 8206,\n rlm: 8207,\n ndash: 8211,\n mdash: 8212,\n lsquo: 8216,\n rsquo: 8217,\n sbquo: 8218,\n ldquo: 8220,\n rdquo: 8221,\n bdquo: 8222,\n dagger: 8224,\n Dagger: 8225,\n bull: 8226,\n hellip: 8230,\n permil: 8240,\n prime: 8242,\n Prime: 8243,\n lsaquo: 8249,\n rsaquo: 8250,\n oline: 8254,\n frasl: 8260,\n euro: 8364,\n image: 8465,\n weierp: 8472,\n real: 8476,\n trade: 8482,\n alefsym: 8501,\n larr: 8592,\n uarr: 8593,\n rarr: 8594,\n darr: 8595,\n harr: 8596,\n crarr: 8629,\n lArr: 8656,\n uArr: 8657,\n rArr: 8658,\n dArr: 8659,\n hArr: 8660,\n forall: 8704,\n part: 8706,\n exist: 8707,\n empty: 8709,\n nabla: 8711,\n isin: 8712,\n notin: 8713,\n ni: 8715,\n prod: 8719,\n sum: 8721,\n minus: 8722,\n lowast: 8727,\n radic: 8730,\n prop: 8733,\n infin: 8734,\n ang: 8736,\n and: 8743,\n or: 8744,\n cap: 8745,\n cup: 8746,\n int: 8747,\n there4: 8756,\n sim: 8764,\n cong: 8773,\n asymp: 8776,\n ne: 8800,\n equiv: 8801,\n le: 8804,\n ge: 8805,\n sub: 8834,\n sup: 8835,\n nsub: 8836,\n sube: 8838,\n supe: 8839,\n oplus: 8853,\n otimes: 8855,\n perp: 8869,\n sdot: 8901,\n lceil: 8968,\n rceil: 8969,\n lfloor: 8970,\n rfloor: 8971,\n lang: 9001,\n rang: 9002,\n loz: 9674,\n spades: 9824,\n clubs: 9827,\n hearts: 9829,\n diams: 9830\n};\n\nObject.keys(sax.ENTITIES).forEach(function(key) {\n var e = sax.ENTITIES[key];\n var s = typeof e === \"number\" ? String.fromCharCode(e) : e;\n sax.ENTITIES[key] = s;\n});\n\nfor (var s in sax.STATE) {\n sax.STATE[sax.STATE[s]] = s;\n}\n\n// shorthand\nS = sax.STATE;\n\nfunction emit(parser, event, data) {\n parser[event] && parser[event](data);\n}\n\nfunction emitNode(parser, nodeType, data) {\n if (parser.textNode) closeText(parser);\n emit(parser, nodeType, data);\n}\n\nfunction closeText(parser) {\n parser.textNode = textopts(parser.opt, parser.textNode);\n if (parser.textNode) emit(parser, \"ontext\", parser.textNode);\n parser.textNode = \"\";\n}\n\nfunction textopts(opt, text) {\n if (opt.trim) text = text.trim();\n if (opt.normalize) text = text.replace(/\\s+/g, \" \");\n return text;\n}\n\nfunction error(parser, er) {\n closeText(parser);\n if (parser.trackPosition) {\n er +=\n \"\\nLine: \" +\n parser.line +\n \"\\nColumn: \" +\n parser.column +\n \"\\nChar: \" +\n parser.c;\n }\n er = new Error(er);\n parser.error = er;\n emit(parser, \"onerror\", er);\n return parser;\n}\n\nfunction end(parser) {\n if (parser.sawRoot && !parser.closedRoot)\n strictFail(parser, \"Unclosed root tag\");\n if (\n parser.state !== S.BEGIN &&\n parser.state !== S.BEGIN_WHITESPACE &&\n parser.state !== S.TEXT\n ) {\n error(parser, \"Unexpected end\");\n }\n closeText(parser);\n parser.c = \"\";\n parser.closed = true;\n emit(parser, \"onend\");\n SAXParser.call(parser, parser.strict, parser.opt);\n return parser;\n}\n\nfunction strictFail(parser, message) {\n if (typeof parser !== \"object\" || !(parser instanceof SAXParser)) {\n throw new Error(\"bad call to strictFail\");\n }\n if (parser.strict) {\n error(parser, message);\n }\n}\n\nfunction newTag(parser) {\n if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]();\n var parent = parser.tags[parser.tags.length - 1] || parser;\n var tag = (parser.tag = { name: parser.tagName, attributes: {} });\n\n // will be overridden if tag contails an xmlns=\"foo\" or xmlns:foo=\"bar\"\n if (parser.opt.xmlns) {\n tag.ns = parent.ns;\n }\n parser.attribList.length = 0;\n emitNode(parser, \"onopentagstart\", tag);\n}\n\nfunction qname(name, attribute) {\n var i = name.indexOf(\":\");\n var qualName = i < 0 ? [\"\", name] : name.split(\":\");\n var prefix = qualName[0];\n var local = qualName[1];\n\n // <x \"xmlns\"=\"http://foo\">\n if (attribute && name === \"xmlns\") {\n prefix = \"xmlns\";\n local = \"\";\n }\n\n return { prefix: prefix, local: local };\n}\n\nfunction attrib(parser) {\n if (!parser.strict) {\n parser.attribName = parser.attribName[parser.looseCase]();\n }\n\n if (\n parser.attribList.indexOf(parser.attribName) !== -1 ||\n parser.tag.attributes.hasOwnProperty(parser.attribName)\n ) {\n parser.attribName = parser.attribValue = \"\";\n return;\n }\n\n if (parser.opt.xmlns) {\n var qn = qname(parser.attribName, true);\n var prefix = qn.prefix;\n var local = qn.local;\n\n if (prefix === \"xmlns\") {\n // namespace binding attribute. push the binding into scope\n if (local === \"xml\" && parser.attribValue !== XML_NAMESPACE) {\n strictFail(\n parser,\n \"xml: prefix must be bound to \" +\n XML_NAMESPACE +\n \"\\n\" +\n \"Actual: \" +\n parser.attribValue\n );\n } else if (local === \"xmlns\" && parser.attribValue !== XMLNS_NAMESPACE) {\n strictFail(\n parser,\n \"xmlns: prefix must be bound to \" +\n XMLNS_NAMESPACE +\n \"\\n\" +\n \"Actual: \" +\n parser.attribValue\n );\n } else {\n var tag = parser.tag;\n var parent = parser.tags[parser.tags.length - 1] || parser;\n if (tag.ns === parent.ns) {\n tag.ns = Object.create(parent.ns);\n }\n tag.ns[local] = parser.attribValue;\n }\n }\n\n // defer onattribute events until all attributes have been seen\n // so any new bindings can take effect. preserve attribute order\n // so deferred events can be emitted in document order\n parser.attribList.push([parser.attribName, parser.attribValue]);\n } else {\n // in non-xmlns mode, we can emit the event right away\n parser.tag.attributes[parser.attribName] = parser.attribValue;\n emitNode(parser, \"onattribute\", {\n name: parser.attribName,\n value: parser.attribValue\n });\n }\n\n parser.attribName = parser.attribValue = \"\";\n}\n\nfunction openTag(parser, selfClosing) {\n if (parser.opt.xmlns) {\n // emit namespace binding events\n var tag = parser.tag;\n\n // add namespace info to tag\n var qn = qname(parser.tagName);\n tag.prefix = qn.prefix;\n tag.local = qn.local;\n tag.uri = tag.ns[qn.prefix] || \"\";\n\n if (tag.prefix && !tag.uri) {\n strictFail(\n parser,\n \"Unbound namespace prefix: \" + JSON.stringify(parser.tagName)\n );\n tag.uri = qn.prefix;\n }\n\n var parent = parser.tags[parser.tags.length - 1] || parser;\n if (tag.ns && parent.ns !== tag.ns) {\n Object.keys(tag.ns).forEach(function(p) {\n emitNode(parser, \"onopennamespace\", {\n prefix: p,\n uri: tag.ns[p]\n });\n });\n }\n\n // handle deferred onattribute events\n // Note: do not apply default ns to attributes:\n // http://www.w3.org/TR/REC-xml-names/#defaulting\n for (var i = 0, l = parser.attribList.length; i < l; i++) {\n var nv = parser.attribList[i];\n var name = nv[0];\n var value = nv[1];\n var qualName = qname(name, true);\n var prefix = qualName.prefix;\n var local = qualName.local;\n var uri = prefix === \"\" ? \"\" : tag.ns[prefix] || \"\";\n var a = {\n name: name,\n value: value,\n prefix: prefix,\n local: local,\n uri: uri\n };\n\n // if there's any attributes with an undefined namespace,\n // then fail on them now.\n if (prefix && prefix !== \"xmlns\" && !uri) {\n strictFail(\n parser,\n \"Unbound namespace prefix: \" + JSON.stringify(prefix)\n );\n a.uri = prefix;\n }\n parser.tag.attributes[name] = a;\n emitNode(parser, \"onattribute\", a);\n }\n parser.attribList.length = 0;\n }\n\n parser.tag.isSelfClosing = !!selfClosing;\n\n // process the tag\n parser.sawRoot = true;\n parser.tags.push(parser.tag);\n emitNode(parser, \"onopentag\", parser.tag);\n if (!selfClosing) {\n // special case for <script> in non-strict mode.\n if (!parser.noscript && parser.tagName.toLowerCase() === \"script\") {\n parser.state = S.SCRIPT;\n } else {\n parser.state = S.TEXT;\n }\n parser.tag = null;\n parser.tagName = \"\";\n }\n parser.attribName = parser.attribValue = \"\";\n parser.attribList.length = 0;\n}\n\nfunction closeTag(parser) {\n if (!parser.tagName) {\n strictFail(parser, \"Weird empty close tag.\");\n parser.textNode += \"</>\";\n parser.state = S.TEXT;\n return;\n }\n\n if (parser.script) {\n if (parser.tagName !== \"script\") {\n parser.script += \"</\" + parser.tagName + \">\";\n parser.tagName = \"\";\n parser.state = S.SCRIPT;\n return;\n }\n emitNode(parser, \"onscript\", parser.script);\n parser.script = \"\";\n }\n\n // first make sure that the closing tag actually exists.\n // <a><b></c></b></a> will close everything, otherwise.\n var t = parser.tags.length;\n var tagName = parser.tagName;\n if (!parser.strict) {\n tagName = tagName[parser.looseCase]();\n }\n var closeTo = tagName;\n while (t--) {\n var close = parser.tags[t];\n if (close.name !== closeTo) {\n // fail the first time in strict mode\n strictFail(parser, \"Unexpected close tag\");\n } else {\n break;\n }\n }\n\n // didn't find it. we already failed for strict, so just abort.\n if (t < 0) {\n strictFail(parser, \"Unmatched closing tag: \" + parser.tagName);\n parser.textNode += \"</\" + parser.tagName + \">\";\n parser.state = S.TEXT;\n return;\n }\n parser.tagName = tagName;\n var s = parser.tags.length;\n while (s-- > t) {\n var tag = (parser.tag = parser.tags.pop());\n parser.tagName = parser.tag.name;\n emitNode(parser, \"onclosetag\", parser.tagName);\n\n var x = {};\n for (var i in tag.ns) {\n x[i] = tag.ns[i];\n }\n\n var parent = parser.tags[parser.tags.length - 1] || parser;\n if (parser.opt.xmlns && tag.ns !== parent.ns) {\n // remove namespace bindings introduced by tag\n Object.keys(tag.ns).forEach(function(p) {\n var n = tag.ns[p];\n emitNode(parser, \"onclosenamespace\", { prefix: p, uri: n });\n });\n }\n }\n if (t === 0) parser.closedRoot = true;\n parser.tagName = parser.attribValue = parser.attribName = \"\";\n parser.attribList.length = 0;\n parser.state = S.TEXT;\n}\n\nfunction parseEntity(parser) {\n var entity = parser.entity;\n var entityLC = entity.toLowerCase();\n var num;\n var numStr = \"\";\n\n if (parser.ENTITIES[entity]) {\n return parser.ENTITIES[entity];\n }\n if (parser.ENTITIES[entityLC]) {\n return parser.ENTITIES[entityLC];\n }\n entity = entityLC;\n if (entity.charAt(0) === \"#\") {\n if (entity.charAt(1) === \"x\") {\n entity = entity.slice(2);\n num = parseInt(entity, 16);\n numStr = num.toString(16);\n } else {\n entity = entity.slice(1);\n num = parseInt(entity, 10);\n numStr = num.toString(10);\n }\n }\n entity = entity.replace(/^0+/, \"\");\n if (isNaN(num) || numStr.toLowerCase() !== entity) {\n strictFail(parser, \"Invalid character entity\");\n return \"&\" + parser.entity + \";\";\n }\n\n return String.fromCodePoint(num);\n}\n\nfunction beginWhiteSpace(parser, c) {\n if (c === \"<\") {\n parser.state = S.OPEN_WAKA;\n parser.startTagPosition = parser.position;\n } else if (!isWhitespace(c)) {\n // have to process this as a text node.\n // weird, but happens.\n strictFail(parser, \"Non-whitespace before first tag.\");\n parser.textNode = c;\n parser.state = S.TEXT;\n }\n}\n\nfunction charAt(chunk, i) {\n var result = \"\";\n if (i < chunk.length) {\n result = chunk.charAt(i);\n }\n return result;\n}\n\nfunction write(chunk) {\n var parser = this;\n if (this.error) {\n throw this.error;\n }\n if (parser.closed) {\n return error(\n parser,\n \"Cannot write after close. Assign an onready handler.\"\n );\n }\n if (chunk === null) {\n return end(parser);\n }\n if (typeof chunk === \"object\") {\n chunk = chunk.toString();\n }\n var i = 0;\n var c = \"\";\n while (true) {\n c = charAt(chunk, i++);\n parser.c = c;\n\n if (!c) {\n break;\n }\n\n if (parser.trackPosition) {\n parser.position++;\n if (c === \"\\n\") {\n parser.line++;\n parser.column = 0;\n } else {\n parser.column++;\n }\n }\n\n switch (parser.state) {\n case S.BEGIN:\n parser.state = S.BEGIN_WHITESPACE;\n if (c === \"\\uFEFF\") {\n continue;\n }\n beginWhiteSpace(parser, c);\n continue;\n\n case S.BEGIN_WHITESPACE:\n beginWhiteSpace(parser, c);\n continue;\n\n case S.TEXT:\n if (parser.sawRoot && !parser.closedRoot) {\n var starti = i - 1;\n while (c && c !== \"<\" && c !== \"&\") {\n c = charAt(chunk, i++);\n if (c && parser.trackPosition) {\n parser.position++;\n if (c === \"\\n\") {\n parser.line++;\n parser.column = 0;\n } else {\n parser.column++;\n }\n }\n }\n parser.textNode += chunk.substring(starti, i - 1);\n }\n if (\n c === \"<\" &&\n !(parser.sawRoot && parser.closedRoot && !parser.strict)\n ) {\n parser.state = S.OPEN_WAKA;\n parser.startTagPosition = parser.position;\n } else {\n if (!isWhitespace(c) && (!parser.sawRoot || parser.closedRoot)) {\n strictFail(parser, \"Text data outside of root node.\");\n }\n if (c === \"&\") {\n parser.state = S.TEXT_ENTITY;\n } else {\n parser.textNode += c;\n }\n }\n continue;\n\n case S.SCRIPT:\n // only non-strict\n if (c === \"<\") {\n parser.state = S.SCRIPT_ENDING;\n } else {\n parser.script += c;\n }\n continue;\n\n case S.SCRIPT_ENDING:\n if (c === \"/\") {\n parser.state = S.CLOSE_TAG;\n } else {\n parser.script += \"<\" + c;\n parser.state = S.SCRIPT;\n }\n continue;\n\n case S.OPEN_WAKA:\n // either a /, ?, !, or text is coming next.\n if (c === \"!\") {\n parser.state = S.SGML_DECL;\n parser.sgmlDecl = \"\";\n } else if (isWhitespace(c)) {\n // wait for it...\n } else if (isMatch(nameStart, c)) {\n parser.state = S.OPEN_TAG;\n parser.tagName = c;\n } else if (c === \"/\") {\n parser.state = S.CLOSE_TAG;\n parser.tagName = \"\";\n } else if (c === \"?\") {\n parser.state = S.PROC_INST;\n parser.procInstName = parser.procInstBody = \"\";\n } else {\n strictFail(parser, \"Unencoded <\");\n // if there was some whitespace, then add that in.\n if (parser.startTagPosition + 1 < parser.position) {\n var pad = parser.position - parser.startTagPosition;\n c = new Array(pad).join(\" \") + c;\n }\n parser.textNode += \"<\" + c;\n parser.state = S.TEXT;\n }\n continue;\n\n case S.SGML_DECL:\n if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {\n emitNode(parser, \"onopencdata\");\n parser.state = S.CDATA;\n parser.sgmlDecl = \"\";\n parser.cdata = \"\";\n } else if (parser.sgmlDecl + c === \"--\") {\n parser.state = S.COMMENT;\n parser.comment = \"\";\n parser.sgmlDecl = \"\";\n } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {\n parser.state = S.DOCTYPE;\n if (parser.doctype || parser.sawRoot) {\n strictFail(parser, \"Inappropriately located doctype declaration\");\n }\n parser.doctype = \"\";\n parser.sgmlDecl = \"\";\n } else if (c === \">\") {\n emitNode(parser, \"onsgmldeclaration\", parser.sgmlDecl);\n parser.sgmlDecl = \"\";\n parser.state = S.TEXT;\n } else if (isQuote(c)) {\n parser.state = S.SGML_DECL_QUOTED;\n parser.sgmlDecl += c;\n } else {\n parser.sgmlDecl += c;\n }\n continue;\n\n case S.SGML_DECL_QUOTED:\n if (c === parser.q) {\n parser.state = S.SGML_DECL;\n parser.q = \"\";\n }\n parser.sgmlDecl += c;\n continue;\n\n case S.DOCTYPE:\n if (c === \">\") {\n parser.state = S.TEXT;\n emitNode(parser, \"ondoctype\", parser.doctype);\n parser.doctype = true; // just remember that we saw it.\n } else {\n parser.doctype += c;\n if (c === \"[\") {\n parser.state = S.DOCTYPE_DTD;\n } else if (isQuote(c)) {\n parser.state = S.DOCTYPE_QUOTED;\n parser.q = c;\n }\n }\n continue;\n\n case S.DOCTYPE_QUOTED:\n parser.doctype += c;\n if (c === parser.q) {\n parser.q = \"\";\n parser.state = S.DOCTYPE;\n }\n continue;\n\n case S.DOCTYPE_DTD:\n parser.doctype += c;\n if (c === \"]\") {\n parser.state = S.DOCTYPE;\n } else if (isQuote(c)) {\n parser.state = S.DOCTYPE_DTD_QUOTED;\n parser.q = c;\n }\n continue;\n\n case S.DOCTYPE_DTD_QUOTED:\n parser.doctype += c;\n if (c === parser.q) {\n parser.state = S.DOCTYPE_DTD;\n parser.q = \"\";\n }\n continue;\n\n case S.COMMENT:\n if (c === \"-\") {\n parser.state = S.COMMENT_ENDING;\n } else {\n parser.comment += c;\n }\n continue;\n\n case S.COMMENT_ENDING:\n if (c === \"-\") {\n parser.state = S.COMMENT_ENDED;\n parser.comment = textopts(parser.opt, parser.comment);\n if (parser.comment) {\n emitNode(parser, \"oncomment\", parser.comment);\n }\n parser.comment = \"\";\n } else {\n parser.comment += \"-\" + c;\n parser.state = S.COMMENT;\n }\n continue;\n\n case S.COMMENT_ENDED:\n if (c !== \">\") {\n strictFail(parser, \"Malformed comment\");\n // allow <!-- blah -- bloo --> in non-strict mode,\n // which is a comment of \" blah -- bloo \"\n parser.comment += \"--\" + c;\n parser.state = S.COMMENT;\n } else {\n parser.state = S.TEXT;\n }\n continue;\n\n case S.CDATA:\n if (c === \"]\") {\n parser.state = S.CDATA_ENDING;\n } else {\n parser.cdata += c;\n }\n continue;\n\n case S.CDATA_ENDING:\n if (c === \"]\") {\n parser.state = S.CDATA_ENDING_2;\n } else {\n parser.cdata += \"]\" + c;\n parser.state = S.CDATA;\n }\n continue;\n\n case S.CDATA_ENDING_2:\n if (c === \">\") {\n if (parser.cdata) {\n emitNode(parser, \"oncdata\", parser.cdata);\n }\n emitNode(parser, \"onclosecdata\");\n parser.cdata = \"\";\n parser.state = S.TEXT;\n } else if (c === \"]\") {\n parser.cdata += \"]\";\n } else {\n parser.cdata += \"]]\" + c;\n parser.state = S.CDATA;\n }\n continue;\n\n case S.PROC_INST:\n if (c === \"?\") {\n parser.state = S.PROC_INST_ENDING;\n } else if (isWhitespace(c)) {\n parser.state = S.PROC_INST_BODY;\n } else {\n parser.procInstName += c;\n }\n continue;\n\n case S.PROC_INST_BODY:\n if (!parser.procInstBody && isWhitespace(c)) {\n continue;\n } else if (c === \"?\") {\n parser.state = S.PROC_INST_ENDING;\n } else {\n parser.procInstBody += c;\n }\n continue;\n\n case S.PROC_INST_ENDING:\n if (c === \">\") {\n emitNode(parser, \"onprocessinginstruction\", {\n name: parser.procInstName,\n body: parser.procInstBody\n });\n parser.procInstName = parser.procInstBody = \"\";\n parser.state = S.TEXT;\n } else {\n parser.procInstBody += \"?\" + c;\n parser.state = S.PROC_INST_BODY;\n }\n continue;\n\n case S.OPEN_TAG:\n if (isMatch(nameBody, c)) {\n parser.tagName += c;\n } else {\n newTag(parser);\n if (c === \">\") {\n openTag(parser);\n } else if (c === \"/\") {\n parser.state = S.OPEN_TAG_SLASH;\n } else {\n if (!isWhitespace(c)) {\n strictFail(parser, \"Invalid character in tag name\");\n }\n parser.state = S.ATTRIB;\n }\n }\n continue;\n\n case S.OPEN_TAG_SLASH:\n if (c === \">\") {\n openTag(parser, true);\n closeTag(parser);\n } else {\n strictFail(parser, \"Forward-slash in opening tag not followed by >\");\n parser.state = S.ATTRIB;\n }\n continue;\n\n case S.ATTRIB:\n // haven't read the attribute name yet.\n if (isWhitespace(c)) {\n continue;\n } else if (c === \">\") {\n openTag(parser);\n } else if (c === \"/\") {\n parser.state = S.OPEN_TAG_SLASH;\n } else if (isMatch(nameStart, c)) {\n parser.attribName = c;\n parser.attribValue = \"\";\n parser.state = S.ATTRIB_NAME;\n } else {\n strictFail(parser, \"Invalid attribute name\");\n }\n continue;\n\n case S.ATTRIB_NAME:\n if (c === \"=\") {\n parser.state = S.ATTRIB_VALUE;\n } else if (c === \">\") {\n strictFail(parser, \"Attribute without value\");\n parser.attribValue = parser.attribName;\n attrib(parser);\n openTag(parser);\n } else if (isWhitespace(c)) {\n parser.state = S.ATTRIB_NAME_SAW_WHITE;\n } else if (isMatch(nameBody, c)) {\n parser.attribName += c;\n } else {\n strictFail(parser, \"Invalid attribute name\");\n }\n continue;\n\n case S.ATTRIB_NAME_SAW_WHITE:\n if (c === \"=\") {\n parser.state = S.ATTRIB_VALUE;\n } else if (isWhitespace(c)) {\n continue;\n } else {\n strictFail(parser, \"Attribute without value\");\n parser.tag.attributes[parser.attribName] = \"\";\n parser.attribValue = \"\";\n emitNode(parser, \"onattribute\", {\n name: parser.attribName,\n value: \"\"\n });\n parser.attribName = \"\";\n if (c === \">\") {\n openTag(parser);\n } else if (isMatch(nameStart, c)) {\n parser.attribName = c;\n parser.state = S.ATTRIB_NAME;\n } else {\n strictFail(parser, \"Invalid attribute name\");\n parser.state = S.ATTRIB;\n }\n }\n continue;\n\n case S.ATTRIB_VALUE:\n if (isWhitespace(c)) {\n continue;\n } else if (isQuote(c)) {\n parser.q = c;\n parser.state = S.ATTRIB_VALUE_QUOTED;\n } else {\n strictFail(parser, \"Unquoted attribute value\");\n parser.state = S.ATTRIB_VALUE_UNQUOTED;\n parser.attribValue = c;\n }\n continue;\n\n case S.ATTRIB_VALUE_QUOTED:\n if (c !== parser.q) {\n if (c === \"&\") {\n parser.state = S.ATTRIB_VALUE_ENTITY_Q;\n } else {\n parser.attribValue += c;\n }\n continue;\n }\n attrib(parser);\n parser.q = \"\";\n parser.state = S.ATTRIB_VALUE_CLOSED;\n continue;\n\n case S.ATTRIB_VALUE_CLOSED:\n if (isWhitespace(c)) {\n parser.state = S.ATTRIB;\n } else if (c === \">\") {\n openTag(parser);\n } else if (c === \"/\") {\n parser.state = S.OPEN_TAG_SLASH;\n } else if (isMatch(nameStart, c)) {\n strictFail(parser, \"No whitespace between attributes\");\n parser.attribName = c;\n parser.attribValue = \"\";\n parser.state = S.ATTRIB_NAME;\n } else {\n strictFail(parser, \"Invalid attribute name\");\n }\n continue;\n\n case S.ATTRIB_VALUE_UNQUOTED:\n if (!isAttribEnd(c)) {\n if (c === \"&\") {\n parser.state = S.ATTRIB_VALUE_ENTITY_U;\n } else {\n parser.attribValue += c;\n }\n continue;\n }\n attrib(parser);\n if (c === \">\") {\n openTag(parser);\n } else {\n parser.state = S.ATTRIB;\n }\n continue;\n\n case S.CLOSE_TAG:\n if (!parser.tagName) {\n if (isWhitespace(c)) {\n continue;\n } else if (notMatch(nameStart, c)) {\n if (parser.script) {\n parser.script += \"</\" + c;\n parser.state = S.SCRIPT;\n } else {\n strictFail(parser, \"Invalid tagname in closing tag.\");\n }\n } else {\n parser.tagName = c;\n }\n } else if (c === \">\") {\n closeTag(parser);\n } else if (isMatch(nameBody, c)) {\n parser.tagName += c;\n } else if (parser.script) {\n parser.script += \"</\" + parser.tagName;\n parser.tagName = \"\";\n parser.state = S.SCRIPT;\n } else {\n if (!isWhitespace(c)) {\n strictFail(parser, \"Invalid tagname in closing tag\");\n }\n parser.state = S.CLOSE_TAG_SAW_WHITE;\n }\n continue;\n\n case S.CLOSE_TAG_SAW_WHITE:\n if (isWhitespace(c)) {\n continue;\n }\n if (c === \">\") {\n closeTag(parser);\n } else {\n strictFail(parser, \"Invalid characters in closing tag\");\n }\n continue;\n\n case S.TEXT_ENTITY:\n case S.ATTRIB_VALUE_ENTITY_Q:\n case S.ATTRIB_VALUE_ENTITY_U:\n var returnState;\n var buffer;\n switch (parser.state) {\n case S.TEXT_ENTITY:\n returnState = S.TEXT;\n buffer = \"textNode\";\n break;\n\n case S.ATTRIB_VALUE_ENTITY_Q:\n returnState = S.ATTRIB_VALUE_QUOTED;\n buffer = \"attribValue\";\n break;\n\n case S.ATTRIB_VALUE_ENTITY_U:\n returnState = S.ATTRIB_VALUE_UNQUOTED;\n buffer = \"attribValue\";\n break;\n }\n\n if (c === \";\") {\n parser[buffer] += parseEntity(parser);\n parser.entity = \"\";\n parser.state = returnState;\n } else if (\n isMatch(parser.entity.length ? entityBody : entityStart, c)\n ) {\n parser.entity += c;\n } else {\n strictFail(parser, \"Invalid character in entity name\");\n parser[buffer] += \"&\" + parser.entity + c;\n parser.entity = \"\";\n parser.state = returnState;\n }\n\n continue;\n\n default:\n throw new Error(parser, \"Unknown state: \" + parser.state);\n }\n } // while\n\n if (parser.position >= parser.bufferCheckPosition) {\n checkBufferLength(parser);\n }\n return parser;\n}\n\n/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */\n/* istanbul ignore next */\nif (!String.fromCodePoint) {\n (function() {\n var stringFromCharCode = String.fromCharCode;\n var floor = Math.floor;\n var fromCodePoint = function() {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n if (!length) {\n return \"\";\n }\n var result = \"\";\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10ffff || // not a valid Unicode code point\n floor(codePoint) !== codePoint // not an integer\n ) {\n throw RangeError(\"Invalid code point: \" + codePoint);\n }\n if (codePoint <= 0xffff) {\n // BMP code point\n codeUnits.push(codePoint);\n } else {\n // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xd800;\n lowSurrogate = (codePoint % 0x400) + 0xdc00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n if (index + 1 === length || codeUnits.length > MAX_SIZE) {\n result += stringFromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n };\n /* istanbul ignore next */\n if (Object.defineProperty) {\n Object.defineProperty(String, \"fromCodePoint\", {\n value: fromCodePoint,\n configurable: true,\n writable: true\n });\n } else {\n String.fromCodePoint = fromCodePoint;\n }\n })();\n}\n\n// wrapper for non-node envs\nsax.parser = function(strict, opt) {\n return new SAXParser(strict, opt);\n};\nsax.SAXParser = SAXParser;\nsax.SAXStream = SAXStream;\nsax.createStream = createStream;\n\nexport default sax;\n"],"sourceRoot":""}