diff --git a/builds/wtf_wikipedia-client.js b/builds/wtf_wikipedia-client.js index 3db0df66..d08dc15e 100644 --- a/builds/wtf_wikipedia-client.js +++ b/builds/wtf_wikipedia-client.js @@ -1,4 +1,4 @@ -/* wtf_wikipedia 8.1.0 MIT */ +/* wtf_wikipedia 8.1.1 MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -3891,6 +3891,7 @@ }; var skipSpanRow = function skipSpanRow(row) { + row = row || []; var len = row.length; var hasTxt = row.filter(function (str) { return str; @@ -3996,7 +3997,15 @@ .split(/\n/).map(function (l) { return l.trim(); }); - var rows = _findRows(lines); //remove non-header span rows + var rows = _findRows(lines); + rows = rows.filter(function (r) { + return r; + }); + + if (rows.length === 0) { + return []; + } //remove non-header span rows + rows = removeMidSpans(rows); //support colspan, rowspan... @@ -8779,7 +8788,7 @@ var category = fetchCategory; - var _version = '8.1.0'; + var _version = '8.1.1'; var wtf = function wtf(wiki, options) { return _01Document(wiki, options); diff --git a/builds/wtf_wikipedia-client.js.map b/builds/wtf_wikipedia-client.js.map index aec00181..6a14bfe9 100644 --- a/builds/wtf_wikipedia-client.js.map +++ b/builds/wtf_wikipedia-client.js.map @@ -1 +1 @@ -{"version":3,"file":"wtf_wikipedia-client.js","sources":["../src/_fetch/00-parseUrl.js","../src/_fetch/01-makeUrl.js","../src/_fetch/02-getResult.js","../src/01-document/_sectionMap.js","../src/_lib/setDefaults.js","../src/01-document/toJson.js","../src/_data/disambig.js","../src/01-document/disambig.js","../src/image/toJson.js","../src/image/Image.js","../src/01-document/Document.js","../src/_data/categories.js","../src/_data/images.js","../src/_data/infoboxes.js","../src/_data/redirects.js","../src/_data/references.js","../src/_data/i18n.js","../src/_data/languages.js","../src/_data/interwiki.js","../src/link/interwiki.js","../src/link/parse.js","../src/01-document/redirects.js","../src/01-document/preProcess/kill_xml.js","../src/01-document/preProcess/index.js","../src/_lib/encode.js","../src/02-section/toJson.js","../src/02-section/Section.js","../src/_lib/helpers.js","../src/link/Link.js","../src/link/index.js","../src/04-sentence/formatting.js","../src/04-sentence/toJson.js","../src/04-sentence/Sentence.js","../src/04-sentence/_abbreviations.js","../src/04-sentence/parse.js","../src/04-sentence/index.js","../src/template/_parsers/_strip.js","../src/template/_parsers/_fmtName.js","../src/template/_parsers/01-pipe-splitter.js","../src/template/_parsers/02-keyMaker.js","../src/template/_parsers/03-cleanup.js","../src/template/_parsers/parse.js","../src/reference/Reference.js","../src/reference/index.js","../src/02-section/heading.js","../src/table/parse/_findRows.js","../src/table/parse/_spans.js","../src/table/parse/index.js","../src/table/toJson.js","../src/table/Table.js","../src/table/index.js","../src/03-paragraph/toJson.js","../src/03-paragraph/Paragraph.js","../src/image/nested_find.js","../src/image/index.js","../src/list/List.js","../src/list/index.js","../src/03-paragraph/index.js","../src/infobox/toJson.js","../src/infobox/Infobox.js","../src/template/find/flat.js","../src/template/_parsers/_getName.js","../src/template/find/index.js","../src/template/_ignore.js","../src/template/_infobox.js","../src/template/templates/dates/_months.js","../src/template/templates/dates/_format.js","../src/template/templates/dates/misc.js","../src/template/templates/dates/_delta.js","../src/template/templates/dates/parsers.js","../src/template/templates/dates/_timeSince.js","../src/template/templates/dates/index.js","../src/template/templates/formatting/format.js","../src/template/templates/formatting/lists.js","../src/template/templates/formatting/misc.js","../src/template/templates/formatting/index.js","../src/template/templates/geo/dms-format.js","../src/template/templates/geo/coor.js","../src/template/templates/geo/index.js","../src/template/templates/wikipedia/links.js","../src/template/templates/wikipedia/page.js","../src/template/templates/wikipedia/table-cell.js","../src/template/templates/wikipedia/index.js","../src/template/templates/brackets.js","../src/template/templates/currency.js","../src/template/templates/elections.js","../src/_data/flags.js","../src/template/templates/flags.js","../src/template/templates/ipa.js","../src/template/templates/languages.js","../src/template/templates/math.js","../src/template/templates/misc.js","../src/template/templates/punctuation.js","../src/template/templates/science.js","../src/template/templates/soccer.js","../src/template/templates/sports.js","../src/template/templates/stock-exchanges.js","../src/template/templates/weather.js","../src/template/templates/websites.js","../src/template/templates/wiktionary.js","../src/template/templates/index.js","../src/template/parse.js","../src/template/Template.js","../src/template/index.js","../src/02-section/start-to-end/gallery.js","../src/02-section/start-to-end/election.js","../src/02-section/start-to-end/nba.js","../src/02-section/start-to-end/mlb.js","../src/02-section/start-to-end/mma.js","../src/02-section/start-to-end/math.js","../src/02-section/start-to-end/index.js","../src/02-section/index.js","../src/01-document/categories.js","../src/01-document/index.js","../src/_fetch/03-parseDoc.js","../src/_fetch/http/client.js","../src/_fetch/_headers.js","../src/_fetch/index.js","../src/_fetch/random.js","../src/_fetch/category.js","../src/_version.js","../src/index.js"],"sourcesContent":["const parseUrl = function(url) {\n let parsed = new URL(url) //eslint-disable-line\n let title = parsed.pathname.replace(/^\\/(wiki\\/)?/, '')\n title = decodeURIComponent(title)\n return {\n domain: parsed.host,\n title: title\n }\n}\nmodule.exports = parseUrl\n","const isInterWiki = /(wiktionary|wikinews|wikibooks|wikiquote|wikisource|wikispecies|wikiversity|wikivoyage|wikipedia|wikimedia|foundation|meta)\\.org/\n\nconst defaults = {\n action: 'query',\n prop: 'revisions', //we use the 'revisions' api here, instead of the Raw api, for its CORS-rules..\n rvprop: 'content',\n maxlag: 5,\n rvslots: 'main',\n origin: '*',\n format: 'json',\n redirects: 'true'\n}\n\nconst toQueryString = function(obj) {\n return Object.entries(obj)\n .map(([key, value]) => {\n return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`\n })\n .join('&')\n}\n\nconst isArray = function(arr) {\n return Object.prototype.toString.call(arr) === '[object Array]'\n}\n\nconst cleanTitle = page => {\n page = page.replace(/ /g, '_')\n page = page.trim()\n // page = encodeURIComponent(page)\n return page\n}\n\nconst makeUrl = function(options) {\n let params = Object.assign({}, defaults)\n // default url\n let url = `https://${options.lang}.${options.wiki}.org/w/api.php?`\n // from a 3rd party wiki\n options.domain = options.domain || options.wikiUrl //support old syntax\n if (options.domain) {\n let path = options.path\n //wikimedia api uses ./w/api path. no others do\n if (isInterWiki.test(options.domain)) {\n path = 'w/api.php'\n }\n url = `https://${options.domain}/${path}?`\n }\n if (!options.follow_redirects) {\n delete params.redirects\n }\n // support numerical ids\n let page = options.title\n if (typeof page === 'number') {\n params.pageids = page //single pageId\n } else if (isArray(page) && typeof page[0] === 'number') {\n params.pageids = page.join('|') //pageid array\n } else if (isArray(page) === true) {\n //support array\n params.titles = page.map(cleanTitle).join('|')\n } else {\n // single page\n params.titles = cleanTitle(page)\n }\n // make it!\n url += toQueryString(params)\n return url\n}\nmodule.exports = makeUrl\n","//this data-format from mediawiki api is nutso\nconst getResult = function(data, options) {\n options = options || {}\n let pages = Object.keys(data.query.pages)\n let docs = pages.map(id => {\n let page = data.query.pages[id] || {}\n if (page.hasOwnProperty('missing') || page.hasOwnProperty('invalid')) {\n return null\n }\n let text = page.revisions[0]['*']\n // console.log(page.revisions[0])\n //us the 'generator' result format, for the random() method\n if (!text && page.revisions[0].slots) {\n text = page.revisions[0].slots.main['*']\n }\n let meta = Object.assign({}, options, {\n title: page.title,\n pageID: page.pageid,\n namespace: page.ns\n })\n try {\n return { wiki: text, meta: meta }\n } catch (e) {\n console.error(e)\n throw e\n }\n })\n return docs\n}\nmodule.exports = getResult\n","//helper for looping around all sections of a document\nconst sectionMap = function(doc, fn, clue) {\n let arr = []\n doc.sections().forEach(sec => {\n let list = []\n if (typeof clue === 'string') {\n list = sec[fn](clue)\n } else {\n list = sec[fn]()\n }\n list.forEach(t => {\n arr.push(t)\n })\n })\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n}\nmodule.exports = sectionMap\n","//\nconst setDefaults = function(options, defaults) {\n return Object.assign({}, defaults, options)\n}\nmodule.exports = setDefaults\n","const setDefaults = require('../_lib/setDefaults')\nconst defaults = {\n title: true,\n sections: true,\n pageID: true,\n categories: true\n}\n\n//an opinionated output of the most-wanted data\nconst toJSON = function(doc, options) {\n options = setDefaults(options, defaults)\n let data = {}\n if (options.title) {\n data.title = doc.title()\n }\n if (options.pageID) {\n data.pageID = doc.pageID()\n }\n if (options.categories) {\n data.categories = doc.categories()\n }\n if (options.sections) {\n data.sections = doc.sections().map(i => i.json(options))\n }\n if (doc.isRedirect() === true) {\n data.isRedirect = true\n data.redirectTo = doc.data.redirectTo\n data.sections = []\n }\n\n //these are default-off\n if (options.coordinates) {\n data.coordinates = doc.coordinates()\n }\n if (options.infoboxes) {\n data.infoboxes = doc.infoboxes().map(i => i.json(options))\n }\n if (options.images) {\n data.images = doc.images().map(i => i.json(options))\n }\n if (options.plaintext) {\n data.plaintext = doc.text(options)\n }\n if (options.citations || options.references) {\n data.references = doc.references()\n }\n return data\n}\nmodule.exports = toJSON\n","module.exports = [\n 'dab', //en\n 'disamb', //en\n 'disambig', //en\n 'disambiguation', //en\n\n 'aðgreining', //is\n 'aimai', //ja\n 'ałtsʼáʼáztiin', //nv\n 'anlam ayrımı', //gag\n 'anlam ayrımı', //tr\n 'apartigilo', //eo\n 'argipen', //eu\n 'begriepskloorenge', //stq\n 'begriffsklärung', //als\n 'begriffsklärung', //de\n 'begriffsklärung', //pdc\n 'begriffsklearung', //bar\n 'bisongidila', //kg\n 'bkl', //pfl\n 'bokokani', //ln\n 'caddayn', //so\n 'clerheans', //kw\n 'cudakirin', //ku\n 'čvor', //bs\n 'db', //vls\n 'desambig', //nov\n 'desambigación', //an\n 'desambiguação', //pt\n 'desambiguació', //ca\n 'desambiguación', //es\n 'desambiguáncia', //ext\n 'desambiguasion', //lad\n 'desambiguassiù', //lmo\n 'desambigui', //lfn\n 'dezambiguizare', //ro\n 'dəqiqləşdirmə', //az\n 'disambigua', //it\n 'disambigua', //lij\n 'disambigua', //nap\n 'disambìgua', //sc\n 'disambigua', //scn\n 'disambiguasi', //id\n 'disambiguasi', //su\n 'discretiva', //la\n 'disheñvelout', //br\n 'disingkek', //min\n 'dixanbigua', //vec\n 'dixebra', //ast\n 'diżambigwazzjoni', //mt\n 'doorverwijspagina', //nl\n 'dp', //nl\n 'dp', //zea\n 'dubbelsinnig', //af\n 'dudalipen', //rmy\n 'dv', //nds_nl\n 'egyért', //hu\n 'fleiri týdningar', //fo\n 'fleirtyding', //nn\n 'flertydig', //da\n 'förgrening', //sv\n 'gì-ngiê', //cdo\n 'giklaro', //ceb\n 'gwahaniaethu', //cy\n 'homonimo', //io\n 'homónimos', //gl\n 'homonymie', //fr\n 'huaʻōlelo puana like', //haw\n 'idirdhealú', //ga\n 'khu-pia̍t', //zh_min_nan\n 'kthjellim', //sq\n 'kujekesa', //sn\n 'maana', //sw\n 'maneo bin', //diq\n 'mehrdüdig begreep', //nds\n 'menm non', //ht\n 'muardüüdag artiikel', //frr\n 'neibetsjuttings', //fy\n 'nozīmju atdalīšana', //lv\n 'nuorodinis', //lt\n 'nyahkekaburan', //ms\n 'omonimeye', //wa\n 'omonimia', //oc\n 'page dé frouque', //nrm\n 'paglilinaw', //tl\n 'panangilawlawag', //ilo\n 'pansayod', //war\n 'pejy mitovy anarana', //mg\n 'peker', //no\n 'razdvojba', //hr\n 'razločitev', //sl\n 'razvrstavanje', //sh\n 'reddaghey', //gv\n 'rozcestník', //cs\n 'rozlišovacia stránka', //sk\n 'sclerir noziun', //rm\n 'selvendyssivu', //olo\n 'soilleireachadh', //gd\n 'suzmunski', //jbo\n 'täpsustuslehekülg', //et\n 'täsmennyssivu', //fi\n 'telplänov', //vo\n 'tlahtolmelahuacatlaliztli', //nah\n 'trang định hướng', //vi\n 'ujednoznacznienie', //pl\n 'verdudeliking', //li\n 'wěcejwóznamowosć', //dsb\n 'wjacezmyslnosć', //hsb\n 'zambiguaçon', //mwl\n 'zeimeibu škiršona', //ltg\n 'αποσαφήνιση', //el\n 'айрық', //kk\n 'аҵакырацәа', //ab\n 'вишезначна одредница', //sr\n 'ибҳомзудоӣ', //tg\n 'кёб магъаналы', //krc\n 'күп мәгънәләр', //tt\n 'күп мәғәнәлелек', //ba\n 'мъногосъмꙑслиѥ', //cu\n 'неадназначнасць', //be\n 'неадназначнасьць', //be_x_old\n 'неоднозначность', //ru\n 'олон удхатай', //bxr\n 'појаснување', //mk\n 'пояснение', //bg\n 'са шумуд манавал', //lez\n 'салаа утгатай', //mn\n 'суолталар', //sah\n 'текмаанисиздик', //ky\n 'цо магіна гуреб', //av\n 'чеперушка', //rue\n 'чолхалла', //ce\n 'шуко ончыктымаш-влак', //mhr\n 'მრავალმნიშვნელოვანი', //ka\n 'բազմիմաստութիւն', //hyw\n 'բազմիմաստություն', //hy\n 'באדייטן', //yi\n 'פירושונים', //he\n 'ابهام‌زدایی', //fa\n 'توضيح', //ar\n 'توضيح', //arz\n 'دقیقلشدیرمه', //azb\n 'ڕوونکردنەوە', //ckb\n 'سلجهائپ', //sd\n 'ضد ابہام', //ur\n 'گجگجی بیری', //mzn\n 'نامبهمېدنه', //ps\n 'መንታ', //am\n 'अस्पष्टता', //ne\n 'बहुअर्थी', //bh\n 'बहुविकल्पी शब्द', //hi\n 'দ্ব্যর্থতা নিরসন', //bn\n 'ਗੁੰਝਲ-ਖੋਲ੍ਹ', //pa\n 'સંદિગ્ધ શીર્ષક', //gu\n 'பக்கவழி நெறிப்படுத்தல்', //ta\n 'అయోమయ నివృత్తి', //te\n 'ದ್ವಂದ್ವ ನಿವಾರಣೆ', //kn\n 'വിവക്ഷകൾ', //ml\n 'වක්‍රෝත්ති', //si\n 'แก้ความกำกวม', //th\n 'သံတူကြောင်းကွဲ', //my\n 'ណែនាំ', //km\n '동음이의', //ko\n '扤清楚', //gan\n '搞清楚', //zh_yue\n '曖昧さ回避', //ja\n '消歧义', //zh\n '釋義', //zh_classical\n \"gestion dj'omònim\", //pms\n \"sut'ichana qillqa\" //qu\n // 'z', //vep\n // 'သဵင်မိူၼ် တူၼ်ႈထႅဝ်ပႅၵ်ႇ', //shn\n]\n","const i18n = require('../_data/disambig').reduce((h, str) => {\n h[str] = true\n return h\n}, {})\n\n//special disambig-templates en-wikipedia uses\nlet d = ' disambiguation'\nconst english = [\n 'dab',\n 'dab',\n 'disamb',\n 'disambig',\n 'geodis',\n 'hndis',\n 'setindex',\n 'ship index',\n 'split dab',\n 'sport index',\n 'wp disambig',\n 'disambiguation cleanup',\n 'airport' + d,\n 'biology' + d,\n 'call sign' + d,\n 'caselaw' + d,\n 'chinese title' + d,\n 'genus' + d,\n 'hospital' + d,\n 'lake index',\n 'letter' + d,\n 'letter-number combination' + d,\n 'mathematical' + d,\n 'military unit' + d,\n 'mountainindex',\n 'number' + d,\n 'phonetics' + d,\n 'place name' + d,\n 'portal' + d,\n 'road' + d,\n 'school' + d,\n 'species latin name abbreviation' + d,\n 'species latin name' + d,\n 'station' + d,\n 'synagogue' + d,\n 'taxonomic authority' + d,\n 'taxonomy' + d\n].reduce((h, str) => {\n h[str] = true\n return h\n}, {})\n\nconst isDisambig = function(doc) {\n let templates = doc.templates()\n let found = templates.find(obj => {\n return english.hasOwnProperty(obj.template) || i18n.hasOwnProperty(obj.template)\n })\n if (found) {\n return true\n }\n // try 'may refer to' on first line for en-wiki?\n let firstLine = doc.sentences(0).text()\n if (firstLine !== null && firstLine[0]) {\n if (/. may refer to ./i.test(firstLine) === true) {\n return true\n }\n }\n return false\n}\n\nmodule.exports = isDisambig\n","const setDefaults = require('../_lib/setDefaults')\n\nconst defaults = {\n caption: true,\n alt: true,\n links: true,\n thumb: true,\n url: true\n}\n//\nconst toJson = function(img, options) {\n options = setDefaults(options, defaults)\n let json = {\n file: img.file()\n }\n if (options.thumb !== false) {\n json.thumb = img.thumbnail()\n }\n if (options.url !== false) {\n json.url = img.url()\n }\n //add captions\n if (options.caption !== false && img.data.caption) {\n json.caption = img.caption()\n if (options.links !== false && img.data.caption.links()) {\n json.links = img.links()\n }\n }\n if (options.alt !== false && img.data.alt) {\n json.alt = img.alt()\n }\n return json\n}\nmodule.exports = toJson\n","const toJson = require('./toJson')\nconst server = 'https://wikipedia.org/wiki/Special:Redirect/file/'\n\nconst encodeTitle = function(file) {\n let title = file.replace(/^(image|file?)\\:/i, '')\n //titlecase it\n title = title.charAt(0).toUpperCase() + title.substring(1)\n //spaces to underscores\n title = title.trim().replace(/ /g, '_')\n return title\n}\n\n//the wikimedia image url is a little silly:\nconst makeSrc = function(file) {\n let title = encodeTitle(file)\n title = encodeURIComponent(title)\n return title\n}\n\n//the class for our image generation functions\nconst Image = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n file() {\n return this.data.file || ''\n },\n alt() {\n let str = this.data.alt || this.data.file || ''\n str = str.replace(/^(file|image):/i, '')\n str = str.replace(/\\.(jpg|jpeg|png|gif|svg)/i, '')\n return str.replace(/_/g, ' ')\n },\n caption() {\n if (this.data.caption) {\n return this.data.caption.text()\n }\n return ''\n },\n links() {\n if (this.data.caption) {\n return this.data.caption.links()\n }\n return []\n },\n url() {\n return server + makeSrc(this.file())\n },\n thumbnail(size) {\n size = size || 300\n let path = makeSrc(this.file())\n return server + path + '?width=' + size\n },\n format() {\n let arr = this.file().split('.')\n if (arr[arr.length - 1]) {\n return arr[arr.length - 1].toLowerCase()\n }\n return null\n },\n json: function(options) {\n options = options || {}\n return toJson(this, options)\n },\n text: function() {\n return ''\n }\n}\n\nObject.keys(methods).forEach(k => {\n Image.prototype[k] = methods[k]\n})\n\nImage.prototype.src = Image.prototype.url\nImage.prototype.thumb = Image.prototype.thumbnail\nmodule.exports = Image\n","const sectionMap = require('./_sectionMap')\nconst toJSON = require('./toJson')\nconst disambig = require('./disambig')\nconst setDefaults = require('../_lib/setDefaults')\nconst Image = require('../image/Image')\n\nconst defaults = {\n tables: true,\n lists: true,\n paragraphs: true\n}\n\n//\nconst Document = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n title: function(str) {\n //use like a setter\n if (str !== undefined) {\n this.data.title = str\n return str\n }\n //if we have it already\n if (this.data.title) {\n return this.data.title\n }\n //guess the title of this page from first sentence bolding\n let guess = null\n let sen = this.sentences(0)\n if (sen) {\n guess = sen.bolds(0)\n }\n return guess\n },\n pageID: function(id) {\n if (id !== undefined) {\n this.data.pageID = id\n }\n return this.data.pageID\n },\n language: function(lang) {\n if (lang !== undefined) {\n this.data.lang = lang\n }\n return this.data.lang\n },\n url: function() {\n let title = this.title()\n if (!title) {\n return null\n }\n let lang = this.language() || 'en'\n let domain = this.data.domain || 'wikipedia.org'\n // replace blank to underscore\n title = title.replace(/ /g, '_')\n title = encodeURIComponent(title)\n return `https://${lang}.${domain}.org/wiki/${title}`\n },\n namespace: function(ns) {\n if (ns !== undefined) {\n this.data.namespace = ns\n }\n return this.data.namespace\n },\n isRedirect: function() {\n return this.data.type === 'redirect'\n },\n redirectTo: function() {\n return this.data.redirectTo\n },\n isDisambiguation: function() {\n return disambig(this)\n },\n categories: function(clue) {\n if (typeof clue === 'number') {\n return this.data.categories[clue]\n }\n return this.data.categories || []\n },\n sections: function(clue) {\n let arr = this.data.sections || []\n arr.forEach(sec => (sec.doc = this))\n //grab a specific section, by its title\n if (typeof clue === 'string') {\n let str = clue.toLowerCase().trim()\n return arr.find(s => {\n return s.title().toLowerCase() === str\n })\n }\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n paragraphs: function(n) {\n let arr = []\n this.data.sections.forEach(s => {\n arr = arr.concat(s.paragraphs())\n })\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n paragraph: function(n) {\n let arr = this.paragraphs() || []\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr[0]\n },\n sentences: function(n) {\n let arr = []\n this.sections().forEach(sec => {\n arr = arr.concat(sec.sentences())\n })\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n sentence: function() {\n return this.sentences(0)\n },\n images: function(clue) {\n let arr = sectionMap(this, 'images', null)\n //grab image from infobox, first\n this.infoboxes().forEach(info => {\n let img = info.image()\n if (img) {\n arr.unshift(img) //put it at the top\n }\n })\n //look for 'gallery' templates, too\n this.templates().forEach(obj => {\n if (obj.template === 'gallery') {\n obj.images = obj.images || []\n obj.images.forEach(img => {\n if (img instanceof Image === false) {\n img = new Image(img)\n }\n arr.push(img)\n })\n }\n })\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n image: function() {\n return this.images(0)\n },\n links: function(clue) {\n return sectionMap(this, 'links', clue)\n },\n interwiki: function(clue) {\n return sectionMap(this, 'interwiki', clue)\n },\n lists: function(clue) {\n return sectionMap(this, 'lists', clue)\n },\n tables: function(clue) {\n return sectionMap(this, 'tables', clue)\n },\n templates: function(clue) {\n return sectionMap(this, 'templates', clue)\n },\n references: function(clue) {\n return sectionMap(this, 'references', clue)\n },\n coordinates: function(clue) {\n return sectionMap(this, 'coordinates', clue)\n },\n infoboxes: function(clue) {\n let arr = sectionMap(this, 'infoboxes')\n //sort them by biggest-first\n arr = arr.sort((a, b) => {\n if (Object.keys(a.data).length > Object.keys(b.data).length) {\n return -1\n }\n return 1\n })\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n text: function(options) {\n options = setDefaults(options, defaults)\n //nah, skip these.\n if (this.isRedirect() === true) {\n return ''\n }\n let arr = this.sections().map(sec => sec.text(options))\n return arr.join('\\n\\n')\n },\n json: function(options) {\n options = setDefaults(options, defaults)\n return toJSON(this, options)\n },\n debug: function() {\n console.log('\\n')\n this.sections().forEach(sec => {\n let indent = ' - '\n for (let i = 0; i < sec.depth; i += 1) {\n indent = ' -' + indent\n }\n console.log(indent + (sec.title() || '(Intro)'))\n })\n return this\n }\n}\n\nconst isArray = function(arr) {\n return Object.prototype.toString.call(arr) === '[object Array]'\n}\n//add singular-methods, too\nlet plurals = [\n 'sections',\n 'infoboxes',\n 'sentences',\n 'citations',\n 'references',\n 'coordinates',\n 'tables',\n 'lists',\n 'links',\n 'images',\n 'templates',\n 'categories'\n]\nplurals.forEach(fn => {\n let sing = fn.replace(/ies$/, 'y')\n sing = sing.replace(/oxes$/, 'ox')\n sing = sing.replace(/s$/, '')\n methods[sing] = function(n) {\n n = n || 0\n let res = this[fn](n)\n if (isArray(res)) {\n return res[0]\n }\n return res\n }\n})\n\nObject.keys(methods).forEach(k => {\n Document.prototype[k] = methods[k]\n})\n\n//alias these ones\nDocument.prototype.lang = Document.prototype.language\nDocument.prototype.ns = Document.prototype.namespace\nDocument.prototype.plaintext = Document.prototype.text\nDocument.prototype.isDisambig = Document.prototype.isDisambiguation\nDocument.prototype.citations = Document.prototype.references\nDocument.prototype.redirectsTo = Document.prototype.redirectTo\nDocument.prototype.redirect = Document.prototype.redirectTo\nDocument.prototype.redirects = Document.prototype.redirectTo\n\nmodule.exports = Document\n","module.exports = [\n 'category', //en\n\n 'abdeeling', //\tpdc\n 'bólkur', //\tfo\n 'catagóir', //\tga\n 'categori', //\tcy\n 'categoria',\n 'categoria', //\tco\n 'categoría', //\tes\n 'categorîa', //\tlij\n 'categorìa', //\tpms\n 'catégorie',\n 'categorie',\n 'catègorie', //\tfrp\n 'category',\n 'categuria', //\tlmo\n 'catigurìa', //\tscn\n 'class', //\tkw\n 'ẹ̀ka', //\tyo\n 'flocc',\n 'flocc', //\tang\n 'flokkur',\n 'grup', //\ttpi\n 'jamii', //\tsw\n 'kaarangay', //\twar\n 'kateggoría', //\tlad\n 'kategooria', //\tet\n 'kategori', //\tda\n 'kategorî', //\tku\n 'kategoria', //\teu\n 'kategória', //\thu\n 'kategorie', //de\n 'kategoriija', //\tse\n 'kategorija', //\tsl\n 'kategorio', //\teo\n 'kategoriya',\n 'kategoriýa', //\ttk\n 'kategoriye', //\tdiq\n 'kategory', //\tfy\n 'kategorya', //\ttl\n 'kateqoriya', //\taz\n 'katiguriya', //\tqu\n 'klad', //\tvo\n 'luokka',\n 'ñemohenda', //\tgn\n 'roinn', //-seòrsa\tgd\n 'ronney', //\tgv\n 'rummad', //\tbr\n 'setensele', //\tnso\n 'sokajy', //\tmg\n 'sumut', // atassuseq\tkl\n 'thể', // loại\tvi\n 'turkum', //\tuz\n 'категорија',\n 'категория', //\tru\n 'категорія', //\tuk\n 'катэгорыя',\n 'төркем', //\ttt\n 'קטגוריה', //\the\n 'تصنيف',\n 'تۈر', //\tug\n 'رده',\n 'श्रेणी',\n 'श्रेणी', //\thi\n 'বিষয়শ্রেণী', //\tbn\n 'หมวดหมู่', //\tth\n '분류', //\tko\n '분류', //ko\n '分类' //\tza\n //--\n]\n","module.exports = [\n 'file', //en\n 'image', //en\n 'चित्र', //img\n\n 'archivo', //es\n 'attēls', //lv\n 'berkas', //id\n 'bestand', //nl\n 'datei', //de\n 'dosiero', //eo\n 'dosya', //lad\n 'fájl', //hu\n 'fasciculus', //la\n 'fichier', //fr\n 'fil', //da\n 'fitxategi', //eu\n 'fitxer', //ca\n 'gambar', //su\n 'imagem', //pt\n 'imej', //ms\n 'immagine', //it\n 'larawan', //tl\n 'lêer', //af\n 'plik', //pl\n 'restr', //br\n 'slika', //bs\n 'wêne', //ku\n 'wobraz', //dsb\n 'выява', //be\n 'податотека', //mk\n 'слика', //sr\n 'файл', //ru\n 'სურათი', //ka\n 'պատկեր', //hy\n 'קובץ', //he\n 'پرونده', //fa\n 'دوتنه', //ps\n 'ملف', //ar\n 'وێنە', //ckb\n 'चित्र', //hi\n 'ไฟล์', //th\n '파일', //ko\n 'ファイル' //ja\n]\n","module.exports = [\n 'infobox', //en\n\n 'anfo', //mwl\n 'anuāmapa', //haw\n 'bilgi kutusu', //tr\n 'bilgi', //tr\n 'bilgiquti', //uz\n 'boaty', //mg\n 'boestkelaouiñ', //br\n 'bosca', //ga\n 'capsa', //la\n 'diehtokássa', //se\n 'faktamall', //sv\n 'ficha', //es\n 'generalni', //hr\n 'gwybodlen3', //cy\n 'info', //pt\n 'infobokis', //tpi\n 'infoboks', //da\n 'infochascha', //rm\n 'infokašćik', //dsb\n 'infokast', //et\n 'infokutija', //bs\n 'infolentelė', //lt\n 'infopolje', //sl\n 'informkesto', //eo\n 'infoskreine', //ltg\n 'infotaula', //eu\n 'inligtingskas',\n 'inligtingskas3', //af\n 'inligtingskas4', //af\n 'kishtey', //gv\n 'kotak', //su\n 'tertcita', //jbo\n 'tietolaatikko', //fi\n 'yerleşim bilgi kutusu',\n 'ynfoboks', //fy\n 'πλαίσιο', //el\n 'акарточка', //ab\n 'аҥа', //mhr\n 'инфобокс', //kk\n 'инфокутија', //sr\n 'инфокутия', //bg\n 'інфобокс', //rue\n 'канадский',\n 'картка', //be\n 'карточка', //ru\n 'карточка2', //mdf\n 'карточкарус', //ba\n 'картуш', //koi\n 'қуттӣ', //tg\n 'ინფოდაფა', //ka\n 'տեղեկաքարտ', //hy\n 'אינפאקעסטל', //yi\n 'תבנית', //he\n 'بطاقة', //ar\n 'ڄاڻخانو', //sd\n 'خانہ', //ur\n 'لغة',\n 'ज्ञानसन्दूक', //hi\n 'তথ্যছক', //bn\n 'ਜਾਣਕਾਰੀਡੱਬਾ', //pa\n 'సమాచారపెట్టె', //te\n 'තොරතුරුකොටුව', //si\n 'กล่องข้อมูล', //th\n 'ប្រអប់ព័ត៌មាន', //km\n '정보상자', //ko\n '明細' //zh_yue\n]\n","module.exports = [\n 'adkas', //br\n 'aýdaw',\n 'doorverwijzing',\n 'ohjaus',\n 'patrz', //pl\n 'přesměruj',\n 'redirección',\n 'redireccion',\n 'redirección', //es\n 'redirecionamento', //pt\n 'redirect', //en\n 'redirection',\n 'redirection', //fr\n 'rinvia', //it\n 'tilvísun',\n 'uudelleenohjaus',\n 'weiterleitung',\n 'weiterleitung', //de\n 'yönlendi̇r',\n 'yönlendirme',\n 'yönlendi̇rme', //tr\n 'ανακατευθυνση', //el\n 'айдау',\n 'перанакіраваньне',\n 'перенаправлення', //uk\n 'пренасочување', //mk\n 'преусмери',\n 'преусмјери',\n 'تغییر_مسیر',\n 'تغییرمسیر',\n 'تغییرمسیر', //fa\n 'เปลี่ยนทาง', //th\n 'ប្តូរទីតាំងទៅ', //km\n '転送', //ja\n '重定向'\n]\n","module.exports = [\n 'references',\n 'reference',\n 'einzelnachweise',\n 'referencias',\n 'références',\n 'notes et références',\n '脚注',\n 'referenser',\n 'bronnen',\n 'примечания'\n]\n","// wikipedia special terms lifted and augmented from parsoid parser april 2015\n// and then manually on March 2020\nmodule.exports = {\n categories: require('./categories'),\n disambig: require('./disambig'),\n images: require('./images'),\n infoboxes: require('./infoboxes'),\n redirects: require('./redirects'),\n references: require('./references')\n\n // specials: [\n // 'спэцыяльныя',\n // 'especial',\n // 'speciální',\n // 'spezial',\n // 'special',\n // 'ویژه',\n // 'toiminnot',\n // 'kerfissíða',\n // 'arnawlı',\n // 'spécial',\n // 'speciaal',\n // 'посебно',\n // 'özel',\n // '特別'\n // ],\n // users: [\n // 'удзельнік',\n // 'usuari',\n // 'uživatel',\n // 'benutzer',\n // 'user',\n // 'usuario',\n // 'کاربر',\n // 'käyttäjä',\n // 'notandi',\n // 'paydalanıwshı',\n // 'utilisateur',\n // 'gebruiker',\n // 'корисник',\n // 'kullanıcı',\n // '利用者'\n // ],\n // sources: [\n // //blacklist these headings, as they're not plain-text\n // 'references',\n // 'see also',\n // 'external links',\n // 'further reading',\n // 'notes et références',\n // 'voir aussi',\n // 'liens externes',\n // '参考文献', //references (ja)\n // '脚注', //citations (ja)\n // '関連項目', //see also (ja)\n // '外部リンク' //external links (ja)\n // ]\n}\n","module.exports = {\n aa: 'Afar', //Afar\n ab: 'Аҧсуа', //Abkhazian\n af: 'Afrikaans', //Afrikaans\n ak: 'Akana', //Akan\n als: 'Alemannisch', //Alemannic\n am: 'አማርኛ', //Amharic\n an: 'Aragonés', //Aragonese\n ang: 'Englisc', //Anglo-Saxon\n ar: 'العربية', //Arabic\n arc: 'ܣܘܪܬ', //Aramaic\n as: 'অসমীয়া', //Assamese\n ast: 'Asturianu', //Asturian\n av: 'Авар', //Avar\n ay: 'Aymar', //Aymara\n az: 'Azərbaycanca', //Azerbaijani\n ba: 'Башҡорт', //Bashkir\n bar: 'Boarisch', //Bavarian\n 'bat-smg': 'Žemaitėška', //Samogitian\n bcl: 'Bikol', //Bikol\n be: 'Беларуская', //Belarusian\n 'be-x-old': 'ltr', //Belarusian\n bg: 'Български', //Bulgarian\n bh: 'भोजपुरी', //Bihari\n bi: 'Bislama', //Bislama\n bm: 'Bamanankan', //Bambara\n bn: 'বাংলা', //Bengali\n bo: 'བོད་ཡིག', //Tibetan\n bpy: 'ltr', //Bishnupriya\n br: 'Brezhoneg', //Breton\n bs: 'Bosanski', //Bosnian\n bug: 'ᨅᨔ', //Buginese\n bxr: 'ltr', //Buriat\n ca: 'Català', //Catalan\n cdo: 'Chinese', //Min\n ce: 'Нохчийн', //Chechen\n ceb: 'Sinugboanong', //Cebuano\n ch: 'Chamoru', //Chamorro\n cho: 'Choctaw', //Choctaw\n chr: 'ᏣᎳᎩ', //Cherokee\n chy: 'Tsetsêhestâhese', //Cheyenne\n co: 'Corsu', //Corsican\n cr: 'Nehiyaw', //Cree\n cs: 'Česky', //Czech\n csb: 'Kaszëbsczi', //Kashubian\n cu: 'Slavonic', //Old\n cv: 'Чăваш', //Chuvash\n cy: 'Cymraeg', //Welsh\n da: 'Dansk', //Danish\n de: 'Deutsch', //German\n diq: 'Zazaki', //Dimli\n dsb: 'ltr', //Lower\n dv: 'ދިވެހިބަސް', //Divehi\n dz: 'ཇོང་ཁ', //Dzongkha\n ee: 'Ɛʋɛ', //Ewe\n far: 'فارسی', //Farsi\n el: 'Ελληνικά', //Greek\n en: 'English', //English\n eo: 'Esperanto', //Esperanto\n es: 'Español', //Spanish\n et: 'Eesti', //Estonian\n eu: 'Euskara', //Basque\n ext: 'Estremeñu', //Extremaduran\n ff: 'Fulfulde', //Peul\n fi: 'Suomi', //Finnish\n 'fiu-vro': 'Võro', //Võro\n fj: 'Na', //Fijian\n fo: 'Føroyskt', //Faroese\n fr: 'Français', //French\n frp: 'Arpitan', //Arpitan\n fur: 'Furlan', //Friulian\n fy: 'ltr', //West\n ga: 'Gaeilge', //Irish\n gan: 'ltr', //Gan\n gd: 'ltr', //Scottish\n gil: 'Taetae', //Gilbertese\n gl: 'Galego', //Galician\n gn: \"Avañe'ẽ\", //Guarani\n got: 'gutisk', //Gothic\n gu: 'ગુજરાતી', //Gujarati\n gv: 'Gaelg', //Manx\n ha: 'هَوُسَ', //Hausa\n hak: 'ltr', //Hakka\n haw: 'Hawai`i', //Hawaiian\n he: 'עברית', //Hebrew\n hi: 'हिन्दी', //Hindi\n ho: 'ltr', //Hiri\n hr: 'Hrvatski', //Croatian\n ht: 'Krèyol', //Haitian\n hu: 'Magyar', //Hungarian\n hy: 'Հայերեն', //Armenian\n hz: 'Otsiherero', //Herero\n ia: 'Interlingua', //Interlingua\n id: 'Bahasa', //Indonesian\n ie: 'Interlingue', //Interlingue\n ig: 'Igbo', //Igbo\n ii: 'ltr', //Sichuan\n ik: 'Iñupiak', //Inupiak\n ilo: 'Ilokano', //Ilokano\n io: 'Ido', //Ido\n is: 'Íslenska', //Icelandic\n it: 'Italiano', //Italian\n iu: 'ᐃᓄᒃᑎᑐᑦ', //Inuktitut\n ja: '日本語', //Japanese\n jbo: 'Lojban', //Lojban\n jv: 'Basa', //Javanese\n ka: 'ქართული', //Georgian\n kg: 'KiKongo', //Kongo\n ki: 'Gĩkũyũ', //Kikuyu\n kj: 'Kuanyama', //Kuanyama\n kk: 'Қазақша', //Kazakh\n kl: 'Kalaallisut', //Greenlandic\n km: 'ភាសាខ្មែរ', //Cambodian\n kn: 'ಕನ್ನಡ', //Kannada\n khw: 'کھوار', //Khowar\n ko: '한국어', //Korean\n kr: 'Kanuri', //Kanuri\n ks: 'कश्मीरी', //Kashmiri\n ksh: 'Ripoarisch', //Ripuarian\n ku: 'Kurdî', //Kurdish\n kv: 'Коми', //Komi\n kw: 'Kernewek', //Cornish\n ky: 'Kırgızca', //Kirghiz\n la: 'Latina', //Latin\n lad: 'Dzhudezmo', //Ladino\n lan: 'Leb', //Lango\n lb: 'Lëtzebuergesch', //Luxembourgish\n lg: 'Luganda', //Ganda\n li: 'Limburgs', //Limburgian\n lij: 'Líguru', //Ligurian\n lmo: 'Lumbaart', //Lombard\n ln: 'Lingála', //Lingala\n lo: 'ລາວ', //Laotian\n lt: 'Lietuvių', //Lithuanian\n lv: 'Latviešu', //Latvian\n 'map-bms': 'Basa', //Banyumasan\n mg: 'Malagasy', //Malagasy\n man: '官話', //Mandarin\n mh: 'Kajin', //Marshallese\n mi: 'Māori', //Maori\n min: 'Minangkabau', //Minangkabau\n mk: 'Македонски', //Macedonian\n ml: 'മലയാളം', //Malayalam\n mn: 'Монгол', //Mongolian\n mo: 'Moldovenească', //Moldovan\n mr: 'मराठी', //Marathi\n ms: 'Bahasa', //Malay\n mt: 'bil-Malti', //Maltese\n mus: 'Muskogee', //Creek\n my: 'Myanmasa', //Burmese\n na: 'Dorerin', //Nauruan\n nah: 'Nahuatl', //Nahuatl\n nap: 'Nnapulitano', //Neapolitan\n nd: 'ltr', //North\n nds: 'Plattdüütsch', //Low German\n 'nds-nl': 'Saxon', //Dutch\n ne: 'नेपाली', //Nepali\n new: 'नेपालभाषा', //Newar\n ng: 'Oshiwambo', //Ndonga\n nl: 'Nederlands', //Dutch\n nn: 'ltr', //Norwegian\n no: 'Norsk', //Norwegian\n nr: 'ltr', //South\n nso: 'ltr', //Northern\n nrm: 'Nouormand', //Norman\n nv: 'Diné', //Navajo\n ny: 'Chi-Chewa', //Chichewa\n oc: 'Occitan', //Occitan\n oj: 'ᐊᓂᔑᓈᐯᒧᐎᓐ', //Ojibwa\n om: 'Oromoo', //Oromo\n or: 'ଓଡ଼ିଆ', //Oriya\n os: 'Иронау', //Ossetian\n pa: 'ਪੰਜਾਬੀ', //Panjabi\n pag: 'Pangasinan', //Pangasinan\n pam: 'Kapampangan', //Kapampangan\n pap: 'Papiamentu', //Papiamentu\n pdc: 'ltr', //Pennsylvania\n pi: 'Pāli', //Pali\n pih: 'Norfuk', //Norfolk\n pl: 'Polski', //Polish\n pms: 'Piemontèis', //Piedmontese\n ps: 'پښتو', //Pashto\n pt: 'Português', //Portuguese\n qu: 'Runa', //Quechua\n rm: 'ltr', //Raeto\n rmy: 'Romani', //Romani\n rn: 'Kirundi', //Kirundi\n ro: 'Română', //Romanian\n 'roa-rup': 'Armâneashti', //Aromanian\n ru: 'Русский', //Russian\n rw: 'Kinyarwandi', //Rwandi\n sa: 'संस्कृतम्', //Sanskrit\n sc: 'Sardu', //Sardinian\n scn: 'Sicilianu', //Sicilian\n sco: 'Scots', //Scots\n sd: 'सिनधि', //Sindhi\n se: 'ltr', //Northern\n sg: 'Sängö', //Sango\n sh: 'Srpskohrvatski', //Serbo-Croatian\n si: 'සිංහල', //Sinhalese\n simple: 'ltr', //Simple\n sk: 'Slovenčina', //Slovak\n sl: 'Slovenščina', //Slovenian\n sm: 'Gagana', //Samoan\n sn: 'chiShona', //Shona\n so: 'Soomaaliga', //Somalia\n sq: 'Shqip', //Albanian\n sr: 'Српски', //Serbian\n ss: 'SiSwati', //Swati\n st: 'ltr', //Southern\n su: 'Basa', //Sundanese\n sv: 'Svenska', //Swedish\n sw: 'Kiswahili', //Swahili\n ta: 'தமிழ்', //Tamil\n te: 'తెలుగు', //Telugu\n tet: 'Tetun', //Tetum\n tg: 'Тоҷикӣ', //Tajik\n th: 'ไทย', //Thai\n ti: 'ትግርኛ', //Tigrinya\n tk: 'Туркмен', //Turkmen\n tl: 'Tagalog', //Tagalog\n tlh: 'tlhIngan-Hol', //Klingon\n tn: 'Setswana', //Tswana\n to: 'Lea', //Tonga\n tpi: 'ltr', //Tok\n tr: 'Türkçe', //Turkish\n ts: 'Xitsonga', //Tsonga\n tt: 'Tatarça', //Tatar\n tum: 'chiTumbuka', //Tumbuka\n tw: 'Twi', //Twi\n ty: 'Reo', //Tahitian\n udm: 'Удмурт', //Udmurt\n ug: 'Uyƣurqə', //Uyghur\n uk: 'Українська', //Ukrainian\n ur: 'اردو', //Urdu\n uz: 'Ўзбек', //Uzbek\n ve: 'Tshivenḓa', //Venda\n vi: 'Việtnam', //Vietnamese\n vec: 'Vèneto', //Venetian\n vls: 'ltr', //West\n vo: 'Volapük', //Volapük\n wa: 'Walon', //Walloon\n war: 'Winaray', //Waray-Waray\n wo: 'Wollof', //Wolof\n xal: 'Хальмг', //Kalmyk\n xh: 'isiXhosa', //Xhosa\n yi: 'ייִדיש', //Yiddish\n yo: 'Yorùbá', //Yoruba\n za: 'Cuengh', //Zhuang\n zh: '中文', //Chinese\n 'zh-classical': 'ltr', //Classical\n 'zh-min-nan': 'Bân-lâm-gú', //Minnan\n 'zh-yue': '粵語', //Cantonese\n zu: 'isiZulu' //Zulu\n}\n","const wp = '.wikipedia.org/wiki/$1'\nconst wm = '.wikimedia.org/wiki/$1'\nconst w = 'www.'\n\nmodule.exports = {\n acronym: w + 'acronymfinder.com/$1.html',\n advisory: 'advisory' + wm,\n advogato: w + 'advogato.org/$1',\n aew: 'wiki.arabeyes.org/$1',\n appropedia: w + 'appropedia.org/$1',\n aquariumwiki: w + 'theaquariumwiki.com/$1',\n arborwiki: 'localwiki.org/ann-arbor/$1',\n arxiv: 'arxiv.org/abs/$1',\n atmwiki: w + 'otterstedt.de/wiki/index.php/$1',\n baden: w + 'stadtwiki-baden-baden.de/wiki/$1/',\n battlestarwiki: 'en.battlestarwiki.org/wiki/$1',\n bcnbio: 'historiapolitica.bcn.cl/resenas_parlamentarias/wiki/$1',\n beacha: w + 'beachapedia.org/$1',\n betawiki: 'translatewiki.net/wiki/$1',\n bibcode: 'adsabs.harvard.edu/abs/$1',\n bibliowiki: 'wikilivres.org/wiki/$1',\n bluwiki: 'bluwiki.com/go/$1',\n blw: 'britainloves' + wp,\n botwiki: 'botwiki.sno.cc/wiki/$1',\n boxrec: w + 'boxrec.com/media/index.php?$1',\n brickwiki: w + 'brickwiki.info/wiki/$1',\n bugzilla: 'bugzilla.wikimedia.org/show_bug.cgi?id=$1',\n bulba: 'bulbapedia.bulbagarden.net/wiki/$1',\n c: 'commons' + wm,\n c2: 'c2.com/cgi/wiki?$1',\n c2find: 'c2.com/cgi/wiki?FindPage&value=$1',\n cache: w + 'google.com/search?q=cache:$1',\n ĉej: 'esperanto.blahus.cz/cxej/vikio/index.php/$1',\n cellwiki: 'cell.wikia.com/wiki/$1',\n centralwikia: 'community.wikia.com/wiki/$1',\n chej: 'esperanto.blahus.cz/cxej/vikio/index.php/$1',\n choralwiki: w + 'cpdl.org/wiki/index.php/$1',\n citizendium: 'en.citizendium.org/wiki/$1',\n ckwiss: w + 'ck-wissen.de/ckwiki/index.php?title=$1',\n comixpedia: w + 'comixpedia.org/index.php?title=$1',\n commons: 'commons' + wm,\n communityscheme: 'community.schemewiki.org/?c=s&key=$1',\n communitywiki: 'communitywiki.org/$1',\n comune: 'rete.comuni-italiani.it/wiki/$1',\n creativecommons: 'creativecommons.org/licenses/$1',\n creativecommonswiki: 'wiki.creativecommons.org/$1',\n cxej: 'esperanto.blahus.cz/cxej/vikio/index.php/$1',\n dcc: w + 'dccwiki.com/$1',\n dcdatabase: 'dc.wikia.com/$1',\n dcma: 'christian-morgenstern.de/dcma/index.php?title=$1',\n debian: 'wiki.debian.org/$1',\n delicious: w + 'delicious.com/tag/$1',\n devmo: 'developer.mozilla.org/en/docs/$1',\n dictionary: w + 'dict.org/bin/Dict?Database=*&Form=Dict1&Strategy=*&Query=$1',\n dict: w + 'dict.org/bin/Dict?Database=*&Form=Dict1&Strategy=*&Query=$1',\n disinfopedia: 'sourcewatch.org/index.php/$1',\n distributedproofreaders: w + 'pgdp.net/wiki/$1',\n distributedproofreadersca: w + 'pgdpcanada.net/wiki/index.php/$1',\n dmoz: 'curlie.org/$1',\n dmozs: 'curlie.org/search?q=$1',\n doi: 'doi.org/$1',\n donate: 'donate' + wm,\n doom_wiki: 'doom.wikia.com/wiki/$1',\n download: 'releases.wikimedia.org/$1',\n dbdump: 'dumps.wikimedia.org/$1/latest/',\n dpd: 'lema.rae.es/dpd/?key=$1',\n drae: 'dle.rae.es/?w=$1',\n dreamhost: 'wiki.dreamhost.com/index.php/$1',\n drumcorpswiki: w + 'drumcorpswiki.com/index.php/$1',\n dwjwiki: w + 'suberic.net/cgi-bin/dwj/wiki.cgi?$1',\n eĉei: w + 'ikso.net/cgi-bin/wiki.pl?$1',\n ecoreality: w + 'EcoReality.org/wiki/$1',\n ecxei: w + 'ikso.net/cgi-bin/wiki.pl?$1',\n elibre: 'enciclopedia.us.es/index.php/$1',\n emacswiki: w + 'emacswiki.org/emacs?$1',\n encyc: 'encyc.org/wiki/$1',\n energiewiki: w + 'netzwerk-energieberater.de/wiki/index.php/$1',\n englyphwiki: 'en.glyphwiki.org/wiki/$1',\n enkol: 'enkol.pl/$1',\n eokulturcentro: 'esperanto.toulouse.free.fr/nova/wikini/wakka.php?wiki=$1',\n esolang: 'esolangs.org/wiki/$1',\n etherpad: 'etherpad.wikimedia.org/$1',\n ethnologue: w + 'ethnologue.com/language/$1',\n ethnologuefamily: w + 'ethnologue.com/show_family.asp?subid=$1',\n evowiki: 'wiki.cotch.net/index.php/$1',\n exotica: w + 'exotica.org.uk/wiki/$1',\n fanimutationwiki: 'wiki.animutationportal.com/index.php/$1',\n fedora: 'fedoraproject.org/wiki/$1',\n finalfantasy: 'finalfantasy.wikia.com/wiki/$1',\n finnix: w + 'finnix.org/$1',\n flickruser: w + 'flickr.com/people/$1',\n flickrphoto: w + 'flickr.com/photo.gne?id=$1',\n floralwiki: w + 'floralwiki.co.uk/wiki/$1',\n foldoc: 'foldoc.org/$1',\n foundation: 'foundation' + wm,\n foundationsite: 'wikimediafoundation.org/$1',\n foxwiki: 'fox.wikis.com/wc.dll?Wiki~$1',\n freebio: 'freebiology.org/wiki/$1',\n freebsdman: w + 'FreeBSD.org/cgi/man.cgi?apropos=1&query=$1',\n freeculturewiki: 'wiki.freeculture.org/index.php/$1',\n freedomdefined: 'freedomdefined.org/$1',\n freefeel: 'freefeel.org/wiki/$1',\n freekiwiki: 'wiki.freegeek.org/index.php/$1',\n // freenode: 'irc://irc.freenode.net/$1',\n freesoft: 'directory.fsf.org/wiki/$1',\n ganfyd: 'ganfyd.org/index.php?title=$1',\n gardenology: w + 'gardenology.org/wiki/$1',\n gausswiki: 'gauss.ffii.org/$1',\n gentoo: 'wiki.gentoo.org/wiki/$1',\n genwiki: 'wiki.genealogy.net/index.php/$1',\n gerrit: 'gerrit.wikimedia.org/r/$1',\n git: 'gerrit.wikimedia.org/g/$1',\n google: w + 'google.com/search?q=$1',\n googledefine: w + 'google.com/search?q=define:$1',\n googlegroups: 'groups.google.com/groups?q=$1',\n guildwarswiki: 'wiki.guildwars.com/wiki/$1',\n guildwiki: 'guildwars.wikia.com/wiki/$1',\n guc: 'tools.wmflabs.org/guc/?user=$1',\n gucprefix: 'tools.wmflabs.org/guc/?isPrefixPattern=1&src=rc&user=$1',\n gutenberg: w + 'gutenberg.org/etext/$1',\n gutenbergwiki: w + 'gutenberg.org/wiki/$1',\n hackerspaces: 'hackerspaces.org/wiki/$1',\n h2wiki: 'halowiki.net/p/$1',\n hammondwiki: w + 'dairiki.org/HammondWiki/index.php3?$1',\n hdl: 'hdl.handle.net/$1',\n heraldik: 'heraldik-wiki.de/wiki/$1',\n heroeswiki: 'heroeswiki.com/$1',\n horizonlabs: 'horizon.wikimedia.org/$1',\n hrwiki: w + 'hrwiki.org/index.php/$1',\n hrfwiki: 'fanstuff.hrwiki.org/index.php/$1',\n hupwiki: 'wiki.hup.hu/index.php/$1',\n iarchive: 'archive.org/details/$1',\n imdbname: w + 'imdb.com/name/nm$1/',\n imdbtitle: w + 'imdb.com/title/tt$1/',\n imdbcompany: w + 'imdb.com/company/co$1/',\n imdbcharacter: w + 'imdb.com/character/ch$1/',\n incubator: 'incubator' + wm,\n infosecpedia: 'infosecpedia.org/wiki/$1',\n infosphere: 'theinfosphere.org/$1',\n // irc: 'irc://irc.freenode.net/$1',\n // ircs: 'ircs://irc.freenode.net/$1',\n // ircrc: 'irc://irc.wikimedia.org/$1',\n // rcirc: 'irc://irc.wikimedia.org/$1',\n 'iso639-3': 'iso639-3.sil.org/code/$1',\n issn: w + 'worldcat.org/issn/$1',\n iuridictum: 'iuridictum.pecina.cz/w/$1',\n jaglyphwiki: 'glyphwiki.org/wiki/$1',\n jefo: 'esperanto-jeunes.org/wiki/$1',\n jerseydatabase: 'jerseydatabase.com/wiki.php?id=$1',\n jira: 'jira.toolserver.org/browse/$1',\n jspwiki: w + 'ecyrd.com/JSPWiki/Wiki.jsp?page=$1',\n jstor: w + 'jstor.org/journals/$1',\n kamelo: 'kamelopedia.mormo.org/index.php/$1',\n karlsruhe: 'ka.stadtwiki.net/$1',\n kinowiki: 'kino.skripov.com/index.php/$1',\n komicawiki: 'wiki.komica.org/?$1',\n kontuwiki: 'kontu.wiki/$1',\n wikitech: 'wikitech' + wm,\n libreplanet: 'libreplanet.org/wiki/$1',\n linguistlist: 'linguistlist.org/forms/langs/LLDescription.cfm?code=$1',\n linuxwiki: w + 'linuxwiki.de/$1',\n linuxwikide: w + 'linuxwiki.de/$1',\n liswiki: 'liswiki.org/wiki/$1',\n literateprograms: 'en.literateprograms.org/$1',\n livepedia: w + 'livepedia.gr/index.php?title=$1',\n localwiki: 'localwiki.org/$1',\n lojban: 'mw.lojban.org/papri/$1',\n lostpedia: 'lostpedia.wikia.com/wiki/$1',\n lqwiki: 'wiki.linuxquestions.org/wiki/$1',\n luxo: 'tools.wmflabs.org/guc/?user=$1',\n mail: 'lists.wikimedia.org/mailman/listinfo/$1',\n mailarchive: 'lists.wikimedia.org/pipermail/$1',\n mariowiki: w + 'mariowiki.com/$1',\n marveldatabase: w + 'marveldatabase.com/wiki/index.php/$1',\n meatball: 'meatballwiki.org/wiki/$1',\n mw: w + 'mediawiki.org/wiki/$1',\n mediazilla: 'bugzilla.wikimedia.org/$1',\n memoryalpha: 'memory-alpha.fandom.com/wiki/$1',\n metawiki: 'meta' + wm,\n metawikimedia: 'meta' + wm,\n metawikipedia: 'meta' + wm,\n mineralienatlas: w + 'mineralienatlas.de/lexikon/index.php/$1',\n moinmoin: 'moinmo.in/$1',\n monstropedia: w + 'monstropedia.org/?title=$1',\n mosapedia: 'mosapedia.de/wiki/index.php/$1',\n mozcom: 'mozilla.wikia.com/wiki/$1',\n mozillawiki: 'wiki.mozilla.org/$1',\n mozillazinekb: 'kb.mozillazine.org/$1',\n musicbrainz: 'musicbrainz.org/doc/$1',\n mediawikiwiki: w + 'mediawiki.org/wiki/$1',\n mwod: w + 'merriam-webster.com/dictionary/$1',\n mwot: w + 'merriam-webster.com/thesaurus/$1',\n nkcells: w + 'nkcells.info/index.php?title=$1',\n nara: 'catalog.archives.gov/id/$1',\n nosmoke: 'no-smok.net/nsmk/$1',\n nost: 'nostalgia.' + wp,\n nostalgia: 'nostalgia.' + wp,\n oeis: 'oeis.org/$1',\n oldwikisource: 'wikisource.org/wiki/$1',\n olpc: 'wiki.laptop.org/go/$1',\n omegawiki: w + 'omegawiki.org/Expression:$1',\n onelook: w + 'onelook.com/?ls=b&w=$1',\n openlibrary: 'openlibrary.org/$1',\n openstreetmap: 'wiki.openstreetmap.org/wiki/$1',\n openwetware: 'openwetware.org/wiki/$1',\n opera7wiki: 'operawiki.info/$1',\n organicdesign: w + 'organicdesign.co.nz/$1',\n orthodoxwiki: 'orthodoxwiki.org/$1',\n osmwiki: 'wiki.openstreetmap.org/wiki/$1',\n otrs: 'ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom&TicketID=$1',\n otrswiki: 'otrs-wiki' + wm,\n ourmedia: w + 'socialtext.net/ourmedia/index.cgi?$1',\n outreach: 'outreach' + wm,\n outreachwiki: 'outreach' + wm,\n owasp: w + 'owasp.org/index.php/$1',\n panawiki: 'wiki.alairelibre.net/index.php?title=$1',\n patwiki: 'gauss.ffii.org/$1',\n personaltelco: 'personaltelco.net/wiki/$1',\n petscan: 'petscan.wmflabs.org/?psid=$1',\n phab: 'phabricator.wikimedia.org/$1',\n phabricator: 'phabricator.wikimedia.org/$1',\n phwiki: w + 'pocketheaven.com/ph/wiki/index.php?title=$1',\n phpwiki: 'phpwiki.sourceforge.net/phpwiki/index.php?$1',\n planetmath: 'planetmath.org/node/$1',\n pmeg: w + 'bertilow.com/pmeg/$1',\n pmid: w + 'ncbi.nlm.nih.gov/pubmed/$1?dopt=Abstract',\n pokewiki: 'pokewiki.de/$1',\n pokéwiki: 'pokewiki.de/$1',\n policy: 'policy.wikimedia.org/$1',\n proofwiki: w + 'proofwiki.org/wiki/$1',\n pyrev: w + 'mediawiki.org/wiki/Special:Code/pywikipedia/$1',\n pythoninfo: 'wiki.python.org/moin/$1',\n pythonwiki: w + 'pythonwiki.de/$1',\n pywiki: 'c2.com/cgi/wiki?$1',\n psycle: 'psycle.sourceforge.net/wiki/$1',\n quality: 'quality' + wm,\n quarry: 'quarry.wmflabs.org/$1',\n regiowiki: 'regiowiki.at/wiki/$1',\n rev: w + 'mediawiki.org/wiki/Special:Code/MediaWiki/$1',\n revo: 'purl.org/NET/voko/revo/art/$1.html',\n rfc: 'tools.ietf.org/html/rfc$1',\n rheinneckar: 'rhein-neckar-wiki.de/$1',\n robowiki: 'robowiki.net/?$1',\n rodovid: 'en.rodovid.org/wk/$1',\n reuterswiki: 'glossary.reuters.com/index.php/$1',\n rowiki: 'wiki.rennkuckuck.de/index.php/$1',\n rt: 'rt.wikimedia.org/Ticket/Display.html?id=$1',\n // rtfm: 'ftp://rtfm.mit.edu/pub/faqs/$1',\n s23wiki: 's23.org/wiki/$1',\n scholar: 'scholar.google.com/scholar?q=$1',\n schoolswp: 'schools-' + wp,\n scores: 'imslp.org/wiki/$1',\n scoutwiki: 'en.scoutwiki.org/$1',\n scramble: w + 'scramble.nl/wiki/index.php?title=$1',\n seapig: w + 'seapig.org/$1',\n seattlewiki: 'seattle.wikia.com/wiki/$1',\n slwiki: 'wiki.secondlife.com/wiki/$1',\n 'semantic-mw': w + 'semantic-mediawiki.org/wiki/$1',\n senseislibrary: 'senseis.xmp.net/?$1',\n sharemap: 'sharemap.org/$1',\n silcode: w + 'sil.org/iso639-3/documentation.asp?id=$1',\n slashdot: 'slashdot.org/article.pl?sid=$1',\n sourceforge: 'sourceforge.net/$1',\n spcom: 'spcom' + wm,\n species: 'species' + wm,\n squeak: 'wiki.squeak.org/squeak/$1',\n stats: 'stats.wikimedia.org/$1',\n stewardry: 'tools.wmflabs.org/meta/stewardry/?wiki=$1',\n strategy: 'strategy' + wm,\n strategywiki: 'strategywiki.org/wiki/$1',\n sulutil: 'meta.wikimedia.org/wiki/Special:CentralAuth/$1',\n swtrain: 'train.spottingworld.com/$1',\n svn: 'svn.wikimedia.org/viewvc/mediawiki/$1?view=log',\n swinbrain: 'swinbrain.ict.swin.edu.au/wiki/$1',\n tabwiki: w + 'tabwiki.com/index.php/$1',\n tclerswiki: 'wiki.tcl.tk/$1',\n technorati: w + 'technorati.com/search/$1',\n tenwiki: 'ten.' + wp,\n testwiki: 'test.' + wp,\n testwikidata: 'test.wikidata.org/wiki/$1',\n test2wiki: 'test2.' + wp,\n tfwiki: 'tfwiki.net/wiki/$1',\n thelemapedia: w + 'thelemapedia.org/index.php/$1',\n theopedia: w + 'theopedia.com/$1',\n thinkwiki: w + 'thinkwiki.org/wiki/$1',\n ticket: 'ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom&TicketNumber=$1',\n tmbw: 'tmbw.net/wiki/$1',\n tmnet: w + 'technomanifestos.net/?$1',\n tmwiki: w + 'EasyTopicMaps.com/?page=$1',\n toolforge: 'tools.wmflabs.org/$1',\n toollabs: 'tools.wmflabs.org/$1',\n tools: 'toolserver.org/$1',\n tswiki: w + 'mediawiki.org/wiki/Toolserver:$1',\n translatewiki: 'translatewiki.net/wiki/$1',\n tviv: 'tviv.org/wiki/$1',\n tvtropes: w + 'tvtropes.org/pmwiki/pmwiki.php/Main/$1',\n twiki: 'twiki.org/cgi-bin/view/$1',\n tyvawiki: w + 'tyvawiki.org/wiki/$1',\n umap: 'umap.openstreetmap.fr/$1',\n uncyclopedia: 'en.uncyclopedia.co/wiki/$1',\n unihan: w + 'unicode.org/cgi-bin/GetUnihanData.pl?codepoint=$1',\n unreal: 'wiki.beyondunreal.com/wiki/$1',\n urbandict: w + 'urbandictionary.com/define.php?term=$1',\n usej: w + 'tejo.org/usej/$1',\n usemod: w + 'usemod.com/cgi-bin/wiki.pl?$1',\n usability: 'usability' + wm,\n utrs: 'utrs.wmflabs.org/appeal.php?id=$1',\n vikidia: 'fr.vikidia.org/wiki/$1',\n vlos: 'tusach.thuvienkhoahoc.com/wiki/$1',\n vkol: 'kol.coldfront.net/thekolwiki/index.php/$1',\n voipinfo: w + 'voip-info.org/wiki/view/$1',\n votewiki: 'vote' + wm,\n werelate: w + 'werelate.org/wiki/$1',\n wg: 'wg-en.' + wp,\n wikia: w + 'wikia.com/wiki/w:c:$1',\n wikiasite: w + 'wikia.com/wiki/w:c:$1',\n wikiapiary: 'wikiapiary.com/wiki/$1',\n wikibooks: 'en.wikibooks.org/wiki/$1',\n wikichristian: w + 'wikichristian.org/index.php?title=$1',\n wikicities: w + 'wikia.com/wiki/w:$1',\n wikicity: w + 'wikia.com/wiki/w:c:$1',\n wikiconference: 'wikiconference.org/wiki/$1',\n wikidata: w + 'wikidata.org/wiki/$1',\n wikif1: w + 'wikif1.org/$1',\n wikifur: 'en.wikifur.com/wiki/$1',\n wikihow: w + 'wikihow.com/$1',\n wikiindex: 'wikiindex.org/$1',\n wikilemon: 'wiki.illemonati.com/$1',\n wikilivres: 'wikilivres.org/wiki/$1',\n wikilivresru: 'wikilivres.ru/$1',\n 'wikimac-de': 'apfelwiki.de/wiki/Main/$1',\n wikimedia: 'foundation' + wm,\n wikinews: 'en.wikinews.org/wiki/$1',\n wikinfo: 'wikinfo.org/w/index.php/$1',\n wikinvest: 'meta.wikimedia.org/wiki/Interwiki_map/discontinued#Wikinvest',\n wikiotics: 'wikiotics.org/$1',\n wikipapers: 'wikipapers.referata.com/wiki/$1',\n wikipedia: 'en.' + wp,\n wikipediawikipedia: 'en.wikipedia.org/wiki/Wikipedia:$1',\n wikiquote: 'en.wikiquote.org/wiki/$1',\n wikisophia: 'wikisophia.org/index.php?title=$1',\n wikisource: 'en.wikisource.org/wiki/$1',\n wikispecies: 'species' + wm,\n wikispot: 'wikispot.org/?action=gotowikipage&v=$1',\n wikiskripta: w + 'wikiskripta.eu/index.php/$1',\n labsconsole: 'wikitech' + wm,\n wikiti: 'wikiti.denglend.net/index.php?title=$1',\n wikiversity: 'en.wikiversity.org/wiki/$1',\n wikivoyage: 'en.wikivoyage.org/wiki/$1',\n betawikiversity: 'beta.wikiversity.org/wiki/$1',\n wikiwikiweb: 'c2.com/cgi/wiki?$1',\n wiktionary: 'en.wiktionary.org/wiki/$1',\n wipipedia: 'wipipedia.org/index.php/$1',\n wlug: w + 'wlug.org.nz/$1',\n wmam: 'am' + wm,\n wmar: w + 'wikimedia.org.ar/wiki/$1',\n wmat: 'mitglieder.wikimedia.at/$1',\n wmau: 'wikimedia.org.au/wiki/$1',\n wmbd: 'bd' + wm,\n wmbe: 'be' + wm,\n wmbr: 'br' + wm,\n wmca: 'ca' + wm,\n wmch: w + 'wikimedia.ch/$1',\n wmcl: w + 'wikimediachile.cl/index.php?title=$1',\n wmcn: 'cn' + wm,\n wmco: 'co' + wm,\n wmcz: w + 'wikimedia.cz/web/$1',\n wmdc: 'wikimediadc.org/wiki/$1',\n securewikidc: 'secure.wikidc.org/$1',\n wmde: 'wikimedia.de/wiki/$1',\n wmdk: 'dk' + wm,\n wmee: 'ee' + wm,\n wmec: 'ec' + wm,\n wmes: w + 'wikimedia.es/wiki/$1',\n wmet: 'ee' + wm,\n wmfdashboard: 'outreachdashboard.wmflabs.org/$1',\n wmfi: 'fi' + wm,\n wmfr: 'wikimedia.fr/$1',\n wmge: 'ge' + wm,\n wmhi: 'hi' + wm,\n wmhk: 'meta.wikimedia.org/wiki/Wikimedia_Hong_Kong',\n wmhu: 'wikimedia.hu/wiki/$1',\n wmid: 'id' + wm,\n wmil: w + 'wikimedia.org.il/$1',\n wmin: 'wiki.wikimedia.in/$1',\n wmit: 'wiki.wikimedia.it/wiki/$1',\n wmke: 'meta.wikimedia.org/wiki/Wikimedia_Kenya',\n wmmk: 'mk' + wm,\n wmmx: 'mx' + wm,\n wmnl: 'nl' + wm,\n wmnyc: 'nyc' + wm,\n wmno: 'no' + wm,\n 'wmpa-us': 'pa-us' + wm,\n wmph: 'meta.wikimedia.org/wiki/Wikimedia_Philippines',\n wmpl: 'pl' + wm,\n wmpt: 'pt' + wm,\n wmpunjabi: 'punjabi' + wm,\n wmromd: 'romd' + wm,\n wmrs: 'rs' + wm,\n wmru: 'ru' + wm,\n wmse: 'se' + wm,\n wmsk: 'wikimedia.sk/$1',\n wmtr: 'tr' + wm,\n wmtw: 'wikimedia.tw/wiki/index.php5/$1',\n wmua: 'ua' + wm,\n wmuk: 'wikimedia.org.uk/wiki/$1',\n wmve: 'wikimedia.org.ve/wiki/$1',\n wmza: 'wikimedia.org.za/wiki/$1',\n wm2005: 'wikimania2005' + wm,\n wm2006: 'wikimania2006' + wm,\n wm2007: 'wikimania2007' + wm,\n wm2008: 'wikimania2008' + wm,\n wm2009: 'wikimania2009' + wm,\n wm2010: 'wikimania2010' + wm,\n wm2011: 'wikimania2011' + wm,\n wm2012: 'wikimania2012' + wm,\n wm2013: 'wikimania2013' + wm,\n wm2014: 'wikimania2014' + wm,\n wm2015: 'wikimania2015' + wm,\n wm2016: 'wikimania2016' + wm,\n wm2017: 'wikimania2017' + wm,\n wm2018: 'wikimania2018' + wm,\n wmania: 'wikimania' + wm,\n wikimania: 'wikimania' + wm,\n wmteam: 'wikimaniateam' + wm,\n wmf: 'foundation' + wm,\n wmfblog: 'blog.wikimedia.org/$1',\n wmdeblog: 'blog.wikimedia.de/$1',\n wookieepedia: 'starwars.wikia.com/wiki/$1',\n wowwiki: w + 'wowwiki.com/$1',\n wqy: 'wqy.sourceforge.net/cgi-bin/index.cgi?$1',\n wurmpedia: 'wurmpedia.com/index.php/$1',\n viaf: 'viaf.org/viaf/$1',\n zrhwiki: w + 'zrhwiki.ch/wiki/$1',\n zum: 'wiki.zum.de/$1',\n zwiki: w + 'zwiki.org/$1',\n m: 'meta' + wm,\n meta: 'meta' + wm,\n sep11: 'sep11.' + wp,\n d: w + 'wikidata.org/wiki/$1',\n minnan: 'zh-min-nan.' + wp,\n nb: 'no.' + wp,\n 'zh-cfr': 'zh-min-nan.' + wp,\n 'zh-cn': 'zh.' + wp,\n 'zh-tw': 'zh.' + wp,\n nan: 'zh-min-nan.' + wp,\n vro: 'fiu-vro.' + wp,\n cmn: 'zh.' + wp,\n lzh: 'zh-classical.' + wp,\n rup: 'roa-rup.' + wp,\n gsw: 'als.' + wp,\n 'be-tarask': 'be-x-old.' + wp,\n sgs: 'bat-smg.' + wp,\n egl: 'eml.' + wp,\n w: 'en.' + wp,\n wikt: 'en.wiktionary.org/wiki/$1',\n q: 'en.wikiquote.org/wiki/$1',\n b: 'en.wikibooks.org/wiki/$1',\n n: 'en.wikinews.org/wiki/$1',\n s: 'en.wikisource.org/wiki/$1',\n chapter: 'en' + wm,\n v: 'en.wikiversity.org/wiki/$1',\n voy: 'en.wikivoyage.org/wiki/$1'\n}\n","const languages = require('../_data/languages')\n//some colon symbols are valid links, like `America: That place`\n//so we have to whitelist allowable interwiki links\nconst interwikis = require('../_data/interwiki')\n\n//add language prefixes too..\nObject.keys(languages).forEach(k => {\n interwikis[k] = k + '.wikipedia.org/wiki/$1'\n})\n\n//this is predictably very complicated.\n// https://meta.wikimedia.org/wiki/Help:Interwiki_linking\nconst parseInterwiki = function(obj) {\n let str = obj.page || ''\n if (str.indexOf(':') !== -1) {\n let m = str.match(/^(.*):(.*)/)\n if (m === null) {\n return obj\n }\n let site = m[1] || ''\n site = site.toLowerCase()\n //only allow interwikis to these specific places\n if (interwikis.hasOwnProperty(site) === false) {\n return obj\n }\n obj.wiki = site\n obj.page = m[2]\n }\n return obj\n}\nmodule.exports = parseInterwiki\n","const parse_interwiki = require('./interwiki')\nconst ignore_links = /^:?(category|catégorie|Kategorie|Categoría|Categoria|Categorie|Kategoria|تصنيف|image|file|image|fichier|datei|media):/i\nconst external_link = /\\[(https?|news|ftp|mailto|gopher|irc)(:\\/\\/[^\\]\\| ]{4,1500})([\\| ].*?)?\\]/g\nconst link_reg = /\\[\\[(.{0,160}?)\\]\\]([a-z]+)?(\\w{0,10})/gi //allow dangling suffixes - \"[[flanders]]s\"\n\nconst external_links = function(links, str) {\n str.replace(external_link, function(raw, protocol, link, text) {\n text = text || ''\n links.push({\n type: 'external',\n site: protocol + link,\n text: text.trim(),\n raw: raw\n })\n return text\n })\n return links\n}\n\nconst internal_links = function(links, str) {\n //regular links\n str.replace(link_reg, function(raw, s, suffix) {\n let txt = null\n //make a copy of original\n let link = s\n if (s.match(/\\|/)) {\n //replacement link [[link|text]]\n s = s.replace(/\\[\\[(.{2,100}?)\\]\\](\\w{0,10})/g, '$1$2') //remove ['s and keep suffix\n link = s.replace(/(.{2,100})\\|.{0,200}/, '$1') //replaced links\n txt = s.replace(/.{2,100}?\\|/, '')\n //handle funky case of [[toronto|]]\n if (txt === null && link.match(/\\|$/)) {\n link = link.replace(/\\|$/, '')\n txt = link\n }\n }\n //kill off non-wikipedia namespaces\n if (link.match(ignore_links)) {\n return s\n }\n //kill off just these just-anchor links [[#history]]\n // if (link.match(/^#/i)) {\n // console.log(s)\n // return s\n // }\n //remove anchors from end [[toronto#history]]\n let obj = {\n page: link,\n raw: raw\n }\n obj.page = obj.page.replace(/#(.*)/, (a, b) => {\n obj.anchor = b\n return ''\n })\n //grab any fr:Paris parts\n obj = parse_interwiki(obj)\n if (obj.wiki) {\n obj.type = 'interwiki'\n }\n if (txt !== null && txt !== obj.page) {\n obj.text = txt\n }\n //finally, support [[link]]'s apostrophe\n if (suffix) {\n obj.text = obj.text || obj.page\n obj.text += suffix.trim()\n }\n //titlecase it, if necessary\n if (obj.page && /^[A-Z]/.test(obj.page) === false) {\n if (!obj.text) {\n obj.text = obj.page\n }\n obj.page = obj.page\n }\n links.push(obj)\n return s\n })\n return links\n}\n\n//grab an array of internal links in the text\nconst parse_links = function(str) {\n let links = []\n //first, parse external links\n links = external_links(links, str)\n //internal links\n links = internal_links(links, str)\n if (links.length === 0) {\n return undefined\n }\n return links\n}\nmodule.exports = parse_links\n","const i18n = require('../_data/i18n')\nconst parseLink = require('../link/parse')\n//pulls target link out of redirect page\nconst REDIRECT_REGEX = new RegExp(\n '^[ \\n\\t]*?#(' + i18n.redirects.join('|') + ') *?(\\\\[\\\\[.{2,180}?\\\\]\\\\])',\n 'i'\n)\n\nconst isRedirect = function(wiki) {\n //too long to be a redirect?\n if (!wiki || wiki.length > 500) {\n return false\n }\n return REDIRECT_REGEX.test(wiki)\n}\n\nconst parse = function(wiki) {\n let m = wiki.match(REDIRECT_REGEX)\n if (m && m[2]) {\n let links = parseLink(m[2]) || []\n return links[0]\n }\n return {}\n}\n\nmodule.exports = {\n isRedirect: isRedirect,\n parse: parse\n}\n","//okay, i know you're not supposed to regex html, but...\n//https://en.wikipedia.org/wiki/Help:HTML_in_wikitext\n\n//these are things we throw-away\n//these will mess-up if they're nested, but they're not usually.\nconst ignore = [\n 'table',\n 'code',\n 'score',\n 'data',\n 'categorytree',\n 'charinsert',\n 'hiero',\n 'imagemap',\n 'inputbox',\n 'nowiki',\n 'poem',\n 'references',\n 'source',\n 'syntaxhighlight',\n 'timeline'\n]\nconst openTag = `< ?(${ignore.join('|')}) ?[^>]{0,200}?>`\nconst closeTag = `< ?/ ?(${ignore.join('|')}) ?>`\nconst anyChar = '\\\\s\\\\S' //including newline\nconst noThanks = new RegExp(`${openTag}[${anyChar}]+?${closeTag}`, 'ig')\n\nconst kill_xml = function(wiki) {\n //( tags are parsed in Section class) - luckily, refs can't be recursive.\n //types of html/xml that we want to trash completely.\n wiki = wiki.replace(noThanks, ' ')\n //some xml-like fragments we can also kill\n wiki = wiki.replace(/ ?< ?(span|div|table|data) [a-zA-Z0-9=%\\.#:;'\" ]{2,100}\\/? ?> ?/g, ' ') //\n //only kill ref tags if they are selfclosing\n wiki = wiki.replace(/ ?< ?(ref) [a-zA-Z0-9=\" ]{2,100}\\/ ?> ?/g, ' ') //\n //some formatting xml, we'll keep their insides though\n wiki = wiki.replace(/ ?<[ \\/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \\/]?> ?/g, ' ') //, \n wiki = wiki.replace(/ ?<[ \\/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \\/]?> ?/g, ' ') //, \n wiki = wiki.replace(/ ?<[ \\/]?h[0-9][ \\/]?> ?/g, ' ') //

,

\n wiki = wiki.replace(/ ?< ?br ?\\/> ?/g, '\\n') //
\n return wiki.trim()\n}\nmodule.exports = kill_xml\n","const kill_xml = require('./kill_xml')\n\n//this mostly-formatting stuff can be cleaned-up first, to make life easier\nfunction preProcess(doc) {\n let wiki = doc.wiki\n //remove comments\n wiki = wiki.replace(//g, '')\n wiki = wiki.replace(/__(NOTOC|NOEDITSECTION|FORCETOC|TOC)__/gi, '')\n //signitures\n wiki = wiki.replace(/~~{1,3}/g, '')\n //windows newlines\n wiki = wiki.replace(/\\r/g, '')\n //japanese periods - '。'\n wiki = wiki.replace(/\\u3002/g, '. ')\n //horizontal rule\n wiki = wiki.replace(/----/g, '')\n //formatting for templates-in-templates...\n wiki = wiki.replace(/\\{\\{\\}\\}/g, ' – ')\n wiki = wiki.replace(/\\{\\{\\\\\\}\\}/g, ' / ')\n //space\n wiki = wiki.replace(/ /g, ' ')\n //give it the inglorious send-off it deserves..\n wiki = kill_xml(wiki)\n //({{template}},{{template}}) leaves empty parentheses\n wiki = wiki.replace(/\\([,;: ]+?\\)/g, '')\n //these templates just screw things up, too\n wiki = wiki.replace(/{{(baseball|basketball) (primary|secondary) (style|color).*?\\}\\}/i, '')\n doc.wiki = wiki\n}\nmodule.exports = preProcess\n","// dumpster-dive throws everything into mongodb - github.com/spencermountain/dumpster-dive\n// mongo has some opinions about what characters are allowed as keys and ids.\n//https://stackoverflow.com/questions/12397118/mongodb-dot-in-key-name/30254815#30254815\nconst specialChar = /[\\\\\\.$]/\n\nconst encodeStr = function(str) {\n if (typeof str !== 'string') {\n str = ''\n }\n str = str.replace(/\\\\/g, '\\\\\\\\')\n str = str.replace(/^\\$/, '\\\\u0024')\n str = str.replace(/\\./g, '\\\\u002e')\n return str\n}\n\nconst encodeObj = function(obj = {}) {\n let keys = Object.keys(obj)\n for (let i = 0; i < keys.length; i += 1) {\n if (specialChar.test(keys[i]) === true) {\n let str = encodeStr(keys[i])\n if (str !== keys[i]) {\n obj[str] = obj[keys[i]]\n delete obj[keys[i]]\n }\n }\n }\n return obj\n}\n\nmodule.exports = {\n encodeObj: encodeObj\n}\n","const setDefaults = require('../_lib/setDefaults')\nconst encode = require('../_lib/encode')\n\nconst defaults = {\n headers: true,\n depth: true,\n paragraphs: true,\n images: true,\n tables: true,\n templates: true,\n infoboxes: true,\n lists: true,\n references: true\n}\n//\nconst toJSON = function(section, options) {\n options = setDefaults(options, defaults)\n let data = {}\n if (options.headers === true) {\n data.title = section.title()\n }\n if (options.depth === true) {\n data.depth = section.depth\n }\n //these return objects\n if (options.paragraphs === true) {\n let paragraphs = section.paragraphs().map(p => p.json(options))\n if (paragraphs.length > 0) {\n data.paragraphs = paragraphs\n }\n }\n //image json data\n if (options.images === true) {\n let images = section.images().map(img => img.json(options))\n if (images.length > 0) {\n data.images = images\n }\n }\n //table json data\n if (options.tables === true) {\n let tables = section.tables().map(t => t.json(options))\n if (tables.length > 0) {\n data.tables = tables\n }\n }\n //template json data\n if (options.templates === true) {\n let templates = section.templates()\n if (templates.length > 0) {\n data.templates = templates\n //encode them, for mongodb\n if (options.encode === true) {\n data.templates.forEach(t => encode.encodeObj(t))\n }\n }\n }\n //infobox json data\n if (options.infoboxes === true) {\n let infoboxes = section.infoboxes().map(i => i.json(options))\n if (infoboxes.length > 0) {\n data.infoboxes = infoboxes\n }\n }\n //list json data\n if (options.lists === true) {\n let lists = section.lists().map(list => list.json(options))\n if (lists.length > 0) {\n data.lists = lists\n }\n }\n //list references - default true\n if (options.references === true || options.citations === true) {\n let references = section.references().map(ref => ref.json(options))\n if (references.length > 0) {\n data.references = references\n }\n }\n //default off\n if (options.sentences === true) {\n data.sentences = section.sentences().map(s => s.json(options))\n }\n return data\n}\nmodule.exports = toJSON\n","const toJSON = require('./toJson')\nconst setDefaults = require('../_lib/setDefaults')\n\nconst defaults = {\n tables: true,\n references: true,\n paragraphs: true,\n templates: true,\n infoboxes: true\n}\n\n//the stuff between headings - 'History' section for example\nconst Section = function(data) {\n this.depth = data.depth\n this.doc = null\n this._title = data.title || ''\n Object.defineProperty(this, 'doc', {\n enumerable: false,\n value: null\n })\n data.templates = data.templates || []\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n title: function() {\n return this._title || ''\n },\n index: function() {\n if (!this.doc) {\n return null\n }\n let index = this.doc.sections().indexOf(this)\n if (index === -1) {\n return null\n }\n return index\n },\n indentation: function() {\n return this.depth\n },\n sentences: function(n) {\n let arr = this.paragraphs().reduce((list, p) => {\n return list.concat(p.sentences())\n }, [])\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr || []\n },\n paragraphs: function(n) {\n let arr = this.data.paragraphs || []\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr || []\n },\n paragraph: function(n) {\n let arr = this.data.paragraphs || []\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr[0]\n },\n links: function(n) {\n let arr = []\n this.infoboxes().forEach(templ => {\n templ.links(n).forEach(link => arr.push(link))\n })\n this.sentences().forEach(s => {\n s.links(n).forEach(link => arr.push(link))\n })\n this.tables().forEach(t => {\n t.links(n).forEach(link => arr.push(link))\n })\n this.lists().forEach(list => {\n list.links(n).forEach(link => arr.push(link))\n })\n if (typeof n === 'number') {\n return arr[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = arr.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return arr\n },\n tables: function(clue) {\n let arr = this.data.tables || []\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n templates: function(clue) {\n let arr = this.data.templates || []\n arr = arr.map(t => t.json())\n if (typeof clue === 'number') {\n return arr[clue]\n }\n if (typeof clue === 'string') {\n clue = clue.toLowerCase()\n return arr.filter(o => o.template === clue || o.name === clue)\n }\n return arr\n },\n infoboxes: function(clue) {\n let arr = this.data.infoboxes || []\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n coordinates: function(clue) {\n let arr = [].concat(this.templates('coord'), this.templates('coor'))\n if (typeof clue === 'number') {\n if (!arr[clue]) {\n return []\n }\n return arr[clue]\n }\n return arr\n },\n lists: function(clue) {\n let arr = []\n this.paragraphs().forEach(p => {\n arr = arr.concat(p.lists())\n })\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n interwiki(num) {\n let arr = []\n this.paragraphs().forEach(p => {\n arr = arr.concat(p.interwiki())\n })\n if (typeof num === 'number') {\n return arr[num]\n }\n return arr || []\n },\n images: function(clue) {\n let arr = []\n this.paragraphs().forEach(p => {\n arr = arr.concat(p.images())\n })\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr || []\n },\n references: function(clue) {\n let arr = this.data.references || []\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n\n //transformations\n remove: function() {\n if (!this.doc) {\n return null\n }\n let bads = {}\n bads[this.title()] = true\n //remove children too\n this.children().forEach(sec => (bads[sec.title()] = true))\n let arr = this.doc.data.sections\n arr = arr.filter(sec => bads.hasOwnProperty(sec.title()) !== true)\n this.doc.data.sections = arr\n return this.doc\n },\n\n //move-around sections like in jquery\n nextSibling: function() {\n if (!this.doc) {\n return null\n }\n let sections = this.doc.sections()\n let index = this.index()\n for (let i = index + 1; i < sections.length; i += 1) {\n if (sections[i].depth < this.depth) {\n return null\n }\n if (sections[i].depth === this.depth) {\n return sections[i]\n }\n }\n return null\n },\n lastSibling: function() {\n if (!this.doc) {\n return null\n }\n let sections = this.doc.sections()\n let index = this.index()\n return sections[index - 1] || null\n },\n children: function(n) {\n if (!this.doc) {\n return null\n }\n\n let sections = this.doc.sections()\n let index = this.index()\n let children = []\n //(immediately preceding sections with higher depth)\n if (sections[index + 1] && sections[index + 1].depth > this.depth) {\n for (let i = index + 1; i < sections.length; i += 1) {\n if (sections[i].depth > this.depth) {\n children.push(sections[i])\n } else {\n break\n }\n }\n }\n if (typeof n === 'string') {\n n = n.toLowerCase()\n return children.find(s => s.title().toLowerCase() === n)\n }\n if (typeof n === 'number') {\n return children[n]\n }\n return children\n },\n parent: function() {\n if (!this.doc) {\n return null\n }\n let sections = this.doc.sections()\n let index = this.index()\n for (let i = index; i >= 0; i -= 1) {\n if (sections[i] && sections[i].depth < this.depth) {\n return sections[i]\n }\n }\n return null\n },\n text: function(options) {\n options = setDefaults(options, defaults)\n let pList = this.paragraphs()\n pList = pList.map(p => p.text(options))\n return pList.join('\\n\\n')\n },\n json: function(options) {\n options = setDefaults(options, defaults)\n return toJSON(this, options)\n }\n}\n//aliases\nmethods.next = methods.nextSibling\nmethods.last = methods.lastSibling\nmethods.previousSibling = methods.lastSibling\nmethods.previous = methods.lastSibling\nmethods.citations = methods.references\nmethods.sections = methods.children\nObject.keys(methods).forEach(k => {\n Section.prototype[k] = methods[k]\n})\n\nmodule.exports = Section\n","module.exports = {\n capitalise: function(str) {\n if (str && typeof str === 'string') {\n return str.charAt(0).toUpperCase() + str.slice(1)\n }\n return ''\n },\n trim_whitespace: function(str) {\n if (str && typeof str === 'string') {\n str = str.replace(/^\\s\\s*/, '')\n str = str.replace(/\\s\\s*$/, '')\n str = str.replace(/ {2}/, ' ')\n str = str.replace(/\\s, /, ', ')\n return str\n }\n return ''\n }\n}\n","const wikis = require('../_data/interwiki')\n\nconst defaults = {\n type: 'internal'\n}\nconst Link = function(data) {\n data = data || {}\n data = Object.assign({}, defaults, data)\n // console.log(data)\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\nconst methods = {\n text: function(str) {\n if (str !== undefined) {\n this.data.text = str\n }\n return this.data.text\n },\n json: function() {\n let obj = {\n text: this.text(),\n type: this.type()\n }\n if (obj.type === 'internal') {\n obj.page = this.page()\n } else if (obj.type === 'interwiki') {\n obj.wiki = this.wiki()\n } else {\n obj.site = this.site()\n }\n let anchor = this.anchor()\n if (anchor) {\n obj.anchor = anchor\n }\n return obj\n },\n page: function(str) {\n if (str !== undefined) {\n this.data.page = str\n }\n return this.data.page\n },\n anchor: function(str) {\n if (str !== undefined) {\n this.data.anchor = str\n }\n return this.data.anchor || ''\n },\n wiki: function(str) {\n if (str !== undefined) {\n this.data.wiki = str\n }\n return this.data.wiki\n },\n type: function(str) {\n if (str !== undefined) {\n this.data.type = str\n }\n return this.data.type\n },\n site: function(str) {\n if (str !== undefined) {\n this.data.site = str\n }\n return this.data.site\n },\n // create a url for any type of link\n href: function() {\n let type = this.type()\n if (type === 'external') {\n return this.site()\n }\n let page = this.page()\n page = page.replace(/ /g, '_')\n page = encodeURIComponent(page)\n let url = ''\n\n if (type === 'interwiki') {\n let wiki = this.wiki()\n url = 'https://en.wikipedia.org/wiki/$1'\n if (wikis.hasOwnProperty(wiki)) {\n url = 'http://' + wikis[this.wiki()]\n }\n url = url.replace(/\\$1/g, page)\n } else {\n //internal link\n url = `./${this.page()}`\n }\n // add anchor on the end\n if (this.anchor()) {\n url += '#' + this.anchor()\n }\n return url\n }\n}\nObject.keys(methods).forEach(k => {\n Link.prototype[k] = methods[k]\n})\nmodule.exports = Link\n","const Link = require('./Link')\nconst parseLinks = require('./parse')\n// const i18n = require('../_data/i18n')\n// const cat_reg = new RegExp('\\\\[\\\\[:?(' + i18n.categories.join('|') + '):[^\\\\]\\\\]]{2,80}\\\\]\\\\]', 'gi')\n\n//return only rendered text of wiki links\nconst removeLinks = function(line) {\n // [[File:with|Size]]\n line = line.replace(/\\[\\[File:(.{2,80}?)\\|([^\\]]+?)\\]\\](\\w{0,5})/g, '$1')\n return line\n}\n\nconst getLinks = function(data) {\n let wiki = data.text\n let links = parseLinks(wiki) || []\n data.links = links.map(link => {\n wiki = wiki.replace(link.raw, link.text || link.page || '')\n delete link.raw\n return new Link(link)\n })\n wiki = removeLinks(wiki)\n data.text = wiki\n}\nmodule.exports = getLinks\n","//handle the bold/italics\nconst formatting = function(obj) {\n let bolds = []\n let italics = []\n let wiki = obj.text || ''\n //bold and italics combined 5 's\n wiki = wiki.replace(/'''''(.{0,200}?)'''''/g, (a, b) => {\n bolds.push(b)\n italics.push(b)\n return b\n })\n //''''four'''' → bold with quotes\n wiki = wiki.replace(/''''(.{0,200}?)''''/g, (a, b) => {\n bolds.push(`'${b}'`)\n return `'${b}'`\n })\n //'''bold'''\n wiki = wiki.replace(/'''(.{0,200}?)'''/g, (a, b) => {\n bolds.push(b)\n return b\n })\n //''italic''\n wiki = wiki.replace(/''(.{0,200}?)''/g, (a, b) => {\n italics.push(b)\n return b\n })\n\n //pack it all up..\n obj.text = wiki\n if (bolds.length > 0) {\n obj.fmt = obj.fmt || {}\n obj.fmt.bold = bolds\n }\n if (italics.length > 0) {\n obj.fmt = obj.fmt || {}\n obj.fmt.italic = italics\n }\n return obj\n}\nmodule.exports = formatting\n","const setDefaults = require('../_lib/setDefaults')\nconst isNumber = /^[0-9,.]+$/\n\nconst defaults = {\n text: true,\n links: true,\n formatting: true,\n dates: true,\n numbers: true\n}\n\nconst toJSON = function(s, options) {\n options = setDefaults(options, defaults)\n let data = {}\n let text = s.text()\n if (options.text === true) {\n data.text = text\n }\n //add number field\n if (options.numbers === true && isNumber.test(text)) {\n let num = Number(text.replace(/,/g, ''))\n if (isNaN(num) === false) {\n data.number = num\n }\n }\n if (options.links && s.links().length > 0) {\n data.links = s.links().map(l => l.json())\n }\n if (options.formatting && s.data.fmt) {\n data.formatting = s.data.fmt\n }\n if (options.dates && s.data.dates !== undefined) {\n data.dates = s.data.dates\n }\n return data\n}\nmodule.exports = toJSON\n","const toJSON = require('./toJson')\n\n//where we store the formatting, link, date information\nconst Sentence = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n links: function(n) {\n let arr = this.data.links || []\n if (typeof n === 'number') {\n return arr[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = arr.find(o => o.page === n)\n return link === undefined ? [] : [link]\n }\n return arr\n },\n interwiki: function(n) {\n let arr = this.links().filter(l => l.wiki !== undefined)\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n bolds: function(n) {\n let arr = []\n if (this.data && this.data.fmt && this.data.fmt.bold) {\n arr = this.data.fmt.bold || []\n }\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n italics: function(n) {\n let arr = []\n if (this.data && this.data.fmt && this.data.fmt.italic) {\n arr = this.data.fmt.italic || []\n }\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n dates: function(n) {\n let arr = []\n if (this.data && this.data.dates) {\n arr = this.data.dates || []\n }\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n text: function(str) {\n if (str !== undefined && typeof str === 'string') {\n //set the text?\n this.data.text = str\n }\n return this.data.text || ''\n },\n json: function(options) {\n return toJSON(this, options)\n }\n}\n\nObject.keys(methods).forEach(k => {\n Sentence.prototype[k] = methods[k]\n})\nSentence.prototype.italic = Sentence.prototype.italics\nSentence.prototype.bold = Sentence.prototype.bolds\nSentence.prototype.plaintext = Sentence.prototype.text\n\nmodule.exports = Sentence\n","//these are used for the sentence-splitter\nmodule.exports = [\n 'ad',\n 'adj',\n 'adm',\n 'adv',\n 'al',\n 'alta',\n 'approx',\n 'apr',\n 'apt',\n 'arc',\n 'ariz',\n 'assn',\n 'asst',\n 'atty',\n 'aug',\n 'ave',\n 'ba',\n 'bc',\n 'bl',\n 'bldg',\n 'blvd',\n 'brig',\n 'bros',\n 'ca',\n 'cal',\n 'calif',\n 'capt',\n 'cca',\n 'cg',\n 'cl',\n 'cm',\n 'cmdr',\n 'co',\n 'col',\n 'colo',\n 'comdr',\n 'conn',\n 'corp',\n 'cpl',\n 'cres',\n 'ct',\n 'cyn',\n 'dak',\n 'dec',\n 'def',\n 'dept',\n 'det',\n 'dg',\n 'dist',\n 'dl',\n 'dm',\n 'dr',\n 'ea',\n 'eg',\n 'eng',\n 'esp',\n 'esq',\n 'est',\n 'etc',\n 'ex',\n 'exp',\n 'feb',\n 'fem',\n 'fig',\n 'fl oz',\n 'fl',\n 'fla',\n 'fm',\n 'fr',\n 'ft',\n 'fy',\n 'ga',\n 'gal',\n 'gb',\n 'gen',\n 'gov',\n 'hg',\n 'hon',\n 'hr',\n 'hrs',\n 'hwy',\n 'hz',\n 'ia',\n 'ida',\n 'ie',\n 'inc',\n 'inf',\n 'jan',\n 'jd',\n 'jr',\n 'jul',\n 'jun',\n 'kan',\n 'kans',\n 'kb',\n 'kg',\n 'km',\n 'kmph',\n 'lat',\n 'lb',\n 'lit',\n 'llb',\n 'lm',\n 'lng',\n 'lt',\n 'ltd',\n 'lx',\n 'ma',\n 'maj',\n 'mar',\n 'masc',\n 'mb',\n 'md',\n 'messrs',\n 'mg',\n 'mi',\n 'min',\n 'minn',\n 'misc',\n 'mister',\n 'ml',\n 'mlle',\n 'mm',\n 'mme',\n 'mph',\n 'mps',\n 'mr',\n 'mrs',\n 'ms',\n 'mstr',\n 'mt',\n 'neb',\n 'nebr',\n 'nee',\n 'no',\n 'nov',\n 'oct',\n 'okla',\n 'ont',\n 'op',\n 'ord',\n 'oz',\n 'pa',\n 'pd',\n 'penn',\n 'penna',\n 'phd',\n 'pl',\n 'pp',\n 'pref',\n 'prob',\n 'prof',\n 'pron',\n 'ps',\n 'psa',\n 'pseud',\n 'pt',\n 'pvt',\n 'qt',\n 'que',\n 'rb',\n 'rd',\n 'rep',\n 'reps',\n 'res',\n 'rev',\n 'sask',\n 'sec',\n 'sen',\n 'sens',\n 'sep',\n 'sept',\n 'sfc',\n 'sgt',\n 'sir',\n 'situ',\n 'sq ft',\n 'sq',\n 'sr',\n 'ss',\n 'st',\n 'supt',\n 'surg',\n 'tb',\n 'tbl',\n 'tbsp',\n 'tce',\n 'td',\n 'tel',\n 'temp',\n 'tenn',\n 'tex',\n 'tsp',\n 'univ',\n 'usafa',\n 'ut',\n 'va',\n 'vb',\n 'ver',\n 'vet',\n 'vitro',\n 'vivo',\n 'vol',\n 'vs',\n 'vt',\n 'wis',\n 'wisc',\n 'wr',\n 'wy',\n 'wyo',\n 'yb',\n 'µg'\n]\n","//split text into sentences, using regex\n//@spencermountain MIT\n\n//(Rule-based sentence boundary segmentation) - chop given text into its proper sentences.\n// Ignore periods/questions/exclamations used in acronyms/abbreviations/numbers, etc.\n// @spencermountain 2015 MIT\nconst literalAbbreviations = require('./_abbreviations')\nconst abbreviations = literalAbbreviations.concat('[^]][^]]')\nconst abbrev_reg = new RegExp(\"(^| |')(\" + abbreviations.join('|') + `)[.!?] ?$`, 'i')\nconst acronym_reg = new RegExp(\"[ |.|'|[][A-Z].? *?$\", 'i')\nconst elipses_reg = new RegExp('\\\\.\\\\.\\\\.* +?$')\nconst hasWord = new RegExp('[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]', 'iu')\n// 3040-309F : hiragana\n// 30A0-30FF : katakana\n\n//turn a nested array into one array\nconst flatten = function(arr) {\n let all = []\n arr.forEach(function(a) {\n all = all.concat(a)\n })\n return all\n}\n\nconst naiive_split = function(text) {\n //first, split by newline\n let splits = text.split(/(\\n+)/)\n splits = splits.filter(s => s.match(/\\S/))\n //split by period, question-mark, and exclamation-mark\n splits = splits.map(function(str) {\n return str.split(/(\\S.+?[.!?]\"?)(?=\\s+|$)/g) //\\u3002\n })\n return flatten(splits)\n}\n\n// if this looks like a period within a wikipedia link, return false\nconst isBalanced = function(str) {\n str = str || ''\n const open = str.split(/\\[\\[/) || []\n const closed = str.split(/\\]\\]/) || []\n if (open.length > closed.length) {\n return false\n }\n //make sure quotes are closed too\n const quotes = str.match(/\"/g)\n if (quotes && quotes.length % 2 !== 0 && str.length < 900) {\n return false\n }\n return true\n}\n\nconst sentence_parser = function(text) {\n let sentences = []\n //first do a greedy-split..\n let chunks = []\n //ensure it 'smells like' a sentence\n if (!text || typeof text !== 'string' || text.trim().length === 0) {\n return sentences\n }\n // This was the splitter regex updated to fix quoted punctuation marks.\n // let splits = text.split(/(\\S.+?[.\\?!])(?=\\s+|$|\")/g);\n // todo: look for side effects in this regex replacement:\n let splits = naiive_split(text)\n //filter-out the grap ones\n for (let i = 0; i < splits.length; i++) {\n let s = splits[i]\n if (!s || s === '') {\n continue\n }\n //this is meaningful whitespace\n if (!s.match(/\\S/)) {\n //add it to the last one\n if (chunks[chunks.length - 1]) {\n chunks[chunks.length - 1] += s\n continue\n } else if (splits[i + 1]) {\n //add it to the next one\n splits[i + 1] = s + splits[i + 1]\n continue\n }\n }\n chunks.push(s)\n }\n\n //detection of non-sentence chunks\n const isSentence = function(hmm) {\n if (hmm.match(abbrev_reg) || hmm.match(acronym_reg) || hmm.match(elipses_reg)) {\n return false\n }\n //too short? - no consecutive letters\n if (hasWord.test(hmm) === false) {\n return false\n }\n if (!isBalanced(hmm)) {\n return false\n }\n return true\n }\n //loop through these chunks, and join the non-sentence chunks back together..\n for (let i = 0; i < chunks.length; i++) {\n //should this chunk be combined with the next one?\n if (chunks[i + 1] && !isSentence(chunks[i])) {\n chunks[i + 1] = chunks[i] + (chunks[i + 1] || '') //.replace(/ +/g, ' ');\n } else if (chunks[i] && chunks[i].length > 0) {\n //this chunk is a proper sentence..\n sentences.push(chunks[i])\n chunks[i] = ''\n }\n }\n //if we never got a sentence, return the given text\n if (sentences.length === 0) {\n return [text]\n }\n return sentences\n}\n\nmodule.exports = sentence_parser\n","const helpers = require('../_lib/helpers')\nconst parseLinks = require('../link')\nconst parseFmt = require('./formatting')\nconst Sentence = require('./Sentence')\nconst sentenceParser = require('./parse')\n\nfunction postprocess(line) {\n //remove empty parentheses (sometimes caused by removing templates)\n line = line.replace(/\\([,;: ]*\\)/g, '')\n //these semi-colons in parentheses are particularly troublesome\n line = line.replace(/\\( *(; ?)+/g, '(')\n //dangling punctuation\n line = helpers.trim_whitespace(line)\n line = line.replace(/ +\\.$/, '.')\n return line\n}\n\n// returns one sentence object\nfunction fromText(str) {\n let obj = {\n text: str\n }\n //pull-out the [[links]]\n parseLinks(obj)\n obj.text = postprocess(obj.text)\n //pull-out the bolds and ''italics''\n obj = parseFmt(obj)\n //pull-out things like {{start date|...}}\n return new Sentence(obj)\n}\n\n//used for consistency with other class-definitions\nconst byParagraph = function(paragraph) {\n // array of texts\n let sentences = sentenceParser(paragraph.wiki)\n // sentence objects\n sentences = sentences.map(fromText)\n //remove :indented first line, as it is often a disambiguation\n if (sentences[0] && sentences[0].text() && sentences[0].text()[0] === ':') {\n sentences = sentences.slice(1)\n }\n paragraph.sentences = sentences\n}\n\nmodule.exports = {\n fromText: fromText,\n byParagraph: byParagraph\n}\n","//remove the top/bottom off the template\nconst strip = function(tmpl) {\n tmpl = tmpl.replace(/^\\{\\{/, '')\n tmpl = tmpl.replace(/\\}\\}$/, '')\n return tmpl\n}\nmodule.exports = strip\n","//normalize template names\nconst fmtName = function(name) {\n name = (name || '').trim()\n name = name.toLowerCase()\n name = name.replace(/_/g, ' ')\n return name\n}\nmodule.exports = fmtName\n","//turn {{name|one|two|three}} into [name, one, two, three]\nconst pipeSplitter = function(tmpl) {\n //start with a naiive '|' split\n let arr = tmpl.split(/\\n?\\|/)\n //we've split by '|', which is pretty lame\n //look for broken-up links and fix them :/\n arr.forEach((a, i) => {\n if (a === null) {\n return\n }\n //has '[[' but no ']]'\n //has equal number of openning and closing tags. handle nested case '[[[[' ']]'\n if (/\\[\\[[^\\]]+$/.test(a) || /\\{\\{[^\\}]+$/.test(a)\n || \n (a.split('{{').length !== a.split('}}').length)\n || (a.split('[[').length !== a.split(']]').length)\n ) {\n arr[i + 1] = arr[i] + '|' + arr[i + 1]\n arr[i] = null\n }\n })\n //cleanup any mistakes we've made\n arr = arr.filter(a => a !== null)\n arr = arr.map(a => (a || '').trim())\n //remove empty fields, only at the end:\n for (let i = arr.length - 1; i >= 0; i -= 1) {\n if (arr[i] === '') {\n arr.pop()\n }\n break\n }\n return arr\n}\nmodule.exports = pipeSplitter\n","// every value in {{tmpl|a|b|c}} needs a name\n// here we come up with names for them\nconst hasKey = /^[a-z0-9\\u00C0-\\u00FF\\._\\- '()œ]+=/iu\n\n//templates with these properties are asking for trouble\nconst reserved = {\n template: true,\n list: true,\n prototype: true\n}\n\n//turn 'key=val' into {key:key, val:val}\nconst parseKey = function(str) {\n let parts = str.split('=')\n let key = parts[0] || ''\n key = key.toLowerCase().trim()\n let val = parts.slice(1).join('=')\n //don't let it be called 'template'..\n if (reserved.hasOwnProperty(key)) {\n key = '_' + key\n }\n return {\n key: key,\n val: val.trim()\n }\n}\n\n//turn [a, b=v, c] into {'1':a, b:v, '2':c}\nconst keyMaker = function(arr, order) {\n let o = 0\n return arr.reduce((h, str) => {\n str = (str || '').trim()\n //support named keys - 'foo=bar'\n if (hasKey.test(str) === true) {\n let res = parseKey(str)\n if (res.key) {\n h[res.key] = res.val\n return h\n }\n }\n //try a key from given 'order' names\n if (order && order[o]) {\n let key = order[o] //here goes!\n h[key] = str\n } else {\n h.list = h.list || []\n h.list.push(str)\n }\n o += 1\n return h\n }, {})\n}\n\nmodule.exports = keyMaker\n","const whoCares = {\n classname: true,\n style: true,\n align: true,\n margin: true,\n left: true,\n break: true,\n boxsize: true,\n framestyle: true,\n item_style: true,\n collapsible: true,\n list_style_type: true,\n 'list-style-type': true,\n colwidth: true\n}\n\n//remove wiki-cruft & some styling info from templates\nconst cleanup = function(obj) {\n Object.keys(obj).forEach(k => {\n if (whoCares[k.toLowerCase()] === true) {\n delete obj[k]\n }\n //remove empty values, too\n if (obj[k] === null || obj[k] === '') {\n delete obj[k]\n }\n })\n return obj\n}\nmodule.exports = cleanup\n","//remove the top/bottom off the template\nconst strip = require('./_strip')\nconst fmtName = require('./_fmtName')\nconst parseSentence = require('../../04-sentence').fromText\nconst pipeSplitter = require('./01-pipe-splitter')\nconst keyMaker = require('./02-keyMaker')\nconst cleanup = require('./03-cleanup')\n\n// most templates just want plaintext...\nconst makeFormat = function(str, fmt) {\n let s = parseSentence(str)\n //support various output formats\n if (fmt === 'json') {\n return s.json()\n } else if (fmt === 'raw') {\n return s\n }\n //default to flat text\n return s.text()\n}\n\n//\nconst parser = function(tmpl, order, fmt) {\n order = order || []\n //renomove {{}}'s\n tmpl = strip(tmpl || '')\n let arr = pipeSplitter(tmpl)\n //get template name\n let name = arr.shift()\n //name each value\n let obj = keyMaker(arr, order)\n //remove wiki-junk\n obj = cleanup(obj)\n //is this a infobox/reference?\n // let known = isKnown(obj);\n\n //using '|1=content' is an escaping-thing..\n if (obj['1'] && order[0] && obj.hasOwnProperty(order[0]) === false) {\n //move it over..\n obj[order[0]] = obj['1']\n delete obj['1']\n }\n\n Object.keys(obj).forEach(k => {\n if (k === 'list') {\n obj[k] = obj[k].map(v => makeFormat(v, fmt))\n return\n }\n obj[k] = makeFormat(obj[k], fmt)\n })\n //add the template name\n if (name) {\n obj.template = fmtName(name)\n }\n return obj\n}\nmodule.exports = parser\n","//also called 'citations'\nconst Reference = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n title: function() {\n let data = this.data\n return data.title || data.encyclopedia || data.author || ''\n },\n links: function(n) {\n let arr = []\n if (typeof n === 'number') {\n return arr[n]\n }\n //grab a specific link..\n if (typeof n === 'number') {\n return arr[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = arr.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return arr || []\n },\n text: function() {\n return '' //nah, skip these.\n },\n\n json: function() {\n return this.data\n }\n}\nObject.keys(methods).forEach(k => {\n Reference.prototype[k] = methods[k]\n})\nmodule.exports = Reference\n","const parse = require('../template/_parsers/parse')\n// const parse = require('../../templates/wikipedia/page').citation;\nconst parseSentence = require('../04-sentence').fromText\nconst Reference = require('./Reference')\n\n//structured Cite templates - {{Cite..\nconst hasCitation = function(str) {\n return /^ *?\\{\\{ *?(cite|citation)/i.test(str) && /\\}\\} *?$/.test(str) && /citation needed/i.test(str) === false\n}\n\nconst parseCitation = function(tmpl) {\n let obj = parse(tmpl)\n obj.type = obj.template.replace(/cite /, '')\n obj.template = 'citation'\n return obj\n}\n\n//handle unstructured ones - some text\nconst parseInline = function(str) {\n let obj = parseSentence(str) || {}\n return {\n template: 'citation',\n type: 'inline',\n data: {},\n inline: obj\n }\n}\n\n// parse xml tags\nconst parseRefs = function(section) {\n let references = []\n let wiki = section.wiki\n wiki = wiki.replace(/ ?([\\s\\S]{0,1800}?)<\\/ref> ?/gi, function(a, tmpl) {\n if (hasCitation(tmpl)) {\n let obj = parseCitation(tmpl)\n if (obj) {\n references.push(obj)\n }\n wiki = wiki.replace(tmpl, '')\n } else {\n references.push(parseInline(tmpl))\n }\n return ' '\n })\n // \n wiki = wiki.replace(/ ?]{0,200}?\\/> ?/gi, ' ')\n // \n wiki = wiki.replace(/ ?]{0,200}?>([\\s\\S]{0,1800}?)<\\/ref> ?/gi, function(a, tmpl) {\n if (hasCitation(tmpl)) {\n let obj = parseCitation(tmpl)\n if (obj) {\n references.push(obj)\n }\n wiki = wiki.replace(tmpl, '')\n } else {\n references.push(parseInline(tmpl))\n }\n return ' '\n })\n //now that we're done with xml, do a generic + dangerous xml-tag removal\n wiki = wiki.replace(/ ?<[ \\/]?[a-z0-9]{1,8}[a-z0-9=\" ]{2,20}[ \\/]?> ?/g, ' ') //\n section.references = references.map(r => new Reference(r))\n section.wiki = wiki\n}\nmodule.exports = parseRefs\n","const fns = require('../_lib/helpers')\nconst parseSentence = require('../04-sentence/').fromText\nconst parseReferences = require('../reference/')\nconst heading_reg = /^(={1,5})(.{1,200}?)={1,5}$/\n\n//interpret depth, title of headings like '==See also=='\nconst parseHeading = function(section, str) {\n let m = str.match(heading_reg)\n if (!m) {\n section.title = ''\n section.depth = 0\n return section\n }\n let title = m[2] || ''\n title = parseSentence(title).text()\n //amazingly, you can see inline {{templates}} in this text, too\n //... let's not think about that now.\n title = title.replace(/\\{\\{.+?\\}\\}/, '')\n //same for references (i know..)\n let obj = { wiki: title }\n parseReferences(obj)\n title = obj.wiki\n //trim leading/trailing whitespace\n title = fns.trim_whitespace(title)\n let depth = 0\n if (m[1]) {\n depth = m[1].length - 2\n }\n section.title = title\n section.depth = depth\n return section\n}\nmodule.exports = parseHeading\n","//remove top-bottoms\nconst cleanup = function(lines) {\n lines = lines.filter(line => {\n //a '|+' row is a 'table caption', remove it.\n return line && /^\\|\\+/.test(line) !== true\n })\n if (/^{\\|/.test(lines[0]) === true) {\n lines.shift()\n }\n if (/^\\|}/.test(lines[lines.length - 1]) === true) {\n lines.pop()\n }\n if (/^\\|-/.test(lines[0]) === true) {\n lines.shift()\n }\n return lines\n}\n\n//turn newline seperated into '|-' seperated\nconst findRows = function(lines) {\n let rows = []\n let row = []\n lines = cleanup(lines)\n for (let i = 0; i < lines.length; i += 1) {\n let line = lines[i]\n //'|-' is a row-seperator\n if (/^\\|-/.test(line) === true) {\n //okay, we're done the row\n if (row.length > 0) {\n rows.push(row)\n row = []\n }\n } else {\n //look for '||' inline row-splitter\n line = line.split(/(?:\\|\\||!!)/)\n //support newline -> '||'\n if (!line[0] && line[1]) {\n line.shift()\n }\n line.forEach(l => {\n l = l.replace(/^\\| */, '')\n l = l.trim()\n row.push(l)\n })\n }\n }\n //finish the last one\n if (row.length > 0) {\n rows.push(row)\n }\n return rows\n}\nmodule.exports = findRows\n","const getRowSpan = /.*rowspan *?= *?[\"']?([0-9]+)[\"']?[ \\|]*/\nconst getColSpan = /.*colspan *?= *?[\"']?([0-9]+)[\"']?[ \\|]*/\n\n//colspans stretch ←left/right→\nconst doColSpan = function(rows) {\n rows.forEach(row => {\n row.forEach((str, c) => {\n let m = str.match(getColSpan)\n if (m !== null) {\n let num = parseInt(m[1], 10)\n\n //...maybe if num is so big, and centered, remove it?\n // if (num > 3) {\n // rows[r] = []\n // return\n // }\n //splice-in n empty columns right here\n row[c] = str.replace(getColSpan, '')\n for (let i = 1; i < num; i += 1) {\n row.splice(c + 1, 0, '')\n }\n }\n })\n })\n rows = rows.filter(r => r.length > 0)\n return rows\n}\n\n//colspans stretch up/down\nconst doRowSpan = function(rows) {\n rows.forEach((row, r) => {\n row.forEach((str, c) => {\n let m = str.match(getRowSpan)\n if (m !== null) {\n let num = parseInt(m[1], 10)\n //copy this cell down n rows\n str = str.replace(getRowSpan, '')\n row[c] = str\n for (let i = r + 1; i < r + num; i += 1) {\n if (!rows[i]) {\n break\n }\n rows[i].splice(c, 0, str)\n }\n }\n })\n })\n return rows\n}\n\n//\nconst handleSpans = function(rows) {\n rows = doColSpan(rows)\n rows = doRowSpan(rows)\n return rows\n}\nmodule.exports = handleSpans\n","const parseSentence = require('../../04-sentence/').fromText\nconst findRows = require('./_findRows')\nconst handleSpans = require('./_spans')\nconst isHeading = /^!/\n\n//common ones\nconst headings = {\n name: true,\n age: true,\n born: true,\n date: true,\n year: true,\n city: true,\n country: true,\n population: true,\n count: true,\n number: true\n}\n\n//additional table-cruft to remove before parseLine method\nconst cleanText = function(str) {\n str = parseSentence(str).text()\n //anything before a single-pipe is styling, so remove it\n if (str.match(/\\|/)) {\n str = str.replace(/.+\\| ?/, '') //class=\"unsortable\"|title\n }\n str = str.replace(/style=['\"].*?[\"']/, '')\n //'!' is used as a highlighed-column\n str = str.replace(/^!/, '')\n str = str.trim()\n return str\n}\n\nconst skipSpanRow = function(row) {\n let len = row.length\n let hasTxt = row.filter(str => str).length\n //does it have 3 empty spaces?\n if (len - hasTxt > 3) {\n return true\n }\n return false\n}\n\n//remove non-header span rows\nconst removeMidSpans = function(rows) {\n rows = rows.filter(row => {\n if (row.length === 1 && row[0] && isHeading.test(row[0]) && /rowspan/i.test(row[0]) === false) {\n return false\n }\n return true\n })\n return rows\n}\n\n//'!' starts a header-row\nconst findHeaders = function(rows = []) {\n let headers = []\n\n // is the first-row just a ton of colspan?\n if (skipSpanRow(rows[0])) {\n rows.shift()\n }\n\n let first = rows[0]\n if (first && first[0] && first[1] && (/^!/.test(first[0]) || /^!/.test(first[1]))) {\n headers = first.map(h => {\n h = h.replace(/^\\! */, '')\n h = cleanText(h)\n return h\n })\n rows.shift()\n }\n //try the second row, too (overwrite first-row, if it exists)\n first = rows[0]\n if (first && first[0] && first[1] && /^!/.test(first[0]) && /^!/.test(first[1])) {\n first.forEach((h, i) => {\n h = h.replace(/^\\! */, '')\n h = cleanText(h)\n if (Boolean(h) === true) {\n headers[i] = h\n }\n })\n rows.shift()\n }\n return headers\n}\n\n//turn headers, array into an object\nconst parseRow = function(arr, headers) {\n let row = {}\n arr.forEach((str, i) => {\n let h = headers[i] || 'col' + (i + 1)\n let s = parseSentence(str)\n s.text(cleanText(s.text()))\n row[h] = s\n })\n return row\n}\n\n//should we use the first row as a the headers?\nconst firstRowHeader = function(rows) {\n if (rows.length <= 3) {\n return []\n }\n let headers = rows[0].slice(0)\n headers = headers.map(h => {\n h = h.replace(/^\\! */, '')\n h = parseSentence(h).text()\n h = cleanText(h)\n h = h.toLowerCase()\n return h\n })\n for (let i = 0; i < headers.length; i += 1) {\n if (headings.hasOwnProperty(headers[i])) {\n rows.shift()\n return headers\n }\n }\n return []\n}\n\n//turn a {|...table string into an array of arrays\nconst parseTable = function(wiki) {\n let lines = wiki\n .replace(/\\r/g, '')\n .replace(/\\n(\\s*[^|!{\\s])/g, ' $1') //remove unecessary newlines\n .split(/\\n/)\n .map(l => l.trim())\n let rows = findRows(lines)\n\n //remove non-header span rows\n rows = removeMidSpans(rows)\n //support colspan, rowspan...\n rows = handleSpans(rows)\n //grab the header rows\n let headers = findHeaders(rows)\n if (!headers || headers.length <= 1) {\n headers = firstRowHeader(rows)\n let want = rows[rows.length - 1] || []\n //try the second row\n if (headers.length <= 1 && want.length > 2) {\n headers = firstRowHeader(rows.slice(1))\n if (headers.length > 0) {\n rows = rows.slice(2) //remove them\n }\n }\n }\n //index each column by it's header\n let table = rows.map(arr => {\n return parseRow(arr, headers)\n })\n return table\n}\n\nmodule.exports = parseTable\n","const encode = require('../_lib/encode')\n//\nconst toJson = function(tables, options) {\n return tables.map(table => {\n let row = {}\n Object.keys(table).forEach(k => {\n row[k] = table[k].json() //(they're sentence objects)\n })\n //encode them, for mongodb\n if (options.encode === true) {\n row = encode.encodeObj(row)\n }\n return row\n })\n}\nmodule.exports = toJson\n","const setDefaults = require('../_lib/setDefaults')\nconst toJson = require('./toJson')\nconst defaults = {}\n\nconst Table = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n links(n) {\n let links = []\n this.data.forEach(r => {\n Object.keys(r).forEach(k => {\n links = links.concat(r[k].links())\n })\n })\n //grab a specific link..\n if (typeof n === 'number') {\n return links[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = links.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return links\n },\n keyValue(options) {\n let rows = this.json(options)\n rows.forEach(row => {\n Object.keys(row).forEach(k => {\n row[k] = row[k].text\n })\n })\n return rows\n },\n json(options) {\n options = setDefaults(options, defaults)\n return toJson(this.data, options)\n },\n\n text() {\n return ''\n }\n}\nmethods.keyvalue = methods.keyValue\nmethods.keyval = methods.keyValue\n\nObject.keys(methods).forEach(k => {\n Table.prototype[k] = methods[k]\n})\nmodule.exports = Table\n","const parseTable = require('./parse')\nconst Table = require('./Table')\n// const table_reg = /\\{\\|[\\s\\S]+?\\|\\}/g; //the largest-cities table is ~70kchars.\nconst openReg = /^\\s*{\\|/\nconst closeReg = /^\\s*\\|}/\n\n//tables can be recursive, so looky-here.\nconst findTables = function(section) {\n let list = []\n let wiki = section.wiki\n let lines = wiki.split('\\n')\n let stack = []\n for (let i = 0; i < lines.length; i += 1) {\n //start a table\n if (openReg.test(lines[i]) === true) {\n stack.push(lines[i])\n continue\n }\n //close a table\n if (closeReg.test(lines[i]) === true) {\n stack[stack.length - 1] += '\\n' + lines[i]\n let table = stack.pop()\n list.push(table)\n continue\n }\n //keep-going on one\n if (stack.length > 0) {\n stack[stack.length - 1] += '\\n' + lines[i]\n }\n }\n //work-em together for a Table class\n let tables = []\n list.forEach(str => {\n if (str) {\n //also reremove a newline at the end of the table (awkward)\n wiki = wiki.replace(str + '\\n', '')\n wiki = wiki.replace(str, '')\n let data = parseTable(str)\n if (data && data.length > 0) {\n tables.push(new Table(data))\n }\n }\n })\n\n if (tables.length > 0) {\n section.tables = tables\n }\n section.wiki = wiki\n}\n\nmodule.exports = findTables\n","const setDefaults = require('../_lib/setDefaults')\n\nconst defaults = {\n sentences: true\n}\n\nconst toJson = function(p, options) {\n options = setDefaults(options, defaults)\n let data = {}\n if (options.sentences === true) {\n data.sentences = p.sentences().map(s => s.json(options))\n }\n return data\n}\nmodule.exports = toJson\n","const toJSON = require('./toJson')\nconst setDefaults = require('../_lib/setDefaults')\nconst defaults = {\n sentences: true,\n lists: true,\n images: true\n}\n\nconst Paragraph = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n sentences: function(num) {\n if (typeof num === 'number') {\n return this.data.sentences[num]\n }\n return this.data.sentences || []\n },\n references: function(num) {\n if (typeof num === 'number') {\n return this.data.references[num]\n }\n return this.data.references\n },\n lists: function(num) {\n if (typeof num === 'number') {\n return this.data.lists[num]\n }\n return this.data.lists\n },\n images(num) {\n if (typeof num === 'number') {\n return this.data.images[num]\n }\n return this.data.images || []\n },\n links: function(n) {\n let arr = []\n this.sentences().forEach(s => {\n arr = arr.concat(s.links(n))\n })\n if (typeof n === 'number') {\n return arr[n]\n } else if (typeof n === 'string') {\n //grab a specific link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = arr.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return arr || []\n },\n interwiki(num) {\n let arr = []\n this.sentences().forEach(s => {\n arr = arr.concat(s.interwiki())\n })\n if (typeof num === 'number') {\n return arr[num]\n }\n return arr || []\n },\n text: function(options) {\n options = setDefaults(options, defaults)\n let str = this.sentences()\n .map(s => s.text(options))\n .join(' ')\n this.lists().forEach(list => {\n str += '\\n' + list.text()\n })\n return str\n },\n json: function(options) {\n options = setDefaults(options, defaults)\n return toJSON(this, options)\n }\n}\nmethods.citations = methods.references\nObject.keys(methods).forEach(k => {\n Paragraph.prototype[k] = methods[k]\n})\nmodule.exports = Paragraph\n","//find all the pairs of '[[...[[..]]...]]' in the text\n//used to properly root out recursive template calls, [[.. [[...]] ]]\n//basically just adds open tags, and subtracts closing tags\nconst opener = '['\nconst closer = ']'\nfunction nested_find(text) {\n let out = []\n let last = []\n const chars = text.split('')\n let open = 0\n for (let i = 0; i < chars.length; i++) {\n const c = text[i]\n //increment open tag\n if (c === opener) {\n open += 1\n }\n //decrement close tag\n else if (c === closer) {\n open -= 1\n if (open < 0) {\n open = 0\n }\n } else if (last.length === 0) {\n // If we're not inside of a pair of delimiters, we can discard the current letter.\n // The return of this function is only used to extract images.\n continue\n }\n\n last.push(c)\n if (open === 0 && last.length > 0) {\n //first, fix botched parse\n let open_count = 0\n let close_count = 0\n for (let j = 0; j < last.length; j++) {\n if (last[j] === opener) {\n open_count++\n } else if (last[j] === closer) {\n close_count++\n }\n }\n //is it botched?\n if (open_count > close_count) {\n last.push(closer)\n }\n //looks good, keep it\n out.push(last.join(''))\n last = []\n }\n }\n return out\n}\nmodule.exports = nested_find\n","const i18n = require('../_data/i18n')\nconst Image = require('./Image')\nconst parseTemplate = require('../template/_parsers/parse')\nconst parseSentence = require('../04-sentence').fromText\nconst nested_find = require('./nested_find')\n//regexes:\nconst isFile = new RegExp('(' + i18n.images.join('|') + '):', 'i')\nlet fileNames = `(${i18n.images.join('|')})`\nconst file_reg = new RegExp(fileNames + ':(.+?)[\\\\||\\\\]]', 'iu')\n\n//style directives for Wikipedia:Extended_image_syntax\nconst imgLayouts = {\n thumb: true,\n thumbnail: true,\n border: true,\n right: true,\n left: true,\n center: true,\n top: true,\n bottom: true,\n none: true,\n upright: true,\n baseline: true,\n middle: true,\n sub: true,\n super: true\n}\n\n//images are usually [[image:my_pic.jpg]]\nconst oneImage = function(img) {\n let m = img.match(file_reg)\n if (m === null || !m[2]) {\n return null\n }\n let file = `${m[1]}:${m[2] || ''}`\n file = file.trim()\n //titlecase it\n let title = file.charAt(0).toUpperCase() + file.substring(1)\n //spaces to underscores\n title = title.replace(/ /g, '_')\n if (title) {\n let obj = {\n file: file\n }\n //try to grab other metadata, too\n img = img.replace(/^\\[\\[/, '')\n img = img.replace(/\\]\\]$/, '')\n\n //https://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax\n // - [[File:Name|Type|Border|Location|Alignment|Size|link=Link|alt=Alt|lang=Langtag|Caption]]\n let imgData = parseTemplate(img)\n let arr = imgData.list || []\n //parse-out alt text, if explicitly given\n if (imgData.alt) {\n obj.alt = imgData.alt\n }\n //remove 'thumb' and things\n arr = arr.filter(str => imgLayouts.hasOwnProperty(str) === false)\n if (arr[arr.length - 1]) {\n obj.caption = parseSentence(arr[arr.length - 1])\n }\n return new Image(obj, img)\n }\n return null\n}\n\nconst parseImages = function(paragraph) {\n let wiki = paragraph.wiki\n\n //parse+remove scary '[[ [[]] ]]' stuff\n let matches = nested_find(wiki)\n matches.forEach(function(s) {\n if (isFile.test(s) === true) {\n paragraph.images = paragraph.images || []\n let img = oneImage(s)\n if (img) {\n paragraph.images.push(img)\n }\n wiki = wiki.replace(s, '')\n }\n })\n paragraph.wiki = wiki\n}\nmodule.exports = parseImages\n","const setDefaults = require('../_lib/setDefaults')\nconst defaults = {}\n\nconst toText = (list, options) => {\n return list\n .map(s => {\n let str = s.text(options)\n return ' * ' + str\n })\n .join('\\n')\n}\n\nconst List = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n lines() {\n return this.data\n },\n links(n) {\n let links = []\n this.lines().forEach(s => {\n links = links.concat(s.links())\n })\n if (typeof n === 'number') {\n return links[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = links.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return links\n },\n json(options) {\n options = setDefaults(options, defaults)\n return this.lines().map(s => s.json(options))\n },\n text() {\n return toText(this.data)\n }\n}\n\nObject.keys(methods).forEach(k => {\n List.prototype[k] = methods[k]\n})\nmodule.exports = List\n","const List = require('./List')\nconst parseSentence = require('../04-sentence/').fromText\nconst list_reg = /^[#\\*:;\\|]+/\nconst bullet_reg = /^\\*+[^:,\\|]{4}/\nconst number_reg = /^ ?\\#[^:,\\|]{4}/\nconst has_word = /[a-z_0-9\\]\\}]/i\n\n// does it start with a bullet point or something?\nconst isList = function(line) {\n return list_reg.test(line) || bullet_reg.test(line) || number_reg.test(line)\n}\n\n//make bullets/numbers into human-readable *'s\nconst cleanList = function(list) {\n let number = 1\n list = list.filter(l => l)\n for (let i = 0; i < list.length; i++) {\n let line = list[i]\n //add # numberings formatting\n if (line.match(number_reg)) {\n line = line.replace(/^ ?#*/, number + ') ')\n line = line + '\\n'\n number += 1\n } else if (line.match(list_reg)) {\n number = 1\n line = line.replace(list_reg, '')\n }\n list[i] = parseSentence(line)\n }\n return list\n}\n\nconst grabList = function(lines, i) {\n let sub = []\n for (let o = i; o < lines.length; o++) {\n if (isList(lines[o])) {\n sub.push(lines[o])\n } else {\n break\n }\n }\n sub = sub.filter(a => a && has_word.test(a))\n sub = cleanList(sub)\n return sub\n}\n\nconst parseList = function(paragraph) {\n let wiki = paragraph.wiki\n let lines = wiki.split(/\\n/g)\n // lines = lines.filter(l => has_word.test(l));\n let lists = []\n let theRest = []\n for (let i = 0; i < lines.length; i++) {\n if (isList(lines[i]) && lines[i + 1] && isList(lines[i + 1])) {\n let sub = grabList(lines, i)\n if (sub.length > 0) {\n lists.push(sub)\n i += sub.length - 1\n }\n } else {\n theRest.push(lines[i])\n }\n }\n paragraph.lists = lists.map(l => new List(l))\n paragraph.wiki = theRest.join('\\n')\n}\nmodule.exports = parseList\n","const Paragraph = require('./Paragraph')\nconst parseSentences = require('../04-sentence').byParagraph\n\nconst twoNewLines = /\\r?\\n\\r?\\n/\nconst parse = {\n image: require('../image'),\n list: require('../list')\n}\n\nconst parseParagraphs = function(section) {\n let wiki = section.wiki\n let paragraphs = wiki.split(twoNewLines)\n //don't create empty paragraphs\n paragraphs = paragraphs.filter(p => p && p.trim().length > 0)\n paragraphs = paragraphs.map(str => {\n let paragraph = {\n wiki: str,\n lists: [],\n sentences: [],\n images: []\n }\n //parse the lists\n parse.list(paragraph)\n // parse images\n parse.image(paragraph)\n //parse the sentences\n parseSentences(paragraph)\n return new Paragraph(paragraph)\n })\n section.wiki = wiki\n section.paragraphs = paragraphs\n}\nmodule.exports = parseParagraphs\n","const encode = require('../_lib/encode')\n\n//turn an infobox into some nice json\nconst toJson = function(infobox, options) {\n let json = Object.keys(infobox.data).reduce((h, k) => {\n if (infobox.data[k]) {\n h[k] = infobox.data[k].json()\n }\n return h\n }, {})\n\n //support mongo-encoding keys\n if (options.encode === true) {\n json = encode.encodeObj(json)\n }\n return json\n}\nmodule.exports = toJson\n","const toJson = require('./toJson')\nconst Image = require('../image/Image')\n\nconst normalize = str => {\n str = str.toLowerCase()\n str = str.replace(/[-_]/g, ' ')\n return str.trim()\n}\n\n//a formal key-value data table about a topic\nconst Infobox = function(obj) {\n this._type = obj.type\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: obj.data\n })\n}\n\nconst methods = {\n type: function() {\n return this._type\n },\n links: function(n) {\n let arr = []\n Object.keys(this.data).forEach(k => {\n this.data[k].links().forEach(l => arr.push(l))\n })\n if (typeof n === 'number') {\n return arr[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = arr.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return arr\n },\n image: function() {\n let s = this.get('image') || this.get('image2') || this.get('logo')\n if (!s) {\n return null\n }\n let obj = s.json()\n obj.file = obj.text\n obj.text = ''\n return new Image(obj)\n },\n get: function(key = '') {\n key = normalize(key)\n let keys = Object.keys(this.data)\n for (let i = 0; i < keys.length; i += 1) {\n let tmp = normalize(keys[i])\n if (key === tmp) {\n return this.data[keys[i]]\n }\n }\n return null\n },\n text: function() {\n return ''\n },\n json: function(options) {\n options = options || {}\n return toJson(this, options)\n },\n keyValue: function() {\n return Object.keys(this.data).reduce((h, k) => {\n if (this.data[k]) {\n h[k] = this.data[k].text()\n }\n return h\n }, {})\n }\n}\n//aliases\n\nObject.keys(methods).forEach(k => {\n Infobox.prototype[k] = methods[k]\n})\nInfobox.prototype.data = Infobox.prototype.keyValue\nInfobox.prototype.template = Infobox.prototype.type\nInfobox.prototype.images = Infobox.prototype.image\nmodule.exports = Infobox\n","const open = '{'\nconst close = '}'\n\n//grab all first-level recursions of '{{...}}'\nconst findFlat = function(wiki) {\n let depth = 0\n let list = []\n let carry = []\n for (let i = wiki.indexOf(open); i !== -1 && i < wiki.length; depth > 0 ? i++ : (i = wiki.indexOf(open, i + 1))) {\n let c = wiki[i]\n //open it\n if (c === open) {\n depth += 1\n }\n //close it\n if (depth > 0) {\n if (c === close) {\n depth -= 1\n if (depth === 0) {\n carry.push(c)\n let tmpl = carry.join('')\n carry = []\n //last check\n if (/\\{\\{/.test(tmpl) && /\\}\\}/.test(tmpl)) {\n list.push(tmpl)\n }\n continue\n }\n }\n //require two '{{' to open it\n if (depth === 1 && c !== open && c !== close) {\n depth = 0\n carry = []\n continue\n }\n carry.push(c)\n }\n }\n return list\n}\nmodule.exports = findFlat\n","const fmtName = require('./_fmtName')\n//get the name of the template\n//templates are usually '{{name|stuff}}'\nconst getName = function(tmpl) {\n let name = null\n //{{name|foo}}\n if (/^\\{\\{[^\\n]+\\|/.test(tmpl)) {\n name = (tmpl.match(/^\\{\\{(.+?)\\|/) || [])[1]\n } else if (tmpl.indexOf('\\n') !== -1) {\n // {{name \\n...\n name = (tmpl.match(/^\\{\\{(.+?)\\n/) || [])[1]\n } else {\n //{{name here}}\n name = (tmpl.match(/^\\{\\{(.+?)\\}\\}$/) || [])[1]\n }\n if (name) {\n name = name.replace(/:.*/, '')\n name = fmtName(name)\n }\n return name || null\n}\nmodule.exports = getName\n","const findFlat = require('./flat')\nconst getName = require('../_parsers/_getName')\nconst hasTemplate = /\\{\\{/\n\nconst parseTemplate = function(tmpl) {\n return {\n body: tmpl,\n name: getName(tmpl),\n children: []\n }\n}\n\nconst doEach = function(obj) {\n // peel-off top-level\n let wiki = obj.body.substr(2)\n wiki = wiki.replace(/\\}\\}$/, '')\n\n // get our child templates\n obj.children = findFlat(wiki)\n obj.children = obj.children.map(parseTemplate)\n\n if (obj.children.length === 0) {\n return obj\n }\n // recurse through children\n obj.children.forEach(ch => {\n let inside = ch.body.substr(2)\n if (hasTemplate.test(inside)) {\n return doEach(ch) //keep going\n }\n return null\n })\n return obj\n}\n\n// return a nested structure of all templates\nconst findTemplates = function(wiki) {\n let list = findFlat(wiki)\n list = list.map(parseTemplate)\n list = list.map(doEach)\n return list\n}\n\nmodule.exports = findTemplates\n","//we explicitly ignore these, because they sometimes have resolve some data\nconst list = [\n //https://en.wikipedia.org/wiki/category:templates_with_no_visible_output\n 'anchor',\n 'defaultsort',\n 'use list-defined references',\n 'void',\n //https://en.wikipedia.org/wiki/Category:Protection_templates\n 'pp',\n 'pp-move-indef',\n 'pp-semi-indef',\n 'pp-vandalism',\n //https://en.wikipedia.org/wiki/Template:R\n 'r',\n //out-of-scope still - https://en.wikipedia.org/wiki/Template:Tag\n '#tag',\n //https://en.wikipedia.org/wiki/Template:Navboxes\n 'navboxes',\n 'reflist',\n 'ref-list',\n 'div col',\n // 'authority control',\n //https://en.wikipedia.org/wiki/Template:Citation_needed\n // 'better source',\n // 'citation needed',\n // 'clarify',\n // 'cite quote',\n // 'dead link',\n // 'by whom',\n // 'dubious',\n // 'when',\n // 'who',\n // 'quantify',\n // 'refimprove',\n // 'weasel inline',\n //https://en.wikipedia.org/wiki/Template:End\n 'pope list end',\n 'shipwreck list end',\n 'starbox end',\n 'end box',\n 'end',\n 's-end'\n]\nconst ignore = list.reduce((h, str) => {\n h[str] = true\n return h\n}, {})\nmodule.exports = ignore\n","const i18n = require('../_data/i18n')\nconst i18nReg = new RegExp('^(subst.)?(' + i18n.infoboxes.join('|') + ')[: \\n]', 'i')\n//some looser ones\nconst startReg = /^infobox /i\nconst endReg = / infobox$/i\nconst yearIn = /$Year in [A-Z]/i\n\n//some known ones from\n// https://en.wikipedia.org/wiki/Wikipedia:List_of_infoboxes\n// and https://en.wikipedia.org/wiki/Category:Infobox_templates\nconst known = {\n 'gnf protein box': true,\n 'automatic taxobox': true,\n 'chembox ': true,\n editnotice: true,\n geobox: true,\n hybridbox: true,\n ichnobox: true,\n infraspeciesbox: true,\n mycomorphbox: true,\n oobox: true,\n 'paraphyletic group': true,\n speciesbox: true,\n subspeciesbox: true,\n 'starbox short': true,\n taxobox: true,\n nhlteamseason: true,\n 'asian games bid': true,\n 'canadian federal election results': true,\n 'dc thomson comic strip': true,\n 'daytona 24 races': true,\n edencharacter: true,\n 'moldova national football team results': true,\n samurai: true,\n protein: true,\n 'sheet authority': true,\n 'order-of-approx': true,\n 'bacterial labs': true,\n 'medical resources': true,\n ordination: true,\n 'hockey team coach': true,\n 'hockey team gm': true,\n 'hockey team player': true,\n 'hockey team start': true,\n mlbbioret: true\n}\n//\nconst isInfobox = function(name) {\n // known\n if (known.hasOwnProperty(name) === true) {\n return true\n }\n if (i18nReg.test(name)) {\n return true\n }\n if (startReg.test(name) || endReg.test(name)) {\n return true\n }\n //these are also infoboxes: 'Year in Belarus'\n if (yearIn.test(name)) {\n return true\n }\n return false\n}\n\n//turns template data into good inforbox data\nconst fmtInfobox = function(obj = {}) {\n let m = obj.template.match(i18nReg)\n let type = obj.template\n if (m && m[0]) {\n type = type.replace(m[0], '')\n }\n type = type.trim()\n let infobox = {\n template: 'infobox',\n type: type,\n data: obj\n }\n delete infobox.data.template // already have this.\n delete infobox.data.list //just in case!\n return infobox\n}\n\nmodule.exports = {\n isInfobox: isInfobox,\n format: fmtInfobox\n}\n","module.exports = [\n undefined, //1-based months.. :/\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n]\n","//assorted parsing methods for date/time templates\nconst months = require('./_months')\n\nconst monthName = months.reduce((h, str, i) => {\n if (i === 0) {\n return h\n }\n h[str.toLowerCase()] = i\n return h\n}, {})\n\n//parse year|month|date numbers\nconst ymd = function(arr) {\n let obj = {}\n let units = ['year', 'month', 'date', 'hour', 'minute', 'second']\n //parse each unit in sequence..\n for (let i = 0; i < units.length; i += 1) {\n //skip it\n if (!arr[i] && arr[1] !== 0) {\n continue\n }\n let num = parseInt(arr[i], 10)\n if (isNaN(num) === false) {\n obj[units[i]] = num //we good.\n } else if (units[i] === 'month' && monthName.hasOwnProperty(arr[i])) {\n //try for month-name, like 'january\n let month = monthName[arr[i]]\n obj[units[i]] = month\n } else {\n //we dead. so skip this unit\n delete obj[units[i]]\n }\n }\n //try for timezone,too ftw\n let last = arr[arr.length - 1] || ''\n last = String(last)\n if (last.toLowerCase() === 'z') {\n obj.tz = 'UTC'\n } else if (/[+-][0-9]+:[0-9]/.test(last)) {\n obj.tz = arr[6]\n }\n return obj\n}\n\n//zero-pad a number\nconst pad = function(num) {\n if (num < 10) {\n return '0' + num\n }\n return String(num)\n}\n\nconst toText = function(date) {\n //eg '1995'\n let str = String(date.year || '')\n if (date.month !== undefined && months.hasOwnProperty(date.month) === true) {\n if (date.date === undefined) {\n //January 1995\n str = `${months[date.month]} ${date.year}`\n } else {\n //January 5, 1995\n str = `${months[date.month]} ${date.date}, ${date.year}`\n //add times, if available\n if (date.hour !== undefined && date.minute !== undefined) {\n let time = `${pad(date.hour)}:${pad(date.minute)}`\n if (date.second !== undefined) {\n time = time + ':' + pad(date.second)\n }\n str = time + ', ' + str\n //add timezone, if there, at the end in brackets\n }\n if (date.tz) {\n str += ` (${date.tz})`\n }\n }\n }\n return str\n}\n\nmodule.exports = {\n toText: toText,\n ymd: ymd\n}\n\n// console.log(toText(ymd([2018, 3, 28])));\n","const format = require('./_format')\nconst parse = require('../../_parsers/parse')\n\nconst misc = {\n reign: tmpl => {\n let order = ['start', 'end']\n let obj = parse(tmpl, order)\n return `(r. ${obj.start} – ${obj.end})`\n },\n circa: tmpl => {\n let obj = parse(tmpl, ['year'])\n return `c. ${obj.year}`\n },\n //we can't do timezones, so fake this one a little bit\n //https://en.wikipedia.org/wiki/Template:Time\n time: () => {\n let d = new Date()\n let obj = format.ymd([d.getFullYear(), d.getMonth(), d.getDate()])\n return format.toText(obj)\n },\n monthname: 0,\n //https://en.wikipedia.org/wiki/Template:OldStyleDate\n oldstyledate: tmpl => {\n let order = ['date', 'year']\n let obj = parse(tmpl, order)\n let str = obj.date\n if (obj.year) {\n str += ' ' + obj.year\n }\n return str\n }\n}\nmodule.exports = misc\n","//this is allowed to be rough\nconst day = 1000 * 60 * 60 * 24\nconst month = day * 30\nconst year = day * 365\n\nconst getEpoch = function(obj) {\n return new Date(`${obj.year}-${obj.month || 0}-${obj.date || 1}`).getTime()\n}\n\n//very rough!\nconst delta = function(from, to) {\n from = getEpoch(from)\n to = getEpoch(to)\n let diff = to - from\n let obj = {}\n //get years\n let years = Math.floor(diff / year, 10)\n if (years > 0) {\n obj.years = years\n diff -= obj.years * year\n }\n //get months\n let months = Math.floor(diff / month, 10)\n if (months > 0) {\n obj.months = months\n diff -= obj.months * month\n }\n //get days\n let days = Math.floor(diff / day, 10)\n if (days > 0) {\n obj.days = days\n // diff -= (obj.days * day);\n }\n return obj\n}\n\nmodule.exports = delta\n","const strip = require('../../_parsers/_strip')\nconst parse = require('../../_parsers/parse')\nconst delta = require('./_delta')\nconst fmt = require('./_format')\nconst ymd = fmt.ymd\nconst toText = fmt.toText\n\n//wrap it up as a template\nconst template = function(date) {\n return {\n template: 'date',\n data: date\n }\n}\n\nconst getBoth = function(tmpl) {\n tmpl = strip(tmpl)\n let arr = tmpl.split('|')\n let from = ymd(arr.slice(1, 4))\n let to = arr.slice(4, 7)\n //assume now, if 'to' is empty\n if (to.length === 0) {\n let d = new Date()\n to = [d.getFullYear(), d.getMonth(), d.getDate()]\n }\n to = ymd(to)\n return {\n from: from,\n to: to\n }\n}\n\nconst parsers = {\n //generic {{date|year|month|date}} template\n date: (tmpl, list) => {\n let order = ['year', 'month', 'date', 'hour', 'minute', 'second', 'timezone']\n let obj = parse(tmpl, order)\n let data = ymd([obj.year, obj.month, obj.date || obj.day])\n obj.text = toText(data) //make the replacement string\n if (obj.timezone) {\n if (obj.timezone === 'Z') {\n obj.timezone = 'UTC'\n }\n obj.text += ` (${obj.timezone})`\n }\n if (obj.hour && obj.minute) {\n if (obj.second) {\n obj.text = `${obj.hour}:${obj.minute}:${obj.second}, ` + obj.text\n } else {\n obj.text = `${obj.hour}:${obj.minute}, ` + obj.text\n }\n }\n if (obj.text) {\n list.push(template(obj))\n }\n return obj.text\n },\n\n //support parsing of 'February 10, 1992'\n natural_date: (tmpl, list) => {\n let order = ['text']\n let obj = parse(tmpl, order)\n let str = obj.text || ''\n // - just a year\n let date = {}\n if (/^[0-9]{4}$/.test(str)) {\n date.year = parseInt(str, 10)\n } else {\n //parse the date, using the js date object (for now?)\n let txt = str.replace(/[a-z]+\\/[a-z]+/i, '')\n txt = txt.replace(/[0-9]+:[0-9]+(am|pm)?/i, '')\n let d = new Date(txt)\n if (isNaN(d.getTime()) === false) {\n date.year = d.getFullYear()\n date.month = d.getMonth() + 1\n date.date = d.getDate()\n }\n }\n list.push(template(date))\n return str.trim()\n },\n\n //just grab the first value, and assume it's a year\n one_year: (tmpl, list) => {\n let order = ['year']\n let obj = parse(tmpl, order)\n let year = Number(obj.year)\n list.push(\n template({\n year: year\n })\n )\n return String(year)\n },\n\n //assume 'y|m|d' | 'y|m|d' // {{BirthDeathAge|B|1976|6|6|1990|8|8}}\n two_dates: (tmpl, list) => {\n let order = [\n 'b',\n 'birth_year',\n 'birth_month',\n 'birth_date',\n 'death_year',\n 'death_month',\n 'death_date'\n ]\n let obj = parse(tmpl, order)\n //'b' means show birth-date, otherwise show death-date\n if (obj.b && obj.b.toLowerCase() === 'b') {\n let date = ymd([obj.birth_year, obj.birth_month, obj.birth_date])\n list.push(template(date))\n return toText(date)\n }\n let date = ymd([obj.death_year, obj.death_month, obj.death_date])\n list.push(template(date))\n return toText(date)\n },\n\n age: tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n return diff.years || 0\n },\n\n 'diff-y': tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n if (diff.years === 1) {\n return diff.years + ' year'\n }\n return (diff.years || 0) + ' years'\n },\n 'diff-ym': tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n let arr = []\n if (diff.years === 1) {\n arr.push(diff.years + ' year')\n } else if (diff.years && diff.years !== 0) {\n arr.push(diff.years + ' years')\n }\n if (diff.months === 1) {\n arr.push('1 month')\n } else if (diff.months && diff.months !== 0) {\n arr.push(diff.months + ' months')\n }\n return arr.join(', ')\n },\n 'diff-ymd': tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n let arr = []\n if (diff.years === 1) {\n arr.push(diff.years + ' year')\n } else if (diff.years && diff.years !== 0) {\n arr.push(diff.years + ' years')\n }\n if (diff.months === 1) {\n arr.push('1 month')\n } else if (diff.months && diff.months !== 0) {\n arr.push(diff.months + ' months')\n }\n if (diff.days === 1) {\n arr.push('1 day')\n } else if (diff.days && diff.days !== 0) {\n arr.push(diff.days + ' days')\n }\n return arr.join(', ')\n },\n 'diff-yd': tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n let arr = []\n if (diff.years === 1) {\n arr.push(diff.years + ' year')\n } else if (diff.years && diff.years !== 0) {\n arr.push(diff.years + ' years')\n }\n //ergh...\n diff.days += (diff.months || 0) * 30\n if (diff.days === 1) {\n arr.push('1 day')\n } else if (diff.days && diff.days !== 0) {\n arr.push(diff.days + ' days')\n }\n return arr.join(', ')\n },\n 'diff-d': tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n let arr = []\n //ergh...\n diff.days += (diff.years || 0) * 365\n diff.days += (diff.months || 0) * 30\n if (diff.days === 1) {\n arr.push('1 day')\n } else if (diff.days && diff.days !== 0) {\n arr.push(diff.days + ' days')\n }\n return arr.join(', ')\n }\n}\nmodule.exports = parsers\n","//not all too fancy - used in {{timesince}}\nconst timeSince = function(str) {\n let d = new Date(str)\n if (isNaN(d.getTime())) {\n return ''\n }\n let now = new Date()\n let delta = now.getTime() - d.getTime()\n let predicate = 'ago'\n if (delta < 0) {\n predicate = 'from now'\n delta = Math.abs(delta)\n }\n //figure out units\n let hours = delta / 1000 / 60 / 60\n let days = hours / 24\n if (days < 365) {\n return parseInt(days, 10) + ' days ' + predicate\n }\n let years = days / 365\n return parseInt(years, 10) + ' years ' + predicate\n}\nmodule.exports = timeSince\n","const misc = require('./misc')\nconst parsers = require('./parsers')\nconst parse = require('../../_parsers/parse')\nconst timeSince = require('./_timeSince')\nconst format = require('./_format')\nconst date = parsers.date\nconst natural_date = parsers.natural_date\n\nconst months = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n]\nconst days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n\n//date- templates we support\nlet dateTmpl = Object.assign({}, misc, {\n currentday: () => {\n let d = new Date()\n return String(d.getDate())\n },\n currentdayname: () => {\n let d = new Date()\n return days[d.getDay()]\n },\n currentmonth: () => {\n let d = new Date()\n return months[d.getMonth()]\n },\n currentyear: () => {\n let d = new Date()\n return String(d.getFullYear())\n },\n monthyear: () => {\n let d = new Date()\n return months[d.getMonth()] + ' ' + d.getFullYear()\n },\n 'monthyear-1': () => {\n let d = new Date()\n d.setMonth(d.getMonth() - 1)\n return months[d.getMonth()] + ' ' + d.getFullYear()\n },\n 'monthyear+1': () => {\n let d = new Date()\n d.setMonth(d.getMonth() + 1)\n return months[d.getMonth()] + ' ' + d.getFullYear()\n },\n //Explictly-set dates - https://en.wikipedia.org/wiki/Template:Date\n date: 0,\n 'time ago': tmpl => {\n let order = ['date', 'fmt']\n let time = parse(tmpl, order).date\n return timeSince(time)\n },\n //https://en.wikipedia.org/wiki/Template:Birth_date_and_age\n 'birth date and age': (tmpl, list) => {\n let order = ['year', 'month', 'day']\n let obj = parse(tmpl, order)\n //support 'one property' version\n if (obj.year && /[a-z]/i.test(obj.year)) {\n return natural_date(tmpl, list)\n }\n list.push(obj)\n obj = format.ymd([obj.year, obj.month, obj.day])\n return format.toText(obj)\n },\n 'birth year and age': (tmpl, list) => {\n let order = ['birth_year', 'birth_month']\n let obj = parse(tmpl, order)\n //support 'one property' version\n if (obj.death_year && /[a-z]/i.test(obj.death_year)) {\n return natural_date(tmpl, list)\n }\n list.push(obj)\n let age = new Date().getFullYear() - parseInt(obj.birth_year, 10)\n obj = format.ymd([obj.birth_year, obj.birth_month])\n let str = format.toText(obj)\n if (age) {\n str += ` (age ${age})`\n }\n return str\n },\n 'death year and age': (tmpl, list) => {\n let order = ['death_year', 'birth_year', 'death_month']\n let obj = parse(tmpl, order)\n //support 'one property' version\n if (obj.death_year && /[a-z]/i.test(obj.death_year)) {\n return natural_date(tmpl, list)\n }\n list.push(obj)\n obj = format.ymd([obj.death_year, obj.death_month])\n return format.toText(obj)\n },\n //https://en.wikipedia.org/wiki/Template:Birth_date_and_age2\n 'birth date and age2': (tmpl, list) => {\n let order = ['at_year', 'at_month', 'at_day', 'birth_year', 'birth_month', 'birth_day']\n let obj = parse(tmpl, order)\n list.push(obj)\n obj = format.ymd([obj.birth_year, obj.birth_month, obj.birth_day])\n return format.toText(obj)\n },\n //https://en.wikipedia.org/wiki/Template:Birth_based_on_age_as_of_date\n 'birth based on age as of date': (tmpl, list) => {\n let order = ['age', 'year', 'month', 'day']\n let obj = parse(tmpl, order)\n list.push(obj)\n let age = parseInt(obj.age, 10)\n let year = parseInt(obj.year, 10)\n let born = year - age\n if (born && age) {\n return `${born} (age ${obj.age})`\n }\n return `(age ${obj.age})`\n },\n //https://en.wikipedia.org/wiki/Template:Death_date_and_given_age\n 'death date and given age': (tmpl, list) => {\n let order = ['year', 'month', 'day', 'age']\n let obj = parse(tmpl, order)\n list.push(obj)\n obj = format.ymd([obj.year, obj.month, obj.day])\n let str = format.toText(obj)\n if (obj.age) {\n str += ` (age ${obj.age})`\n }\n return str\n },\n //sortable dates -\n dts: tmpl => {\n //remove formatting stuff, ewww\n tmpl = tmpl.replace(/\\|format=[ymd]+/i, '')\n tmpl = tmpl.replace(/\\|abbr=(on|off)/i, '')\n let order = ['year', 'month', 'date', 'bc']\n let obj = parse(tmpl, order)\n if (obj.date && obj.month && obj.year) {\n //render 'june 5 2018'\n if (/[a-z]/.test(obj.month) === true) {\n return [obj.month, obj.date, obj.year].join(' ')\n }\n return [obj.year, obj.month, obj.date].join('-')\n }\n if (obj.month && obj.year) {\n return [obj.year, obj.month].join('-')\n }\n if (obj.year) {\n if (obj.year < 0) {\n obj.year = Math.abs(obj.year) + ' BC'\n }\n return obj.year\n }\n return ''\n },\n //date/age/time templates\n start: date,\n end: date,\n birth: date,\n death: date,\n 'start date': date,\n 'end date': date,\n 'birth date': date,\n 'death date': date,\n 'start date and age': date,\n 'end date and age': date,\n //this is insane (hyphen ones are different)\n 'start-date': natural_date,\n 'end-date': natural_date,\n 'birth-date': natural_date,\n 'death-date': natural_date,\n 'birth-date and age': natural_date,\n 'birth-date and given age': natural_date,\n 'death-date and age': natural_date,\n 'death-date and given age': natural_date,\n\n birthdeathage: parsers.two_dates,\n dob: date,\n // 'birth date and age2': date,\n\n age: parsers.age,\n 'age nts': parsers.age,\n 'age in years': parsers['diff-y'],\n 'age in years and months': parsers['diff-ym'],\n 'age in years, months and days': parsers['diff-ymd'],\n 'age in years and days': parsers['diff-yd'],\n 'age in days': parsers['diff-d']\n // 'age in years, months, weeks and days': true,\n // 'age as of date': true,\n})\n//aliases\ndateTmpl.localday = dateTmpl.currentday\ndateTmpl.localdayname = dateTmpl.currentdayname\ndateTmpl.localmonth = dateTmpl.currentmonth\ndateTmpl.localyear = dateTmpl.currentyear\ndateTmpl.currentmonthname = dateTmpl.currentmonth\ndateTmpl.currentmonthabbrev = dateTmpl.currentmonth\ndateTmpl['death date and age'] = dateTmpl['birth date and age']\ndateTmpl.bda = dateTmpl['birth date and age']\ndateTmpl['birth date based on age at death'] = dateTmpl['birth based on age as of date']\nmodule.exports = dateTmpl\n","const parse = require('../../_parsers/parse')\n\nlet templates = {\n //a convulated way to make a xml tag - https://en.wikipedia.org/wiki/Template:Tag\n tag: tmpl => {\n let obj = parse(tmpl, ['tag', 'open'])\n const ignore = {\n span: true,\n div: true,\n p: true\n }\n //pair, empty, close, single\n if (!obj.open || obj.open === 'pair') {\n //just skip generating spans and things..\n if (ignore[obj.tag]) {\n return obj.content || ''\n }\n return `<${obj.tag} ${obj.attribs || ''}>${obj.content || ''}`\n }\n return ''\n },\n //dumb inflector - https://en.wikipedia.org/wiki/Template:Plural\n plural: tmpl => {\n tmpl = tmpl.replace(/plural:/, 'plural|')\n let order = ['num', 'word']\n let obj = parse(tmpl, order)\n let num = Number(obj.num)\n let word = obj.word\n if (num !== 1) {\n if (/.y$/.test(word)) {\n word = word.replace(/y$/, 'ies')\n } else {\n word += 's'\n }\n }\n return num + ' ' + word\n },\n // https://en.wikipedia.org/wiki/Template:First_word\n 'first word': tmpl => {\n let obj = parse(tmpl, ['text'])\n let str = obj.text\n if (obj.sep) {\n return str.split(obj.sep)[0]\n }\n return str.split(' ')[0]\n },\n trunc: tmpl => {\n let order = ['str', 'len']\n let obj = parse(tmpl, order)\n return obj.str.substr(0, obj.len)\n },\n 'str mid': tmpl => {\n let order = ['str', 'start', 'end']\n let obj = parse(tmpl, order)\n let start = parseInt(obj.start, 10) - 1\n let end = parseInt(obj.end, 10)\n return obj.str.substr(start, end)\n },\n //grab the first, second or third pipe\n p1: 0,\n p2: 1,\n p3: 2,\n //formatting things - https://en.wikipedia.org/wiki/Template:Nobold\n braces: tmpl => {\n let obj = parse(tmpl, ['text'])\n let attrs = ''\n if (obj.list) {\n attrs = '|' + obj.list.join('|')\n }\n return '{{' + (obj.text || '') + attrs + '}}'\n },\n nobold: 0,\n noitalic: 0,\n nocaps: 0,\n syntaxhighlight: (tmpl, list) => {\n let obj = parse(tmpl)\n list.push(obj)\n return obj.code || ''\n },\n samp: (tmpl, list) => {\n let obj = parse(tmpl, ['1'])\n list.push(obj)\n return obj['1'] || ''\n },\n //https://en.wikipedia.org/wiki/Template:Visible_anchor\n vanchor: 0,\n //https://en.wikipedia.org/wiki/Template:Resize\n resize: 1,\n //https://en.wikipedia.org/wiki/Template:Ra\n ra: tmpl => {\n let obj = parse(tmpl, ['hours', 'minutes', 'seconds'])\n return [obj.hours || 0, obj.minutes || 0, obj.seconds || 0].join(':')\n },\n //https://en.wikipedia.org/wiki/Template:Deg2HMS\n deg2hms: tmpl => {\n //this template should do the conversion\n let obj = parse(tmpl, ['degrees'])\n return (obj.degrees || '') + '°'\n },\n hms2deg: tmpl => {\n //this template should do the conversion too\n let obj = parse(tmpl, ['hours', 'minutes', 'seconds'])\n return [obj.hours || 0, obj.minutes || 0, obj.seconds || 0].join(':')\n },\n decdeg: tmpl => {\n //this template should do the conversion too\n let obj = parse(tmpl, ['deg', 'min', 'sec', 'hem', 'rnd'])\n return (obj.deg || obj.degrees) + '°'\n },\n rnd: 0,\n //https://en.wikipedia.org/wiki/Template:DEC\n dec: tmpl => {\n let obj = parse(tmpl, ['degrees', 'minutes', 'seconds'])\n let str = (obj.degrees || 0) + '°'\n if (obj.minutes) {\n str += obj.minutes + `′`\n }\n if (obj.seconds) {\n str += obj.seconds + '″'\n }\n return str\n },\n //https://en.wikipedia.org/wiki/Template:Val\n val: tmpl => {\n let obj = parse(tmpl, ['number', 'uncertainty'])\n let num = obj.number\n if (num && Number(num)) {\n num = Number(num).toLocaleString()\n }\n let str = num || ''\n //prefix/suffix\n if (obj.p) {\n str = obj.p + str\n }\n if (obj.s) {\n str = obj.s + str\n }\n //add units, too\n if (obj.u || obj.ul || obj.upl) {\n str = str + ' ' + (obj.u || obj.ul || obj.upl)\n }\n return str\n }\n}\n\n//aliases\ntemplates['rndfrac'] = templates.rnd\ntemplates['rndnear'] = templates.rnd\ntemplates['unité'] = templates.val\n\n//templates that we simply grab their insides as plaintext\nlet inline = [\n 'nowrap',\n 'nobr',\n 'big',\n 'cquote',\n 'pull quote',\n 'small',\n 'smaller',\n 'midsize',\n 'larger',\n 'big',\n 'kbd',\n 'bigger',\n 'large',\n 'mono',\n 'strongbad',\n 'stronggood',\n 'huge',\n 'xt',\n 'xt2',\n '!xt',\n 'xtn',\n 'xtd',\n 'dc',\n 'dcr',\n 'mxt',\n '!mxt',\n 'mxtn',\n 'mxtd',\n 'bxt',\n '!bxt',\n 'bxtn',\n 'bxtd',\n 'delink', //https://en.wikipedia.org/wiki/Template:Delink\n //half-supported\n 'pre',\n 'var',\n 'mvar',\n 'pre2',\n 'code'\n]\ninline.forEach(k => {\n templates[k] = tmpl => {\n return parse(tmpl, ['text']).text || ''\n }\n})\n\nmodule.exports = templates\n","const strip = require('../../_parsers/_strip')\nconst parse = require('../../_parsers/parse')\n\nconst tmpls = {\n //a strange, newline-based list - https://en.wikipedia.org/wiki/Template:Plainlist\n plainlist: tmpl => {\n tmpl = strip(tmpl)\n //remove the title\n let arr = tmpl.split('|')\n arr = arr.slice(1)\n tmpl = arr.join('|')\n //split on newline\n arr = tmpl.split(/\\n ?\\* ?/)\n arr = arr.filter(s => s)\n return arr.join('\\n\\n')\n },\n\n //show/hide: https://en.wikipedia.org/wiki/Template:Collapsible_list\n 'collapsible list': (tmpl, list) => {\n let obj = parse(tmpl)\n list.push(obj)\n let str = ''\n if (obj.title) {\n str += `'''${obj.title}'''` + '\\n\\n'\n }\n if (!obj.list) {\n obj.list = []\n for (let i = 1; i < 10; i += 1) {\n if (obj[i]) {\n obj.list.push(obj[i])\n delete obj[i]\n }\n }\n }\n obj.list = obj.list.filter(s => s)\n str += obj.list.join('\\n\\n')\n return str\n },\n // https://en.wikipedia.org/wiki/Template:Ordered_list\n 'ordered list': (tmpl, list) => {\n let obj = parse(tmpl)\n list.push(obj)\n obj.list = obj.list || []\n let lines = obj.list.map((str, i) => `${i + 1}. ${str}`)\n return lines.join('\\n\\n')\n },\n hlist: tmpl => {\n let obj = parse(tmpl)\n obj.list = obj.list || []\n return obj.list.join(' · ')\n },\n pagelist: tmpl => {\n let arr = parse(tmpl).list || []\n return arr.join(', ')\n },\n //actually rendering these links removes the text.\n //https://en.wikipedia.org/wiki/Template:Catlist\n catlist: tmpl => {\n let arr = parse(tmpl).list || []\n return arr.join(', ')\n },\n //https://en.wikipedia.org/wiki/Template:Br_separated_entries\n 'br separated entries': tmpl => {\n let arr = parse(tmpl).list || []\n return arr.join('\\n\\n')\n },\n 'comma separated entries': tmpl => {\n let arr = parse(tmpl).list || []\n return arr.join(', ')\n },\n //https://en.wikipedia.org/wiki/Template:Bare_anchored_list\n 'anchored list': tmpl => {\n let arr = parse(tmpl).list || []\n arr = arr.map((str, i) => `${i + 1}. ${str}`)\n return arr.join('\\n\\n')\n },\n 'bulleted list': tmpl => {\n let arr = parse(tmpl).list || []\n arr = arr.filter(f => f)\n arr = arr.map(str => '• ' + str)\n return arr.join('\\n\\n')\n },\n //https://en.wikipedia.org/wiki/Template:Columns-list\n 'columns-list': (tmpl, list) => {\n let arr = parse(tmpl).list || []\n let str = arr[0] || ''\n let lines = str.split(/\\n/)\n lines = lines.filter(f => f)\n lines = lines.map(s => s.replace(/\\*/, ''))\n list.push({\n template: 'columns-list',\n list: lines\n })\n lines = lines.map(s => '• ' + s)\n return lines.join('\\n\\n')\n }\n // 'pagelist':(tmpl)=>{},\n}\n//aliases\ntmpls.flatlist = tmpls.plainlist\ntmpls.ublist = tmpls.plainlist\ntmpls['unbulleted list'] = tmpls['collapsible list']\ntmpls['ubl'] = tmpls['collapsible list']\ntmpls['bare anchored list'] = tmpls['anchored list']\ntmpls['plain list'] = tmpls['plainlist']\ntmpls.cmn = tmpls['columns-list']\ntmpls.collist = tmpls['columns-list']\ntmpls['col-list'] = tmpls['columns-list']\ntmpls.columnslist = tmpls['columns-list']\nmodule.exports = tmpls\n","const parse = require('../../_parsers/parse')\n\nconst inline = {\n //https://en.wikipedia.org/wiki/Template:Convert#Ranges_of_values\n convert: tmpl => {\n let order = ['num', 'two', 'three', 'four']\n let obj = parse(tmpl, order)\n //todo: support plural units\n if (obj.two === '-' || obj.two === 'to' || obj.two === 'and') {\n if (obj.four) {\n return `${obj.num} ${obj.two} ${obj.three} ${obj.four}`\n }\n return `${obj.num} ${obj.two} ${obj.three}`\n }\n return `${obj.num} ${obj.two}`\n },\n //https://en.wikipedia.org/wiki/Template:Term\n term: tmpl => {\n let obj = parse(tmpl, ['term'])\n return `${obj.term}:`\n },\n defn: 0,\n //https://en.wikipedia.org/wiki/Template:Linum\n lino: 0,\n linum: tmpl => {\n let obj = parse(tmpl, ['num', 'text'])\n return `${obj.num}. ${obj.text}`\n },\n //https://en.wikipedia.org/wiki/Template:Interlanguage_link\n ill: tmpl => {\n let order = ['text', 'lan1', 'text1', 'lan2', 'text2']\n let obj = parse(tmpl, order)\n return obj.text\n },\n //https://en.wikipedia.org/wiki/Template:Frac\n frac: tmpl => {\n let order = ['a', 'b', 'c']\n let obj = parse(tmpl, order)\n if (obj.c) {\n return `${obj.a} ${obj.b}/${obj.c}`\n }\n if (obj.b) {\n return `${obj.a}/${obj.b}`\n }\n return `1/${obj.b}`\n },\n //https://en.wikipedia.org/wiki/Template:Height - {{height|ft=6|in=1}}\n height: (tmpl, list) => {\n let obj = parse(tmpl)\n list.push(obj)\n let result = []\n let units = ['m', 'cm', 'ft', 'in'] //order matters\n units.forEach(unit => {\n if (obj.hasOwnProperty(unit) === true) {\n result.push(obj[unit] + unit)\n }\n })\n return result.join(' ')\n },\n 'block indent': tmpl => {\n let obj = parse(tmpl)\n if (obj['1']) {\n return '\\n' + obj['1'] + '\\n'\n }\n return ''\n },\n quote: (tmpl, list) => {\n let order = ['text', 'author']\n let obj = parse(tmpl, order)\n list.push(obj)\n //create plaintext version\n if (obj.text) {\n let str = `\"${obj.text}\"`\n if (obj.author) {\n str += '\\n\\n'\n str += ` - ${obj.author}`\n }\n return str + '\\n'\n }\n return ''\n },\n\n //https://en.wikipedia.org/wiki/Template:Lbs\n lbs: tmpl => {\n let obj = parse(tmpl, ['text'])\n return `[[${obj.text} Lifeboat Station|${obj.text}]]`\n },\n //Foo-class\n lbc: tmpl => {\n let obj = parse(tmpl, ['text'])\n return `[[${obj.text}-class lifeboat|${obj.text}-class]]`\n },\n lbb: tmpl => {\n let obj = parse(tmpl, ['text'])\n return `[[${obj.text}-class lifeboat|${obj.text}]]`\n },\n // https://en.wikipedia.org/wiki/Template:Own\n own: tmpl => {\n let obj = parse(tmpl, ['author'])\n let str = 'Own work'\n if (obj.author) {\n str += ' by ' + obj.author\n }\n return str\n },\n //https://en.wikipedia.org/wiki/Template:Sic\n sic: (tmpl, list) => {\n let obj = parse(tmpl, ['one', 'two', 'three'])\n let word = (obj.one || '') + (obj.two || '')\n //support '[sic?]'\n if (obj.one === '?') {\n word = (obj.two || '') + (obj.three || '')\n }\n list.push({\n template: 'sic',\n word: word\n })\n if (obj.nolink === 'y') {\n return word\n }\n return `${word} [sic]`\n },\n //https://www.mediawiki.org/wiki/Help:Magic_words#Formatting\n formatnum: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['number'])\n let str = obj.number || ''\n str = str.replace(/,/g, '')\n let num = Number(str)\n return num.toLocaleString() || ''\n },\n //https://www.mediawiki.org/wiki/Help:Magic_words#Formatting\n '#dateformat': tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['date', 'format'])\n return obj.date\n },\n //https://www.mediawiki.org/wiki/Help:Magic_words#Formatting\n lc: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text'])\n return (obj.text || '').toLowerCase()\n },\n lcfirst: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text'])\n let text = obj.text\n if (!text) {\n return ''\n }\n return text[0].toLowerCase() + text.substr(1)\n },\n //https://www.mediawiki.org/wiki/Help:Magic_words#Formatting\n uc: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text'])\n return (obj.text || '').toUpperCase()\n },\n ucfirst: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text'])\n let text = obj.text\n if (!text) {\n return ''\n }\n return text[0].toUpperCase() + text.substr(1)\n },\n padleft: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text', 'num'])\n let text = obj.text || ''\n return text.padStart(obj.num, obj.str || '0')\n },\n padright: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text', 'num'])\n let text = obj.text || ''\n return text.padEnd(obj.num, obj.str || '0')\n },\n //abbreviation/meaning\n //https://en.wikipedia.org/wiki/Template:Abbr\n abbr: tmpl => {\n let obj = parse(tmpl, ['abbr', 'meaning', 'ipa'])\n return obj.abbr\n },\n //https://en.wikipedia.org/wiki/Template:Abbrlink\n abbrlink: tmpl => {\n let obj = parse(tmpl, ['abbr', 'page'])\n if (obj.page) {\n return `[[${obj.page}|${obj.abbr}]]`\n }\n return `[[${obj.abbr}]]`\n },\n //https://en.wikipedia.org/wiki/Template:Hover_title\n //technically 'h:title'\n h: 1,\n //https://en.wikipedia.org/wiki/Template:Finedetail\n finedetail: 0,\n //https://en.wikipedia.org/wiki/Template:Sort\n sort: 1\n}\n\n//aliases\ninline['str left'] = inline.trunc\ninline['str crop'] = inline.trunc\ninline['tooltip'] = inline.abbr\ninline['abbrv'] = inline.abbr\ninline['define'] = inline.abbr\ninline['cvt'] = inline.convert\n\nmodule.exports = inline\n","module.exports = Object.assign({}, require('./format'), require('./lists'), require('./misc'))\n","//converts DMS (decimal-minute-second) geo format to lat/lng format.\n//major thank you to https://github.com/gmaclennan/parse-dms\n//and https://github.com/WSDOT-GIS/dms-js 👏\n\n//accepts an array of descending Degree, Minute, Second values, with a hemisphere at the end\n//must have N/S/E/W as last thing\nfunction parseDms(arr) {\n let hemisphere = arr.pop()\n let degrees = Number(arr[0] || 0)\n let minutes = Number(arr[1] || 0)\n let seconds = Number(arr[2] || 0)\n if (typeof hemisphere !== 'string' || isNaN(degrees)) {\n return null\n }\n let sign = 1\n if (/[SW]/i.test(hemisphere)) {\n sign = -1\n }\n let decDeg = sign * (degrees + minutes / 60 + seconds / 3600)\n return decDeg\n}\nmodule.exports = parseDms\n// console.log(parseDms([57, 18, 22, 'N']));\n// console.log(parseDms([4, 27, 32, 'W']));\n","const convertDMS = require('./dms-format')\nconst parse = require('../../_parsers/parse')\n\nconst round = function(num) {\n if (typeof num !== 'number') {\n return num\n }\n let places = 100000\n return Math.round(num * places) / places\n}\n\n//these hemispheres mean negative decimals\nconst negative = {\n s: true,\n w: true\n}\n\nconst findLatLng = function(arr) {\n const types = arr.map(s => typeof s).join('|')\n //support {{lat|lng}}\n if (arr.length === 2 && types === 'number|number') {\n return {\n lat: arr[0],\n lon: arr[1]\n }\n }\n //support {{dd|N/S|dd|E/W}}\n if (arr.length === 4 && types === 'number|string|number|string') {\n if (negative[arr[1].toLowerCase()]) {\n arr[0] *= -1\n }\n if (arr[3].toLowerCase() === 'w') {\n arr[2] *= -1\n }\n return {\n lat: arr[0],\n lon: arr[2]\n }\n }\n //support {{dd|mm|N/S|dd|mm|E/W}}\n if (arr.length === 6) {\n return {\n lat: convertDMS(arr.slice(0, 3)),\n lon: convertDMS(arr.slice(3))\n }\n }\n //support {{dd|mm|ss|N/S|dd|mm|ss|E/W}}\n if (arr.length === 8) {\n return {\n lat: convertDMS(arr.slice(0, 4)),\n lon: convertDMS(arr.slice(4))\n }\n }\n return {}\n}\n\nconst parseParams = function(obj) {\n obj.list = obj.list || []\n obj.list = obj.list.map(str => {\n let num = Number(str)\n if (!isNaN(num)) {\n return num\n }\n //these are weird\n let split = str.split(/:/)\n if (split.length > 1) {\n obj.props = obj.props || {}\n obj.props[split[0]] = split.slice(1).join(':')\n return null\n }\n return str\n })\n obj.list = obj.list.filter(s => s !== null)\n return obj\n}\n\nconst parseCoor = function(tmpl) {\n let obj = parse(tmpl)\n obj = parseParams(obj)\n let tmp = findLatLng(obj.list)\n obj.lat = round(tmp.lat)\n obj.lon = round(tmp.lon)\n obj.template = 'coord'\n delete obj.list\n return obj\n}\n\nmodule.exports = parseCoor\n// {{Coor title dms|dd|mm|ss|N/S|dd|mm|ss|E/W|template parameters}}\n// {{Coor title dec|latitude|longitude|template parameters}}\n// {{Coor dms|dd|mm|ss|N/S|dd|mm|ss|E/W|template parameters}}\n// {{Coor dm|dd|mm|N/S|dd|mm|E/W|template parameters}}\n// {{Coor dec|latitude|longitude|template parameters}}\n\n// {{coord|latitude|longitude|coordinate parameters|template parameters}}\n// {{coord|dd|N/S|dd|E/W|coordinate parameters|template parameters}}\n// {{coord|dd|mm|N/S|dd|mm|E/W|coordinate parameters|template parameters}}\n// {{coord|dd|mm|ss|N/S|dd|mm|ss|E/W|coordinate parameters|template parameters}}\n","const parseCoor = require('./coor')\n\nconst templates = {\n coord: (tmpl, list) => {\n let obj = parseCoor(tmpl)\n list.push(obj)\n //display inline, by default\n if (!obj.display || obj.display.indexOf('inline') !== -1) {\n return `${obj.lat || ''}°N, ${obj.lon || ''}°W`\n }\n return ''\n },\n //https://en.wikivoyage.org/wiki/Template:Geo\n geo: ['lat', 'lon', 'zoom']\n}\n// {{coord|latitude|longitude|coordinate parameters|template parameters}}\n// {{coord|dd|N/S|dd|E/W|coordinate parameters|template parameters}}\n// {{coord|dd|mm|N/S|dd|mm|E/W|coordinate parameters|template parameters}}\n// {{coord|dd|mm|ss|N/S|dd|mm|ss|E/W|coordinate parameters|template parameters}}\ntemplates['coor'] = templates.coord\n// these are from the nl wiki\ntemplates['coor title dms'] = templates.coord\ntemplates['coor title dec'] = templates.coord\ntemplates['coor dms'] = templates.coord\ntemplates['coor dm'] = templates.coord\ntemplates['coor dec'] = templates.coord\nmodule.exports = templates\n","const parse = require('../../_parsers/parse')\n\nlet templates = {\n /* mostly wiktionary*/\n etyl: 1,\n mention: 1,\n link: 1,\n 'la-verb-form': 0,\n 'la-ipa': 0,\n //https://en.wikipedia.org/wiki/Template:Sortname\n sortname: tmpl => {\n let order = ['first', 'last', 'target', 'sort']\n let obj = parse(tmpl, order)\n let name = `${obj.first || ''} ${obj.last || ''}`\n name = name.trim()\n if (obj.nolink) {\n return obj.target || name\n }\n if (obj.dab) {\n name += ` (${obj.dab})`\n if (obj.target) {\n obj.target += ` (${obj.dab})`\n }\n }\n if (obj.target) {\n return `[[${obj.target}|${name}]]`\n }\n return `[[${name}]]`\n }\n}\n\n//these are insane\n// https://en.wikipedia.org/wiki/Template:Tl\nconst links = [\n 'lts',\n 't',\n 'tfd links',\n 'tiw',\n 'tltt',\n 'tetl',\n 'tsetl',\n 'ti',\n 'tic',\n 'tiw',\n 'tlt',\n 'ttl',\n 'twlh',\n 'tl2',\n 'tlu',\n 'demo',\n 'hatnote',\n 'xpd',\n 'para',\n 'elc',\n 'xtag',\n 'mli',\n 'mlix',\n '#invoke',\n 'url' //https://en.wikipedia.org/wiki/Template:URL\n]\n\n//keyValues\nlinks.forEach(k => {\n templates[k] = tmpl => {\n let order = ['first', 'second']\n let obj = parse(tmpl, order)\n return obj.second || obj.first\n }\n})\n//aliases\ntemplates.m = templates.mention\ntemplates['m-self'] = templates.mention\ntemplates.l = templates.link\ntemplates.ll = templates.link\ntemplates['l-self'] = templates.link\nmodule.exports = templates\n","const parse = require('../../_parsers/parse')\nconst Image = require('../../../image/Image')\n\nconst sisterProjects = {\n wikt: 'wiktionary',\n commons: 'commons',\n c: 'commons',\n commonscat: 'commonscat',\n n: 'wikinews',\n q: 'wikiquote',\n s: 'wikisource',\n a: 'wikiauthor',\n b: 'wikibooks',\n voy: 'wikivoyage',\n v: 'wikiversity',\n d: 'wikidata',\n species: 'wikispecies',\n m: 'meta',\n mw: 'mediawiki'\n}\n\nconst parsers = {\n //https://en.wikipedia.org/wiki/Template:About\n about: (tmpl, list) => {\n let obj = parse(tmpl)\n // obj.pos = r.title //not working\n list.push(obj)\n return ''\n },\n //https://en.wikipedia.org/wiki/Template:Main\n main: (tmpl, list) => {\n let obj = parse(tmpl)\n // obj.pos = r.title //not working\n list.push(obj)\n return ''\n },\n 'wide image': ['file', 'width', 'caption'],\n\n //https://en.wikipedia.org/wiki/Template:Redirect\n redirect: (tmpl, list) => {\n let data = parse(tmpl, ['redirect'])\n let lines = data.list || []\n let links = []\n for (let i = 0; i < lines.length; i += 2) {\n links.push({\n page: lines[i + 1],\n desc: lines[i]\n })\n }\n let obj = {\n template: 'redirect',\n redirect: data.redirect,\n links: links\n }\n list.push(obj)\n return ''\n },\n\n //this one sucks - https://en.wikipedia.org/wiki/Template:GNIS\n 'cite gnis': (tmpl, list) => {\n let order = ['id', 'name', 'type']\n let obj = parse(tmpl, order)\n obj.type = 'gnis'\n obj.template = 'citation'\n list.push(obj)\n return ''\n },\n\n //https://en.wikipedia.org/wiki/Template:Sfn\n sfn: (tmpl, list, alias) => {\n let order = ['author', 'year', 'location']\n let obj = parse(tmpl, order)\n if (alias) {\n obj.name = obj.template\n obj.teplate = alias\n }\n list.push(obj)\n return ''\n },\n\n audio: ['file', 'text', 'type'],\n rp: ['page'],\n\n 'spoken wikipedia': (tmpl, list) => {\n let order = ['file', 'date']\n let obj = parse(tmpl, order)\n obj.template = 'audio'\n list.push(obj)\n return ''\n },\n\n //https://en.wikipedia.org/wiki/Template:Sister_project_links\n 'sister project links': (tmpl, list) => {\n let data = parse(tmpl)\n //rename 'wd' to 'wikidata'\n let links = {}\n Object.keys(sisterProjects).forEach(k => {\n if (data.hasOwnProperty(k) === true) {\n links[sisterProjects[k]] = data[k] //.text();\n }\n })\n let obj = {\n template: 'sister project links',\n links: links\n }\n list.push(obj)\n return ''\n },\n\n //https://en.wikipedia.org/wiki/Template:Subject_bar\n 'subject bar': (tmpl, list) => {\n let data = parse(tmpl)\n Object.keys(data).forEach(k => {\n //rename 'voy' to 'wikivoyage'\n if (sisterProjects.hasOwnProperty(k)) {\n data[sisterProjects[k]] = data[k]\n delete data[k]\n }\n })\n let obj = {\n template: 'subject bar',\n links: data\n }\n list.push(obj)\n return ''\n },\n\n 'short description': ['description'],\n 'coord missing': ['region'],\n //amazingly, this one does not obey any known patterns\n //https://en.wikipedia.org/wiki/Template:Gallery\n gallery: (tmpl, list) => {\n let obj = parse(tmpl)\n let images = (obj.list || []).filter(line => /^ *File ?:/.test(line))\n images = images.map(file => {\n let img = {\n file: file\n }\n return new Image(img).json()\n })\n obj = {\n template: 'gallery',\n images: images\n }\n list.push(obj)\n return ''\n },\n //https://en.wikipedia.org/wiki/Template:See_also\n 'see also': (tmpl, list) => {\n let data = parse(tmpl)\n // data.pos = r.title //not working\n list.push(data)\n return ''\n },\n unreferenced: ['date']\n}\n//aliases\nparsers['cite'] = parsers.citation\nparsers['sfnref'] = parsers.sfn\nparsers['harvid'] = parsers.sfn\nparsers['harvnb'] = parsers.sfn\nparsers['unreferenced section'] = parsers.unreferenced\nparsers['redir'] = parsers.redirect\nparsers['sisterlinks'] = parsers['sister project links']\nparsers['main article'] = parsers['main']\n\nmodule.exports = parsers\n","//random misc for inline wikipedia templates\nconst parse = require('../../_parsers/parse')\n\nconst titlecase = str => {\n return str.charAt(0).toUpperCase() + str.substring(1)\n}\n\n//https://en.wikipedia.org/wiki/Template:Yes\nlet templates = {}\nlet cells = [\n 'rh',\n 'rh2',\n 'yes',\n 'no',\n 'maybe',\n 'eliminated',\n 'lost',\n 'safe',\n 'active',\n 'site active',\n 'coming soon',\n 'good',\n 'won',\n 'nom',\n 'sho',\n 'longlisted',\n 'tba',\n 'success',\n 'operational',\n 'failure',\n 'partial',\n 'regional',\n 'maybecheck',\n 'partial success',\n 'partial failure',\n 'okay',\n 'yes-no',\n 'some',\n 'nonpartisan',\n 'pending',\n 'unofficial',\n 'unofficial2',\n 'usually',\n 'rarely',\n 'sometimes',\n 'any',\n 'varies',\n 'black',\n 'non-album single',\n 'unreleased',\n 'unknown',\n 'perhaps',\n 'depends',\n 'included',\n 'dropped',\n 'terminated',\n 'beta',\n 'table-experimental',\n 'free',\n 'proprietary',\n 'nonfree',\n 'needs',\n 'nightly',\n 'release-candidate',\n 'planned',\n 'scheduled',\n 'incorrect',\n 'no result',\n 'cmain',\n 'calso starring',\n 'crecurring',\n 'cguest',\n 'not yet',\n 'optional'\n]\ncells.forEach(str => {\n templates[str] = tmpl => {\n let data = parse(tmpl, ['text'])\n return data.text || titlecase(data.template)\n }\n})\n\n//these ones have a text result\nlet moreCells = [\n ['active fire', 'Active'],\n ['site active', 'Active'],\n ['site inactive', 'Inactive'],\n ['yes2', ''],\n ['no2', ''],\n ['ya', '✅'],\n ['na', '❌'],\n ['nom', 'Nominated'],\n ['sho', 'Shortlisted'],\n ['tba', 'TBA'],\n ['maybecheck', '✔️'],\n ['okay', 'Neutral'],\n ['n/a', 'N/A'],\n ['sdash', '—'],\n ['dunno', '?'],\n ['draw', ''],\n ['cnone', ''],\n ['nocontest', '']\n]\nmoreCells.forEach(a => {\n templates[a[0]] = tmpl => {\n let data = parse(tmpl, ['text'])\n return data.text || a[1]\n }\n})\n\n//this one's a little different\ntemplates.won = tmpl => {\n let data = parse(tmpl, ['text'])\n return data.place || data.text || titlecase(data.template)\n}\n\nmodule.exports = templates\n","module.exports = Object.assign({}, require('./links'), require('./page'), require('./table-cell'))\n","const parse = require('../_parsers/parse')\n\nconst zeroPad = function(num) {\n num = String(num)\n if (num.length === 1) {\n num = '0' + num\n }\n return num\n}\n\nconst parseTeam = function(obj, round, team) {\n if (obj[`rd${round}-team${zeroPad(team)}`]) {\n team = zeroPad(team)\n }\n let score = obj[`rd${round}-score${team}`]\n let num = Number(score)\n if (isNaN(num) === false) {\n score = num\n }\n return {\n team: obj[`rd${round}-team${team}`],\n score: score,\n seed: obj[`rd${round}-seed${team}`]\n }\n}\n\n//these are weird.\nconst playoffBracket = function(tmpl) {\n let rounds = []\n let obj = parse(tmpl)\n //try some rounds\n for (let i = 1; i < 7; i += 1) {\n let round = []\n for (let t = 1; t < 16; t += 2) {\n let key = `rd${i}-team`\n if (obj[key + t] || obj[key + zeroPad(t)]) {\n let one = parseTeam(obj, i, t)\n let two = parseTeam(obj, i, t + 1)\n round.push([one, two])\n } else {\n break\n }\n }\n if (round.length > 0) {\n rounds.push(round)\n }\n }\n return {\n template: 'playoffbracket',\n rounds: rounds\n }\n}\n\nlet all = {\n //playoff brackets\n '4teambracket': function(tmpl, list) {\n let obj = playoffBracket(tmpl)\n list.push(obj)\n return ''\n }\n}\n\n//a bunch of aliases for these ones:\n// https://en.wikipedia.org/wiki/Category:Tournament_bracket_templates\nconst brackets = [\n '2teambracket',\n '4team2elimbracket',\n '8teambracket',\n '16teambracket',\n '32teambracket',\n\n 'cwsbracket',\n 'nhlbracket',\n 'nhlbracket-reseed',\n '4teambracket-nhl',\n '4teambracket-ncaa',\n '4teambracket-mma',\n '4teambracket-mlb',\n\n '8teambracket-nhl',\n '8teambracket-mlb',\n '8teambracket-ncaa',\n '8teambracket-afc',\n '8teambracket-afl',\n '8teambracket-tennis3',\n '8teambracket-tennis5',\n\n '16teambracket-nhl',\n '16teambracket-nhl divisional',\n '16teambracket-nhl-reseed',\n '16teambracket-nba',\n '16teambracket-swtc',\n '16teambracket-afc',\n '16teambracket-tennis3',\n '16teambracket-tennis5'\n]\nbrackets.forEach(key => {\n all[key] = all['4teambracket']\n})\n\nmodule.exports = all\n","const parse = require('../_parsers/parse')\n\nconst codes = {\n '£': 'GB£', // https://en.wikipedia.org/wiki/Template:GBP\n '¥': '¥', // https://en.wikipedia.org/wiki/Template:JPY\n '৳': '৳', // https://en.wikipedia.org/wiki/Template:BDT\n '₩': '₩', // https://en.wikipedia.org/wiki/Template:SK_won\n '€': '€', // https://en.wikipedia.org/wiki/Template:€\n '₱': '₱', // https://en.wikipedia.org/wiki/Template:Philippine_peso\n '₹': '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n '₽': '₽', // https://en.wikipedia.org/wiki/Template:RUB\n 'cn¥': 'CN¥', // https://en.wikipedia.org/wiki/Template:CNY\n 'gb£': 'GB£', // https://en.wikipedia.org/wiki/Template:GBP\n 'india rs': '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n 'indian rupee symbol': '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n 'indian rupee': '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n 'indian rupees': '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n 'philippine peso': '₱', // https://en.wikipedia.org/wiki/Template:Philippine_peso\n 'russian ruble': '₽', // https://en.wikipedia.org/wiki/Template:Russian_ruble\n 'SK won': '₩', // https://en.wikipedia.org/wiki/Template:SK_won\n 'turkish lira': 'TRY', //https://en.wikipedia.org/wiki/Template:Turkish_lira\n a$: 'A$', // https://en.wikipedia.org/wiki/Template:AUD\n au$: 'A$', //https://en.wikipedia.org/wiki/Template:AUD\n aud: 'A$', //https://en.wikipedia.org/wiki/Template:AUD\n bdt: 'BDT', //https://en.wikipedia.org/wiki/Template:BDT\n brl: 'BRL', //https://en.wikipedia.org/wiki/Template:BRL\n ca$: 'CA$', // https://en.wikipedia.org/wiki/Template:CAD\n cad: 'CA$', // https://en.wikipedia.org/wiki/Template:CAD\n chf: 'CHF', // https://en.wikipedia.org/wiki/Template:CHF\n cny: 'CN¥', // https://en.wikipedia.org/wiki/Template:CNY\n czk: 'czk', // https://en.wikipedia.org/wiki/Template:CZK\n dkk: 'dkk', // https://en.wikipedia.org/wiki/Template:DKK\n dkk2: 'dkk', // https://en.wikipedia.org/wiki/Template:DKK\n euro: '€', // https://en.wikipedia.org/wiki/Template:€\n gbp: 'GB£', // https://en.wikipedia.org/wiki/Template:GBP\n hk$: 'HK$', // https://en.wikipedia.org/wiki/Template:HKD\n hkd: 'HK$', // https://en.wikipedia.org/wiki/Template:HKD\n ils: 'ILS', // https://en.wikipedia.org/wiki/Template:ILS\n inr: '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n jpy: '¥', // https://en.wikipedia.org/wiki/Template:JPY\n myr: 'MYR', // https://en.wikipedia.org/wiki/Template:MYR\n nis: 'ILS', // https://en.wikipedia.org/wiki/Template:ILS\n nok: 'NOK', //https://en.wikipedia.org/wiki/Template:NOK\n nok2: 'NOK', //https://en.wikipedia.org/wiki/Template:NOK\n nz$: 'NZ$', //https://en.wikipedia.org/wiki/Template:NZD\n nzd: 'NZ$', //https://en.wikipedia.org/wiki/Template:NZD\n peso: 'peso', //https://en.wikipedia.org/wiki/Template:Peso\n pkr: '₨', // https://en.wikipedia.org/wiki/Template:Pakistani_Rupee\n r$: 'BRL', //https://en.wikipedia.org/wiki/Template:BRL\n rmb: 'CN¥', // https://en.wikipedia.org/wiki/Template:CNY\n rub: '₽', // https://en.wikipedia.org/wiki/Template:RUB\n ruble: '₽', // https://en.wikipedia.org/wiki/Template:Ruble\n rupee: '₹', // https://en.wikipedia.org/wiki/Template:Rupee\n s$: 'sgd', // https://en.wikipedia.org/wiki/Template:SGD\n sek: 'SEK', // https://en.wikipedia.org/wiki/Template:SEK\n sek2: 'SEK', // https://en.wikipedia.org/wiki/Template:SEK\n sfr: 'CHF', // https://en.wikipedia.org/wiki/Template:CHF\n sgd: 'sgd', // https://en.wikipedia.org/wiki/Template:SGD\n shekel: 'ILS', // https://en.wikipedia.org/wiki/Template:ILS\n sheqel: 'ILS', // https://en.wikipedia.org/wiki/Template:ILS\n ttd: 'TTD', //https://en.wikipedia.org/wiki/Template:TTD\n us$: 'US$', // https://en.wikipedia.org/wiki/Template:US$\n usd: 'US$', // https://en.wikipedia.org/wiki/Template:US$\n yen: '¥', // https://en.wikipedia.org/wiki/Template:JPY\n zar: 'R' //https://en.wikipedia.org/wiki/Template:ZAR\n}\n\nconst parseCurrency = (tmpl, list) => {\n let o = parse(tmpl, ['amount', 'code'])\n list.push(o)\n let code = o.template || ''\n if (code === 'currency') {\n code = o.code\n if (!code) {\n o.code = code = 'usd' //Special case when currency template has no code argument\n }\n } else if (\n code === '' ||\n code === 'monnaie' ||\n code === 'unité' ||\n code === 'nombre' ||\n code === 'nb'\n ) {\n code = o.code\n }\n code = (code || '').toLowerCase()\n switch (code) {\n case 'us':\n o.code = code = 'usd'\n break\n case 'uk':\n o.code = code = 'gbp'\n break\n }\n let out = codes[code] || ''\n let str = `${out}${o.amount || ''}`\n //support unknown currencies after the number - like '5 BTC'\n if (o.code && !codes[o.code.toLowerCase()]) {\n str += ' ' + o.code\n }\n return str\n}\n\nconst inrConvert = (tmpl, list) => {\n let o = parse(tmpl, ['rupee_value', 'currency_formatting'])\n list.push(o)\n let formatting = o.currency_formatting\n if (formatting) {\n let multiplier = 1\n switch (formatting) {\n case 'k':\n multiplier = 1000\n break\n case 'm':\n multiplier = 1000000\n break\n case 'b':\n multiplier = 1000000000\n break\n case 't':\n multiplier = 1000000000000\n break\n case 'l':\n multiplier = 100000\n break\n case 'c':\n multiplier = 10000000\n break\n case 'lc':\n multiplier = 1000000000000\n break\n }\n o.rupee_value = o.rupee_value * multiplier\n }\n let str = `inr ${o.rupee_value || ''}`\n return str\n}\n\nconst currencies = {\n //this one is generic https://en.wikipedia.org/wiki/Template:Currency\n currency: parseCurrency,\n monnaie: parseCurrency,\n unité: parseCurrency,\n nombre: parseCurrency,\n nb: parseCurrency,\n iso4217: parseCurrency,\n inrconvert: inrConvert\n}\n//the others fit the same pattern..\nObject.keys(codes).forEach(k => {\n currencies[k] = parseCurrency\n})\n\nmodule.exports = currencies\n","const parse = require('../_parsers/parse')\n\nlet templates = {\n //https://en.wikipedia.org/wiki/Template:Election_box\n 'election box begin': (tmpl, list) => {\n let data = parse(tmpl)\n list.push(data)\n return ''\n },\n 'election box candidate': (tmpl, list) => {\n let data = parse(tmpl)\n list.push(data)\n return ''\n },\n 'election box hold with party link': (tmpl, list) => {\n let data = parse(tmpl)\n list.push(data)\n return ''\n },\n 'election box gain with party link': (tmpl, list) => {\n let data = parse(tmpl)\n list.push(data)\n return ''\n }\n}\n//aliases\ntemplates['election box begin no change'] = templates['election box begin']\ntemplates['election box begin no party'] = templates['election box begin']\ntemplates['election box begin no party no change'] = templates['election box begin']\ntemplates['election box inline begin'] = templates['election box begin']\ntemplates['election box inline begin no change'] = templates['election box begin']\n\ntemplates['election box candidate for alliance'] = templates['election box candidate']\ntemplates['election box candidate minor party'] = templates['election box candidate']\ntemplates['election box candidate no party link no change'] = templates['election box candidate']\ntemplates['election box candidate with party link'] = templates['election box candidate']\ntemplates['election box candidate with party link coalition 1918'] =\n templates['election box candidate']\ntemplates['election box candidate with party link no change'] = templates['election box candidate']\ntemplates['election box inline candidate'] = templates['election box candidate']\ntemplates['election box inline candidate no change'] = templates['election box candidate']\ntemplates['election box inline candidate with party link'] = templates['election box candidate']\ntemplates['election box inline candidate with party link no change'] =\n templates['election box candidate']\ntemplates['election box inline incumbent'] = templates['election box candidate']\nmodule.exports = templates\n","module.exports = [\n ['🇦🇩', 'and', 'andorra'],\n ['🇦🇪', 'are', 'united arab emirates'],\n ['🇦🇫', 'afg', 'afghanistan'],\n ['🇦🇬', 'atg', 'antigua and barbuda'],\n ['🇦🇮', 'aia', 'anguilla'],\n ['🇦🇱', 'alb', 'albania'],\n ['🇦🇲', 'arm', 'armenia'],\n ['🇦🇴', 'ago', 'angola'],\n ['🇦🇶', 'ata', 'antarctica'],\n ['🇦🇷', 'arg', 'argentina'],\n ['🇦🇸', 'asm', 'american samoa'],\n ['🇦🇹', 'aut', 'austria'],\n ['🇦🇺', 'aus', 'australia'],\n ['🇦🇼', 'abw', 'aruba'],\n ['🇦🇽', 'ala', 'åland islands'],\n ['🇦🇿', 'aze', 'azerbaijan'],\n ['🇧🇦', 'bih', 'bosnia and herzegovina'],\n ['🇧🇧', 'brb', 'barbados'],\n ['🇧🇩', 'bgd', 'bangladesh'],\n ['🇧🇪', 'bel', 'belgium'],\n ['🇧🇫', 'bfa', 'burkina faso'],\n ['🇧🇬', 'bgr', 'bulgaria'],\n [\n '🇧🇬',\n 'bul', //dupe\n 'bulgaria'\n ],\n ['🇧🇭', 'bhr', 'bahrain'],\n ['🇧🇮', 'bdi', 'burundi'],\n ['🇧🇯', 'ben', 'benin'],\n ['🇧🇱', 'blm', 'saint barthélemy'],\n ['🇧🇲', 'bmu', 'bermuda'],\n ['🇧🇳', 'brn', 'brunei darussalam'],\n ['🇧🇴', 'bol', 'bolivia'],\n ['🇧🇶', 'bes', 'bonaire, sint eustatius and saba'],\n ['🇧🇷', 'bra', 'brazil'],\n ['🇧🇸', 'bhs', 'bahamas'],\n ['🇧🇹', 'btn', 'bhutan'],\n ['🇧🇻', 'bvt', 'bouvet island'],\n ['🇧🇼', 'bwa', 'botswana'],\n ['🇧🇾', 'blr', 'belarus'],\n ['🇧🇿', 'blz', 'belize'],\n ['🇨🇦', 'can', 'canada'],\n ['🇨🇨', 'cck', 'cocos (keeling) islands'],\n ['🇨🇩', 'cod', 'congo'],\n ['🇨🇫', 'caf', 'central african republic'],\n ['🇨🇬', 'cog', 'congo'],\n ['🇨🇭', 'che', 'switzerland'],\n ['🇨🇮', 'civ', \"côte d'ivoire\"],\n ['🇨🇰', 'cok', 'cook islands'],\n ['🇨🇱', 'chl', 'chile'],\n ['🇨🇲', 'cmr', 'cameroon'],\n ['🇨🇳', 'chn', 'china'],\n ['🇨🇴', 'col', 'colombia'],\n ['🇨🇷', 'cri', 'costa rica'],\n ['🇨🇺', 'cub', 'cuba'],\n ['🇨🇻', 'cpv', 'cape verde'],\n ['🇨🇼', 'cuw', 'curaçao'],\n ['🇨🇽', 'cxr', 'christmas island'],\n ['🇨🇾', 'cyp', 'cyprus'],\n ['🇨🇿', 'cze', 'czech republic'],\n ['🇩🇪', 'deu', 'germany'],\n [\n '🇩🇪',\n 'ger', //alias\n 'germany'\n ],\n ['🇩🇯', 'dji', 'djibouti'],\n ['🇩🇰', 'dnk', 'denmark'],\n ['🇩🇲', 'dma', 'dominica'],\n ['🇩🇴', 'dom', 'dominican republic'],\n ['🇩🇿', 'dza', 'algeria'],\n ['🇪🇨', 'ecu', 'ecuador'],\n ['🇪🇪', 'est', 'estonia'],\n ['🇪🇬', 'egy', 'egypt'],\n ['🇪🇭', 'esh', 'western sahara'],\n ['🇪🇷', 'eri', 'eritrea'],\n ['🇪🇸', 'esp', 'spain'],\n ['🇪🇹', 'eth', 'ethiopia'],\n ['🇫🇮', 'fin', 'finland'],\n ['🇫🇯', 'fji', 'fiji'],\n ['🇫🇰', 'flk', 'falkland islands (malvinas)'],\n ['🇫🇲', 'fsm', 'micronesia'],\n ['🇫🇴', 'fro', 'faroe islands'],\n ['🇫🇷', 'fra', 'france'],\n ['🇬🇦', 'gab', 'gabon'],\n ['🇬🇧', 'gbr', 'united kingdom'],\n ['🇬🇩', 'grd', 'grenada'],\n // ['🇬🇪', 'geo', 'georgia'],\n ['🇬🇫', 'guf', 'french guiana'],\n ['🇬🇬', 'ggy', 'guernsey'],\n ['🇬🇭', 'gha', 'ghana'],\n ['🇬🇮', 'gib', 'gibraltar'],\n ['🇬🇱', 'grl', 'greenland'],\n ['🇬🇲', 'gmb', 'gambia'],\n ['🇬🇳', 'gin', 'guinea'],\n ['🇬🇵', 'glp', 'guadeloupe'],\n ['🇬🇶', 'gnq', 'equatorial guinea'],\n ['🇬🇷', 'grc', 'greece'],\n ['🇬🇸', 'sgs', 'south georgia'],\n ['🇬🇹', 'gtm', 'guatemala'],\n ['🇬🇺', 'gum', 'guam'],\n ['🇬🇼', 'gnb', 'guinea-bissau'],\n ['🇬🇾', 'guy', 'guyana'],\n ['🇭🇰', 'hkg', 'hong kong'],\n ['🇭🇲', 'hmd', 'heard island and mcdonald islands'],\n ['🇭🇳', 'hnd', 'honduras'],\n ['🇭🇷', 'hrv', 'croatia'],\n ['🇭🇹', 'hti', 'haiti'],\n ['🇭🇺', 'hun', 'hungary'],\n ['🇮🇩', 'idn', 'indonesia'],\n ['🇮🇪', 'irl', 'ireland'],\n ['🇮🇱', 'isr', 'israel'],\n ['🇮🇲', 'imn', 'isle of man'],\n ['🇮🇳', 'ind', 'india'],\n ['🇮🇴', 'iot', 'british indian ocean territory'],\n ['🇮🇶', 'irq', 'iraq'],\n ['🇮🇷', 'irn', 'iran'],\n ['🇮🇸', 'isl', 'iceland'],\n ['🇮🇹', 'ita', 'italy'],\n ['🇯🇪', 'jey', 'jersey'],\n ['🇯🇲', 'jam', 'jamaica'],\n ['🇯🇴', 'jor', 'jordan'],\n ['🇯🇵', 'jpn', 'japan'],\n ['🇰🇪', 'ken', 'kenya'],\n ['🇰🇬', 'kgz', 'kyrgyzstan'],\n ['🇰🇭', 'khm', 'cambodia'],\n ['🇰🇮', 'kir', 'kiribati'],\n ['🇰🇲', 'com', 'comoros'],\n ['🇰🇳', 'kna', 'saint kitts and nevis'],\n ['🇰🇵', 'prk', 'north korea'],\n ['🇰🇷', 'kor', 'south korea'],\n ['🇰🇼', 'kwt', 'kuwait'],\n ['🇰🇾', 'cym', 'cayman islands'],\n ['🇰🇿', 'kaz', 'kazakhstan'],\n ['🇱🇦', 'lao', \"lao people's democratic republic\"],\n ['🇱🇧', 'lbn', 'lebanon'],\n ['🇱🇨', 'lca', 'saint lucia'],\n ['🇱🇮', 'lie', 'liechtenstein'],\n ['🇱🇰', 'lka', 'sri lanka'],\n ['🇱🇷', 'lbr', 'liberia'],\n ['🇱🇸', 'lso', 'lesotho'],\n ['🇱🇹', 'ltu', 'lithuania'],\n ['🇱🇺', 'lux', 'luxembourg'],\n ['🇱🇻', 'lva', 'latvia'],\n ['🇱🇾', 'lby', 'libya'],\n ['🇲🇦', 'mar', 'morocco'],\n ['🇲🇨', 'mco', 'monaco'],\n ['🇲🇩', 'mda', 'moldova'],\n ['🇲🇪', 'mne', 'montenegro'],\n ['🇲🇫', 'maf', 'saint martin (french part)'],\n ['🇲🇬', 'mdg', 'madagascar'],\n ['🇲🇭', 'mhl', 'marshall islands'],\n ['🇲🇰', 'mkd', 'macedonia'],\n ['🇲🇱', 'mli', 'mali'],\n ['🇲🇲', 'mmr', 'myanmar'],\n ['🇲🇳', 'mng', 'mongolia'],\n ['🇲🇴', 'mac', 'macao'],\n ['🇲🇵', 'mnp', 'northern mariana islands'],\n ['🇲🇶', 'mtq', 'martinique'],\n ['🇲🇷', 'mrt', 'mauritania'],\n ['🇲🇸', 'msr', 'montserrat'],\n ['🇲🇹', 'mlt', 'malta'],\n ['🇲🇺', 'mus', 'mauritius'],\n ['🇲🇻', 'mdv', 'maldives'],\n ['🇲🇼', 'mwi', 'malawi'],\n ['🇲🇽', 'mex', 'mexico'],\n ['🇲🇾', 'mys', 'malaysia'],\n ['🇲🇿', 'moz', 'mozambique'],\n ['🇳🇦', 'nam', 'namibia'],\n ['🇳🇨', 'ncl', 'new caledonia'],\n ['🇳🇪', 'ner', 'niger'],\n ['🇳🇫', 'nfk', 'norfolk island'],\n ['🇳🇬', 'nga', 'nigeria'],\n ['🇳🇮', 'nic', 'nicaragua'],\n ['🇳🇱', 'nld', 'netherlands'],\n ['🇳🇴', 'nor', 'norway'],\n ['🇳🇵', 'npl', 'nepal'],\n ['🇳🇷', 'nru', 'nauru'],\n ['🇳🇺', 'niu', 'niue'],\n ['🇳🇿', 'nzl', 'new zealand'],\n ['🇴🇲', 'omn', 'oman'],\n ['🇵🇦', 'pan', 'panama'],\n ['🇵🇪', 'per', 'peru'],\n ['🇵🇫', 'pyf', 'french polynesia'],\n ['🇵🇬', 'png', 'papua new guinea'],\n ['🇵🇭', 'phl', 'philippines'],\n ['🇵🇰', 'pak', 'pakistan'],\n ['🇵🇱', 'pol', 'poland'],\n ['🇵🇲', 'spm', 'saint pierre and miquelon'],\n ['🇵🇳', 'pcn', 'pitcairn'],\n ['🇵🇷', 'pri', 'puerto rico'],\n ['🇵🇸', 'pse', 'palestinian territory'],\n ['🇵🇹', 'prt', 'portugal'],\n ['🇵🇼', 'plw', 'palau'],\n ['🇵🇾', 'pry', 'paraguay'],\n ['🇶🇦', 'qat', 'qatar'],\n ['🇷🇪', 'reu', 'réunion'],\n ['🇷🇴', 'rou', 'romania'],\n ['🇷🇸', 'srb', 'serbia'],\n ['🇷🇺', 'rus', 'russia'],\n ['🇷🇼', 'rwa', 'rwanda'],\n ['🇸🇦', 'sau', 'saudi arabia'],\n ['🇸🇧', 'slb', 'solomon islands'],\n ['🇸🇨', 'syc', 'seychelles'],\n ['🇸🇩', 'sdn', 'sudan'],\n ['🇸🇪', 'swe', 'sweden'],\n ['🇸🇬', 'sgp', 'singapore'],\n ['🇸🇭', 'shn', 'saint helena, ascension and tristan da cunha'],\n ['🇸🇮', 'svn', 'slovenia'],\n ['🇸🇯', 'sjm', 'svalbard and jan mayen'],\n ['🇸🇰', 'svk', 'slovakia'],\n ['🇸🇱', 'sle', 'sierra leone'],\n ['🇸🇲', 'smr', 'san marino'],\n ['🇸🇳', 'sen', 'senegal'],\n ['🇸🇴', 'som', 'somalia'],\n ['🇸🇷', 'sur', 'suriname'],\n ['🇸🇸', 'ssd', 'south sudan'],\n ['🇸🇹', 'stp', 'sao tome and principe'],\n ['🇸🇻', 'slv', 'el salvador'],\n ['🇸🇽', 'sxm', 'sint maarten (dutch part)'],\n ['🇸🇾', 'syr', 'syrian arab republic'],\n ['🇸🇿', 'swz', 'swaziland'],\n ['🇹🇨', 'tca', 'turks and caicos islands'],\n ['🇹🇩', 'tcd', 'chad'],\n ['🇹🇫', 'atf', 'french southern territories'],\n ['🇹🇬', 'tgo', 'togo'],\n ['🇹🇭', 'tha', 'thailand'],\n ['🇹🇯', 'tjk', 'tajikistan'],\n ['🇹🇰', 'tkl', 'tokelau'],\n ['🇹🇱', 'tls', 'timor-leste'],\n ['🇹🇲', 'tkm', 'turkmenistan'],\n ['🇹🇳', 'tun', 'tunisia'],\n ['🇹🇴', 'ton', 'tonga'],\n ['🇹🇷', 'tur', 'turkey'],\n ['🇹🇹', 'tto', 'trinidad and tobago'],\n ['🇹🇻', 'tuv', 'tuvalu'],\n ['🇹🇼', 'twn', 'taiwan'],\n ['🇹🇿', 'tza', 'tanzania'],\n ['🇺🇦', 'ukr', 'ukraine'],\n ['🇺🇬', 'uga', 'uganda'],\n ['🇺🇲', 'umi', 'united states minor outlying islands'],\n ['🇺🇸', 'usa', 'united states'],\n [\n '🇺🇸',\n 'us', //alias\n 'united states'\n ],\n ['🇺🇾', 'ury', 'uruguay'],\n ['🇺🇿', 'uzb', 'uzbekistan'],\n ['🇻🇦', 'vat', 'vatican city'],\n ['🇻🇨', 'vct', 'saint vincent and the grenadines'],\n ['🇻🇪', 'ven', 'venezuela'],\n ['🇻🇬', 'vgb', 'virgin islands, british'],\n ['🇻🇮', 'vir', 'virgin islands, u.s.'],\n ['🇻🇳', 'vnm', 'viet nam'],\n ['🇻🇺', 'vut', 'vanuatu'],\n ['', 'win', 'west indies'],\n ['🇼🇫', 'wlf', 'wallis and futuna'],\n ['🇼🇸', 'wsm', 'samoa'],\n ['🇾🇪', 'yem', 'yemen'],\n ['🇾🇹', 'myt', 'mayotte'],\n ['🇿🇦', 'zaf', 'south africa'],\n ['🇿🇲', 'zmb', 'zambia'],\n ['🇿🇼 ', 'zwe', 'zimbabwe'],\n //others (later unicode versions)\n ['🇺🇳', 'un', 'united nations'],\n ['🏴󠁧󠁢󠁥󠁮󠁧󠁿󠁧󠁢󠁥󠁮󠁧󠁿', 'eng', 'england'],\n ['🏴󠁧󠁢󠁳󠁣󠁴󠁿', 'sct', 'scotland'],\n ['🏴󠁧󠁢󠁷󠁬󠁳󠁿', 'wal', 'wales'],\n ['🇪🇺', 'eu', 'european union']\n]\n","const parse = require('../_parsers/parse')\nconst flags = require('../../_data/flags')\n\nlet templates = {\n //https://en.wikipedia.org/wiki/Template:Flag\n // {{flag|USA}} → USA\n flag: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n let name = obj.flag || ''\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2]) || []\n let flag = found[0] || ''\n return `${flag} [[${found[2]}|${name}]]`\n },\n // {{flagcountry|USA}} → United States\n flagcountry: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2]) || []\n let flag = found[0] || ''\n return `${flag} [[${found[2]}]]`\n },\n // (unlinked flag-country)\n flagcu: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2]) || []\n let flag = found[0] || ''\n return `${flag} ${found[2]}`\n },\n //https://en.wikipedia.org/wiki/Template:Flagicon\n // {{flagicon|USA}} → United States\n flagicon: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2])\n if (!found) {\n return ''\n }\n return `[[${found[2]}|${found[0]}]]`\n },\n //unlinked flagicon\n flagdeco: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2]) || []\n return found[0] || ''\n },\n //same, but a soccer team\n fb: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2])\n if (!found) {\n return ''\n }\n return `${found[0]} [[${found[2]} national football team|${found[2]}]]`\n },\n fbicon: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2])\n if (!found) {\n return ''\n }\n return ` [[${found[2]} national football team|${found[0]}]]`\n },\n flagathlete: tmpl => {\n let order = ['name', 'flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2])\n if (!found) {\n return `[[${obj.name || ''}]]`\n }\n return `${found[0]} [[${obj.name || ''}]] (${found[1].toUpperCase()})`\n }\n}\n//support {{can}}\nflags.forEach(a => {\n templates[a[1]] = () => {\n return a[0]\n }\n})\n//cricket\ntemplates['cr'] = templates.flagcountry\ntemplates['cr-rt'] = templates.flagcountry\ntemplates['cricon'] = templates.flagicon\n\nmodule.exports = templates\n","const parse = require('../_parsers/parse')\nconst languages = require('../../_data/languages')\n\nconst getLang = function(name) {\n //grab the language from the template name - 'ipa-de'\n let lang = name.match(/ipac?-(.+)/)\n if (lang !== null) {\n if (languages.hasOwnProperty(lang[1]) === true) {\n return languages[lang[1]].english_title\n }\n return lang[1]\n }\n return null\n}\n\n// pronounciation info\nconst templates = {\n // https://en.wikipedia.org/wiki/Template:IPA\n ipa: (tmpl, list) => {\n let obj = parse(tmpl, ['transcription', 'lang', 'audio'])\n obj.lang = getLang(obj.template)\n obj.template = 'ipa'\n list.push(obj)\n return ''\n },\n //https://en.wikipedia.org/wiki/Template:IPAc-en\n ipac: (tmpl, list) => {\n let obj = parse(tmpl)\n obj.transcription = (obj.list || []).join(',')\n delete obj.list\n obj.lang = getLang(obj.template)\n obj.template = 'ipac'\n list.push(obj)\n return ''\n },\n transl: (tmpl, list) => {\n let obj = parse(tmpl, ['lang', 'text', 'text2'])\n // support 3-param\n if (obj.text2) {\n obj.iso = obj.text\n obj.text = obj.text2\n delete obj.text2\n }\n list.push(obj)\n return obj.text || ''\n }\n}\n// - other languages -\n// Polish, {{IPAc-pl}}\t{{IPAc-pl|'|sz|cz|e|ć|i|n}} → [ˈʂt͡ʂɛt͡ɕin]\n// Portuguese, {{IPAc-pt}}\t{{IPAc-pt|p|o|<|r|t|u|'|g|a|l|lang=pt}} and {{IPAc-pt|b|r|a|'|s|i|l|lang=br}} → [puɾtuˈɣaɫ] and [bɾaˈsiw]\nObject.keys(languages).forEach(lang => {\n templates['ipa-' + lang] = templates.ipa\n templates['ipac-' + lang] = templates.ipac\n})\n\nmodule.exports = templates\n","const languages = require('../../_data/languages')\nconst parse = require('../_parsers/parse')\n\nconst templates = {\n lang: 1,\n //this one has a million variants\n 'lang-de': 0,\n 'rtl-lang': 1,\n //german keyboard letterscn\n taste: 0,\n //https://en.wikipedia.org/wiki/Template:Nihongo\n nihongo: (tmpl, list) => {\n let obj = parse(tmpl, ['english', 'kanji', 'romaji', 'extra'])\n list.push(obj)\n let str = obj.english || obj.romaji || ''\n if (obj.kanji) {\n str += ` (${obj.kanji})`\n }\n return str\n }\n}\n//https://en.wikipedia.org/wiki/Category:Lang-x_templates\nObject.keys(languages).forEach(k => {\n templates['lang-' + k] = templates['lang-de']\n})\ntemplates['nihongo2'] = templates.nihongo\ntemplates['nihongo3'] = templates.nihongo\ntemplates['nihongo-s'] = templates.nihongo\ntemplates['nihongo foot'] = templates.nihongo\nmodule.exports = templates\n","const parse = require('../_parsers/parse')\n// const parseSentence = require('../../04-sentence').fromText;\n\n//simply num/denom * 100\nconst percentage = function(obj) {\n if (!obj.numerator && !obj.denominator) {\n return null\n }\n let perc = Number(obj.numerator) / Number(obj.denominator)\n perc *= 100\n let dec = Number(obj.decimals)\n if (isNaN(dec)) {\n dec = 1\n }\n perc = perc.toFixed(dec)\n return Number(perc)\n}\n\nlet templates = {\n // https://en.wikipedia.org/wiki/Template:Math\n math: (tmpl, list) => {\n let obj = parse(tmpl, ['formula'])\n list.push(obj)\n return '\\n\\n' + (obj.formula || '') + '\\n\\n'\n },\n\n //fraction - https://en.wikipedia.org/wiki/Template:Sfrac\n frac: (tmpl, list) => {\n let order = ['a', 'b', 'c']\n let obj = parse(tmpl, order)\n let data = {\n template: 'sfrac'\n }\n if (obj.c) {\n data.integer = obj.a\n data.numerator = obj.b\n data.denominator = obj.c\n } else if (obj.b) {\n data.numerator = obj.a\n data.denominator = obj.b\n } else {\n data.numerator = 1\n data.denominator = obj.a\n }\n list.push(data)\n if (data.integer) {\n return `${data.integer} ${data.numerator}⁄${data.denominator}`\n }\n return `${data.numerator}⁄${data.denominator}`\n },\n //https://en.wikipedia.org/wiki/Template:Radic\n radic: tmpl => {\n let order = ['after', 'before']\n let obj = parse(tmpl, order)\n return `${obj.before || ''}√${obj.after || ''}`\n },\n //{{percentage | numerator | denominator | decimals to round to (zero or greater) }}\n percentage: tmpl => {\n let obj = parse(tmpl, ['numerator', 'denominator', 'decimals'])\n let num = percentage(obj)\n if (num === null) {\n return ''\n }\n return num + '%'\n },\n // {{Percent-done|done=N|total=N|digits=N}}\n 'percent-done': tmpl => {\n let obj = parse(tmpl, ['done', 'total', 'digits'])\n let num = percentage({\n numerator: obj.done,\n denominator: obj.total,\n decimals: obj.digits\n })\n if (num === null) {\n return ''\n }\n return `${obj.done} (${num}%) done`\n },\n 'winning percentage': (tmpl, list) => {\n let obj = parse(tmpl, ['wins', 'losses', 'ties'])\n list.push(obj)\n let wins = Number(obj.wins)\n let losses = Number(obj.losses)\n let ties = Number(obj.ties) || 0\n let games = wins + losses + ties\n if (obj.ignore_ties === 'y') {\n ties = 0\n }\n if (ties) {\n wins += ties / 2\n }\n let num = percentage({\n numerator: wins,\n denominator: games,\n decimals: 1\n })\n if (num === null) {\n return ''\n }\n return `.${num * 10}`\n },\n winlosspct: (tmpl, list) => {\n let obj = parse(tmpl, ['wins', 'losses'])\n list.push(obj)\n let wins = Number(obj.wins)\n let losses = Number(obj.losses)\n let num = percentage({\n numerator: wins,\n denominator: wins + losses,\n decimals: 1\n })\n if (num === null) {\n return ''\n }\n num = `.${num * 10}`\n return `${wins || 0} || ${losses || 0} || ${num || '-'}`\n }\n}\n//aliases\ntemplates['sfrac'] = templates.frac\ntemplates['sqrt'] = templates.radic\ntemplates['pct'] = templates.percentage\ntemplates['percent'] = templates.percentage\ntemplates['winpct'] = templates['winning percentage']\ntemplates['winperc'] = templates['winning percentage']\n\nmodule.exports = templates\n","const parse = require('../_parsers/parse')\n\nconst generic = function(tmpl, list, alias) {\n let obj = parse(tmpl)\n if (alias) {\n obj.name = obj.template\n obj.template = alias\n }\n list.push(obj)\n return ''\n}\n\nconst misc = {\n //i18n templates\n persondata: generic,\n taxobox: generic,\n citation: generic,\n portal: generic,\n reflist: generic,\n 'cite book': generic,\n 'cite journal': generic,\n 'cite web': generic,\n 'commons cat': generic,\n\n // https://en.wikipedia.org/wiki/Template:Portuguese_name\n 'portuguese name': ['first', 'second', 'suffix'],\n uss: ['ship', 'id'],\n isbn: (tmpl, list) => {\n let order = ['id', 'id2', 'id3']\n let obj = parse(tmpl, order)\n list.push(obj)\n return 'ISBN: ' + (obj.id || '')\n },\n //https://en.wikipedia.org/wiki/Template:Marriage\n //this one creates a template, and an inline response\n marriage: (tmpl, list) => {\n let data = parse(tmpl, ['spouse', 'from', 'to', 'end'])\n list.push(data)\n let str = `${data.spouse || ''}`\n if (data.from) {\n if (data.to) {\n str += ` (m. ${data.from}-${data.to})`\n } else {\n str += ` (m. ${data.from})`\n }\n }\n return str\n },\n //https://en.wikipedia.org/wiki/Template:Based_on\n 'based on': (tmpl, list) => {\n let obj = parse(tmpl, ['title', 'author'])\n list.push(obj)\n return `${obj.title} by ${obj.author || ''}`\n },\n //https://en.wikipedia.org/wiki/Template:Video_game_release\n 'video game release': (tmpl, list) => {\n let order = ['region', 'date', 'region2', 'date2', 'region3', 'date3', 'region4', 'date4']\n let obj = parse(tmpl, order)\n let template = {\n template: 'video game release',\n releases: []\n }\n for (let i = 0; i < order.length; i += 2) {\n if (obj[order[i]]) {\n template.releases.push({\n region: obj[order[i]],\n date: obj[order[i + 1]]\n })\n }\n }\n list.push(template)\n let str = template.releases.map(o => `${o.region}: ${o.date || ''}`).join('\\n\\n')\n return '\\n' + str + '\\n'\n },\n //barrels of oil https://en.wikipedia.org/wiki/Template:Bbl_to_t\n 'bbl to t': (tmpl, list) => {\n let obj = parse(tmpl, ['barrels'])\n list.push(obj)\n if (obj.barrels === '0') {\n return obj.barrels + ' barrel'\n }\n return obj.barrels + ' barrels'\n },\n //https://en.wikipedia.org/wiki/Template:Historical_populations\n 'historical populations': (tmpl, list) => {\n let data = parse(tmpl)\n data.list = data.list || []\n let years = []\n for (let i = 0; i < data.list.length; i += 2) {\n let num = data.list[i + 1]\n years.push({\n year: data.list[i],\n val: Number(num) || num\n })\n }\n data.data = years\n delete data.list\n list.push(data)\n return ''\n }\n}\nmodule.exports = misc\n","// okay, these just hurts my feelings\n// https://www.mediawiki.org/wiki/Help:Magic_words#Other\nlet punctuation = [\n // https://en.wikipedia.org/wiki/Template:%C2%B7\n ['·', '·'],\n ['·', '·'],\n ['dot', '·'],\n ['middot', '·'],\n ['•', ' • '],\n //yup, oxford comma template\n [',', ','],\n ['1/2', '1⁄2'],\n ['1/3', '1⁄3'],\n ['2/3', '2⁄3'],\n ['1/4', '1⁄4'],\n ['3/4', '3⁄4'],\n ['–', '–'],\n ['ndash', '–'],\n ['en dash', '–'],\n ['spaced ndash', ' – '],\n\n ['—', '—'],\n ['mdash', '—'],\n ['em dash', '—'],\n\n ['number sign', '#'],\n ['ibeam', 'I'],\n ['&', '&'],\n [';', ';'],\n ['ampersand', '&'],\n ['snds', ' – '],\n ['snd', ' – '],\n // these '{{^}}' things are nuts, and used as some ilicit spacing thing.\n ['^', ' '],\n ['!', '|'],\n ['\\\\', ' /'],\n ['`', '`'],\n ['=', '='],\n ['bracket', '['],\n ['[', '['],\n ['*', '*'],\n ['asterisk', '*'],\n ['long dash', '———'],\n ['clear', '\\n\\n'],\n ['h.', 'ḥ']\n]\nconst templates = {}\npunctuation.forEach(a => {\n templates[a[0]] = a[1]\n})\nmodule.exports = templates\n","const parse = require('../_parsers/parse')\n\nlet templates = {\n //https://en.wikipedia.org/wiki/Template:Taxon_info\n 'taxon info': ['taxon', 'item'],\n\n //minor planet - https://en.wikipedia.org/wiki/Template:MPC\n mpc: (tmpl, list) => {\n let obj = parse(tmpl, ['number', 'text'])\n list.push(obj)\n return `[https://minorplanetcenter.net/db_search/show_object?object_id=P/2011+NO1 ${obj.text || obj.number}]`\n },\n //https://en.wikipedia.org/wiki/Template:Chem2\n chem2: (tmpl, list) => {\n let obj = parse(tmpl, ['equation'])\n list.push(obj)\n return obj.equation\n },\n //https://en.wikipedia.org/wiki/Template:Sky\n sky: (tmpl, list) => {\n let obj = parse(tmpl, [\n 'asc_hours',\n 'asc_minutes',\n 'asc_seconds',\n 'dec_sign',\n 'dec_degrees',\n 'dec_minutes',\n 'dec_seconds',\n 'distance'\n ])\n let template = {\n template: 'sky',\n ascension: {\n hours: obj.asc_hours,\n minutes: obj.asc_minutes,\n seconds: obj.asc_seconds\n },\n declination: {\n sign: obj.dec_sign,\n degrees: obj.dec_degrees,\n minutes: obj.dec_minutes,\n seconds: obj.dec_seconds\n },\n distance: obj.distance\n }\n list.push(template)\n return ''\n },\n\n /*\n{{Medical cases chart/Row\n|1 = valid date\n|2 = expression for deaths\n|3 = expression for recoveries\n|4 = expression for total cases (3rd classification)\n|alttot1 = alternate expression for active cases (3rd classification)\n|5 = expression for number in 4th classification\n|6 = expression for total in 5th classification\n|alttot2 = alternate expression for number in 5th classification\n|7 = number in the first column\n|8 = change in the first column\n|firstright1= whether a change in the first column is not applicable (n.a.) (yes|y|1)\n|9 = number in the second column\n|10 = change in the second column\n|firstright2= whether a change in the second column is not applicable (n.a.) (yes|y|1)\n|divisor = scaling divisor of the bars (bigger value = narrower bars) [defaults to: 1]\n|numwidth = max width of the numbers in the right columns (xx or xxxx)<-(n|t|m|w|d) [defaults to: mm]\n|collapsible= whether the row is collapsible (yes|y|1) {WIP}\n|collapsed = manual override of the initial row state (yes|y|1) {WIP}\n|id = manual override of the row id {WIP}\n}}\n*/\n\n // this is a weird one\n //https://en.wikipedia.org/wiki/Template:Medical_cases_chart\n 'medical cases chart': (tmpl, list) => {\n let order = [\n 'date',\n 'deaths_expr',\n 'recovery_expr',\n 'cases_expr',\n 'alt_expr_1',\n '4th_expr',\n '5th_expr',\n 'alt_expr_2',\n 'col_1',\n 'col_1_change',\n 'show_col_1',\n 'col_2',\n 'col_2_change',\n 'show_col_2',\n 'divisor',\n 'numwidth',\n 'collabsible',\n 'collapsed',\n 'id'\n ]\n let obj = parse(tmpl)\n // parse each row template\n let rows = obj.rows.match(/\\{\\{Medical cases chart\\/Row.*\\}\\}/gi)\n obj.rows = rows.map(row => {\n return parse(row, order)\n })\n list.push(obj)\n return ''\n },\n 'medical cases chart/row': tmpl => {\n // actually keep this template\n return tmpl\n }\n}\nmodule.exports = templates\n","const parse = require('../_parsers/parse')\nconst flags = require('../../_data/flags')\n\nlet sports = {\n player: (tmpl, list) => {\n let res = parse(tmpl, ['number', 'country', 'name', 'dl'])\n list.push(res)\n let str = `[[${res.name}]]`\n if (res.country) {\n let country = (res.country || '').toLowerCase()\n let flag = flags.find(a => country === a[1] || country === a[2]) || []\n if (flag && flag[0]) {\n str = flag[0] + ' ' + str\n }\n }\n if (res.number) {\n str = res.number + ' ' + str\n }\n return str\n },\n\n //https://en.wikipedia.org/wiki/Template:Goal\n goal: (tmpl, list) => {\n let res = parse(tmpl)\n let obj = {\n template: 'goal',\n data: []\n }\n let arr = res.list || []\n for (let i = 0; i < arr.length; i += 2) {\n obj.data.push({\n min: arr[i],\n note: arr[i + 1] || ''\n })\n }\n list.push(obj)\n //generate a little text summary\n let summary = '⚽ '\n summary += obj.data\n .map(o => {\n let note = o.note\n if (note) {\n note = ` (${note})`\n }\n return o.min + \"'\" + note\n })\n .join(', ')\n return summary\n },\n //yellow card\n yel: (tmpl, list) => {\n let obj = parse(tmpl, ['min'])\n list.push(obj)\n if (obj.min) {\n return `yellow: ${obj.min || ''}'` //no yellow-card emoji\n }\n return ''\n },\n subon: (tmpl, list) => {\n let obj = parse(tmpl, ['min'])\n list.push(obj)\n if (obj.min) {\n return `sub on: ${obj.min || ''}'` //no yellow-card emoji\n }\n return ''\n },\n suboff: (tmpl, list) => {\n let obj = parse(tmpl, ['min'])\n list.push(obj)\n if (obj.min) {\n return `sub off: ${obj.min || ''}'` //no yellow-card emoji\n }\n return ''\n },\n pengoal: (tmpl, list) => {\n list.push({\n template: 'pengoal'\n })\n return '✅'\n },\n penmiss: (tmpl, list) => {\n list.push({\n template: 'penmiss'\n })\n return '❌'\n },\n //'red' card - {{sent off|cards|min1|min2}}\n 'sent off': (tmpl, list) => {\n let obj = parse(tmpl, ['cards'])\n let result = {\n template: 'sent off',\n cards: obj.cards,\n minutes: obj.list || []\n }\n list.push(result)\n let mins = result.minutes.map(m => m + \"'\").join(', ')\n return 'sent off: ' + mins\n }\n}\nmodule.exports = sports\n","const parse = require('../_parsers/parse')\n\nconst misc = {\n 'baseball secondary style': 0,\n mlbplayer: function(tmpl, list) {\n let obj = parse(tmpl, ['number', 'name', 'dl'])\n list.push(obj)\n return obj.name\n }\n}\n\nmodule.exports = Object.assign({}, misc, require('./brackets'), require('./soccer'))\n","const parse = require('../_parsers/parse')\n\nconst codes = {\n adx: 'adx', //https://en.wikipedia.org/wiki/Template:Abu_Dhabi_Securities_Exchange\n aim: 'aim', //https://en.wikipedia.org/wiki/Template:Alternative_Investment_Market\n bvpasa: 'bvpasa', //https://en.wikipedia.org/wiki/Template:BVPASA\n asx: 'asx', //https://en.wikipedia.org/wiki/Template:Australian_Securities_Exchange\n athex: 'athex', //https://en.wikipedia.org/wiki/Template:Athens_Exchange\n bhse: 'bhse', //https://en.wikipedia.org/wiki/Template:Bahrain_Bourse\n bvb: 'bvb', //https://en.wikipedia.org/wiki/Template:Bucharest_Stock_Exchange\n bbv: 'bbv', //https://en.wikipedia.org/wiki/Template:BBV\n bsx: 'bsx', //https://en.wikipedia.org/wiki/Template:Bermuda_Stock_Exchange\n b3: 'b3', //https://en.wikipedia.org/wiki/Template:BM%26F_Bovespa\n 'bm&f': 'b3', //https://en.wikipedia.org/wiki/Template:BM%26F_Bovespa\n 'bm&f bovespa': 'b3', //https://en.wikipedia.org/wiki/Template:BM%26F_Bovespa\n bwse: 'bwse', //https://en.wikipedia.org/wiki/Template:Botswana_Stock_Exchange\n 'botswana stock exchange': 'botswana stock exchange', //https://en.wikipedia.org/wiki/Template:BM%26F_Bovespa\n bse: 'bse', //https://en.wikipedia.org/wiki/Template:Bombay_Stock_Exchange\n 'bombay stock exchange': 'bombay stock exchange', //https://en.wikipedia.org/wiki/Template:Bombay_Stock_Exchange\n bpse: 'bpse', //https://en.wikipedia.org/wiki/Template:Budapest_Stock_Exchange\n bcba: 'bcba', //https://en.wikipedia.org/wiki/Template:Buenos_Aires_Stock_Exchange\n 'canadian securities exchange': 'canadian securities exchange', //https://en.wikipedia.org/wiki/Template:Canadian_Securities_Exchange\n bvc: 'bvc', //https://en.wikipedia.org/wiki/Template:Colombian_Securities_Exchange\n cse: 'cse', //https://en.wikipedia.org/wiki/Template:Chittagong_Stock_Exchange\n darse: 'darse', //https://en.wikipedia.org/wiki/Template:Dar_es_Salaam_Stock_Exchange\n dse: 'dse', //https://en.wikipedia.org/wiki/Template:Dhaka_Stock_Exchange\n dfm: 'dfm', //https://en.wikipedia.org/wiki/Template:Dubai_Financial_Market\n euronext: 'euronext', //https://en.wikipedia.org/wiki/Template:Euronext\n fwb: 'fwb', //https://en.wikipedia.org/wiki/Template:Frankfurt_Stock_Exchange\n fse: 'fse', //https://en.wikipedia.org/wiki/Template:Fukuoka_Stock_Exchange\n gse: 'gse', //https://en.wikipedia.org/wiki/Template:Ghana_Stock_Exchange\n gtsm: 'gtsm', //https://en.wikipedia.org/wiki/Template:Gre_Tai_Securities_Market\n sehk: 'sehk', //https://en.wikipedia.org/wiki/Template:Hong_Kong_Stock_Exchange\n idx: 'idx', //https://en.wikipedia.org/wiki/Template:Indonesia_Stock_Exchange\n nse: 'nse', //https://en.wikipedia.org/wiki/Template:National_Stock_Exchange_of_India\n ise: 'ise', //https://en.wikipedia.org/wiki/Template:Irish_Stock_Exchange\n isin: 'isin', //https://en.wikipedia.org/wiki/Template:ISIN\n bist: 'bist', //https://en.wikipedia.org/wiki/Template:Borsa_Istanbul\n bit: 'bit', //https://en.wikipedia.org/wiki/Template:Borsa_Italiana\n jasdaq: 'jasdaq', //https://en.wikipedia.org/wiki/Template:JASDAQ\n jse: 'jse', //https://en.wikipedia.org/wiki/Template:Johannesburg_Stock_Exchange\n kase: 'kase', //https://en.wikipedia.org/wiki/Template:Kazakhstan_Stock_Exchange\n krx: 'krx', //https://en.wikipedia.org/wiki/Template:Korea_Exchange\n bvl: 'bvl', //https://en.wikipedia.org/wiki/Template:Lima_Stock_Exchange\n lse: 'lse', //https://en.wikipedia.org/wiki/Template:London_Stock_Exchange\n luxse: 'luxse', //https://en.wikipedia.org/wiki/Template:Luxembourg_Stock_Exchange\n bmad: 'bmad', //https://en.wikipedia.org/wiki/Template:Bolsa_de_Madrid\n myx: 'myx', //https://en.wikipedia.org/wiki/Template:Bursa_Malaysia\n bmv: 'bmv', //https://en.wikipedia.org/wiki/Template:Mexican_Stock_Exchange\n mcx: 'mcx', //https://en.wikipedia.org/wiki/Template:Moscow_Exchange\n mutf: 'mutf', //https://en.wikipedia.org/wiki/Template:Mutual_fund\n nag: 'nag', //https://en.wikipedia.org/wiki/Template:Nagoya_Stock_Exchange\n kn: 'kn', //https://en.wikipedia.org/wiki/Template:Nairobi_Securities_Exchange\n 'nasdaq dubai': 'nasdaq dubai', //https://en.wikipedia.org/wiki/Template:NASDAQ_Dubai\n nasdaq: 'nasdaq', //https://en.wikipedia.org/wiki/Template:NASDAQ\n neeq: 'neeq', //https://en.wikipedia.org/wiki/Template:NEEQ\n nepse: 'nepse', //https://en.wikipedia.org/wiki/Template:Nepal_Stock_Exchange\n nyse: 'nyse', //https://en.wikipedia.org/wiki/Template:New_York_Stock_Exchange\n nzx: 'nzx', //https://en.wikipedia.org/wiki/Template:New_Zealand_Exchange\n amex: 'amex', //https://en.wikipedia.org/wiki/Template:NYSE_American\n 'nyse arca': 'nyse arca', //https://en.wikipedia.org/wiki/Template:NYSE_Arca\n omx: 'omx', //https://en.wikipedia.org/wiki/Template:OMX\n 'omx baltic': 'omx baltic', //https://en.wikipedia.org/wiki/Template:OMX_Baltic\n ose: 'ose', //https://en.wikipedia.org/wiki/Template:Oslo_Stock_Exchange\n 'otc pink': 'otc pink', //https://en.wikipedia.org/wiki/Template:OTC_Pink\n otcqb: 'otcqb', //https://en.wikipedia.org/wiki/Template:OTCQB\n otcqx: 'otcqx', //https://en.wikipedia.org/wiki/Template:OTCQX\n 'philippine stock exchange': 'philippine stock exchange', //https://en.wikipedia.org/wiki/Template:Philippine_Stock_Exchange\n prse: 'prse', //https://en.wikipedia.org/wiki/Template:Prague_Stock_Exchange\n qe: 'qe', //https://en.wikipedia.org/wiki/Template:Qatar_Stock_Exchange\n bcs: 'bcs', //https://en.wikipedia.org/wiki/Template:Santiago_Stock_Exchange\n 'saudi stock exchange': 'saudi stock exchange', //https://en.wikipedia.org/wiki/Template:Saudi_Stock_Exchange\n sgx: 'sgx', //https://en.wikipedia.org/wiki/Template:Singapore_Exchange\n sse: 'sse', //https://en.wikipedia.org/wiki/Template:Shanghai_Stock_Exchange\n szse: 'szse', //https://en.wikipedia.org/wiki/Template:Shenzhen_Stock_Exchange\n swx: 'swx', //https://en.wikipedia.org/wiki/Template:SIX_Swiss_Exchange\n set: 'set', //https://en.wikipedia.org/wiki/Template:Stock_Exchange_of_Thailand\n tase: 'tase', //https://en.wikipedia.org/wiki/Template:Tel_Aviv_Stock_Exchange\n tyo: 'tyo', //https://en.wikipedia.org/wiki/Template:Tokyo_Stock_Exchange\n tsx: 'tsx', //https://en.wikipedia.org/wiki/Template:Toronto_Stock_Exchange\n twse: 'twse', //https://en.wikipedia.org/wiki/Template:Taiwan_Stock_Exchange\n 'tsx-v': 'tsx-v', //https://en.wikipedia.org/wiki/Template:TSX_Venture_Exchange\n tsxv: 'tsxv', //https://en.wikipedia.org/wiki/Template:TSX_Venture_Exchange\n nex: 'nex', //https://en.wikipedia.org/wiki/Template:TSXV_NEX\n ttse: 'ttse', //https://en.wikipedia.org/wiki/Template:Trinidad_and_Tobago_Stock_Exchange\n 'pfts ukraine stock exchange': 'pfts ukraine stock exchange', //https://en.wikipedia.org/wiki/Template:PFTS_Ukraine_Stock_Exchange\n wse: 'wse', //https://en.wikipedia.org/wiki/Template:Warsaw_Stock_Exchange\n wbag: 'wbag', //https://en.wikipedia.org/wiki/Template:Wiener_B%C3%B6rse\n zse: 'zse', //https://en.wikipedia.org/wiki/Template:Zagreb_Stock_Exchange\n 'zagreb stock exchange': 'zagreb stock exchange', //https://en.wikipedia.org/wiki/Template:Zagreb_Stock_Exchange\n 'zimbabwe stock exchange': 'zimbabwe stock exchange' //https://en.wikipedia.org/wiki/Template:Zimbabwe_Stock_Exchange\n}\n\nconst parseStockExchange = (tmpl, list) => {\n let o = parse(tmpl, ['ticketnumber', 'code'])\n list.push(o)\n let code = o.template || ''\n if (code === '') {\n code = o.code\n }\n code = (code || '').toLowerCase()\n let out = codes[code] || ''\n let str = out\n if (o.ticketnumber) {\n str = `${str}: ${o.ticketnumber}`\n }\n if (o.code && !codes[o.code.toLowerCase()]) {\n str += ' ' + o.code\n }\n return str\n}\n\nconst currencies = {}\n//the others fit the same pattern..\nObject.keys(codes).forEach(k => {\n currencies[k] = parseStockExchange\n})\n\nmodule.exports = currencies\n","const parse = require('../_parsers/parse')\nconst hasMonth = /^jan /i\nconst isYear = /^year /i\n\nconst monthList = [\n 'jan',\n 'feb',\n 'mar',\n 'apr',\n 'may',\n 'jun',\n 'jul',\n 'aug',\n 'sep',\n 'oct',\n 'nov',\n 'dec'\n]\n\nconst toNumber = function(str) {\n str = str.replace(/,/g, '')\n str = str.replace(/−/g, '-')\n let num = Number(str)\n if (isNaN(num)) {\n return str\n }\n return num\n}\n\nlet templates = {\n // this one is a handful!\n //https://en.wikipedia.org/wiki/Template:Weather_box\n 'weather box': (tmpl, list) => {\n let obj = parse(tmpl)\n //collect all month-based data\n let byMonth = {}\n let properties = Object.keys(obj).filter(k => hasMonth.test(k))\n properties = properties.map(k => k.replace(hasMonth, ''))\n properties.forEach(prop => {\n byMonth[prop] = []\n monthList.forEach(m => {\n let key = `${m} ${prop}`\n if (obj.hasOwnProperty(key)) {\n let num = toNumber(obj[key])\n delete obj[key]\n byMonth[prop].push(num)\n }\n })\n })\n //add these to original\n obj.byMonth = byMonth\n\n //collect year-based data\n let byYear = {}\n Object.keys(obj).forEach(k => {\n if (isYear.test(k)) {\n let prop = k.replace(isYear, '')\n byYear[prop] = obj[k]\n delete obj[k]\n }\n })\n obj.byYear = byYear\n\n list.push(obj)\n return ''\n },\n\n //The 36 parameters are: 12 monthly highs (C), 12 lows (total 24) plus an optional 12 monthly rain/precipitation\n //https://en.wikipedia.org/wiki/Template:Weather_box/concise_C\n 'weather box/concise c': (tmpl, list) => {\n let obj = parse(tmpl)\n obj.list = obj.list.map(s => toNumber(s))\n obj.byMonth = {\n 'high c': obj.list.slice(0, 12),\n 'low c': obj.list.slice(12, 24),\n 'rain mm': obj.list.slice(24, 36)\n }\n delete obj.list\n obj.template = 'weather box'\n list.push(obj)\n return ''\n },\n 'weather box/concise f': (tmpl, list) => {\n let obj = parse(tmpl)\n obj.list = obj.list.map(s => toNumber(s))\n obj.byMonth = {\n 'high f': obj.list.slice(0, 12),\n 'low f': obj.list.slice(12, 24),\n 'rain inch': obj.list.slice(24, 36)\n }\n delete obj.list\n obj.template = 'weather box'\n list.push(obj)\n return ''\n },\n\n //https://en.wikipedia.org/wiki/Template:Climate_chart\n 'climate chart': (tmpl, list) => {\n let lines = parse(tmpl).list || []\n let title = lines[0]\n let source = lines[38]\n lines = lines.slice(1)\n //amazingly, they use '−' symbol here instead of negatives...\n lines = lines.map(str => {\n if (str && str[0] === '−') {\n str = str.replace(/−/, '-')\n }\n return str\n })\n let months = []\n //groups of three, for 12 months\n for (let i = 0; i < 36; i += 3) {\n months.push({\n low: toNumber(lines[i]),\n high: toNumber(lines[i + 1]),\n precip: toNumber(lines[i + 2])\n })\n }\n let obj = {\n template: 'climate chart',\n data: {\n title: title,\n source: source,\n months: months\n }\n }\n list.push(obj)\n return ''\n }\n}\n\nmodule.exports = templates\n","//this format seems to be a pattern for these\nconst generic = ['id', 'title', 'description', 'section']\nconst idName = ['id', 'name']\n\n//https://en.wikipedia.org/wiki/Category:External_link_templates\nconst externals = {\n //https://en.wikipedia.org/wiki/Template:IMDb_title\n 'imdb title': generic,\n 'imdb name': generic,\n 'imdb episode': generic,\n 'imdb event': generic,\n 'afi film': generic,\n 'allmovie title': generic,\n allgame: generic,\n 'tcmdb title': generic,\n 'discogs artist': generic,\n 'discogs label': generic,\n 'discogs release': generic,\n 'discogs master': generic,\n 'librivox author': generic,\n 'musicbrainz artist': generic,\n 'musicbrainz label': generic,\n 'musicbrainz recording': generic,\n 'musicbrainz release': generic,\n 'musicbrainz work': generic,\n youtube: generic,\n 'goodreads author': idName,\n 'goodreads book': generic,\n twitter: idName,\n facebook: idName,\n instagram: idName,\n tumblr: idName,\n pinterest: idName,\n 'espn nfl': idName,\n 'espn nhl': idName,\n 'espn fc': idName,\n hockeydb: idName,\n 'fifa player': idName,\n worldcat: idName,\n 'worldcat id': idName,\n 'nfl player': idName,\n 'ted speaker': idName,\n playmate: idName,\n //https://en.wikipedia.org/wiki/Template:DMOZ\n dmoz: generic,\n\n 'find a grave': ['id', 'name', 'work', 'last', 'first', 'date', 'accessdate'],\n\n congbio: ['id', 'name', 'date'],\n\n 'hollywood walk of fame': ['name']\n}\n//alias\nexternals.imdb = externals['imdb name']\nexternals['imdb episodess'] = externals['imdb episode']\nmodule.exports = externals\n","const parse = require('../_parsers/parse')\n// const strip = require('./_parsers/_strip');\n\n//wiktionary... who knows. we should atleast try.\nconst templates = {\n //{{inflection of|avoir||3|p|pres|ind|lang=fr}}\n //https://en.wiktionary.org/wiki/Template:inflection_of\n inflection: (tmpl, list) => {\n let obj = parse(tmpl, ['lemma'])\n obj.tags = obj.list\n delete obj.list\n obj.type = 'form-of'\n list.push(obj)\n return obj.lemma || ''\n },\n\n //latin verbs\n 'la-verb-form': (tmpl, list) => {\n let obj = parse(tmpl, ['word'])\n list.push(obj)\n return obj.word || ''\n },\n 'feminine plural': (tmpl, list) => {\n let obj = parse(tmpl, ['word'])\n list.push(obj)\n return obj.word || ''\n },\n 'male plural': (tmpl, list) => {\n let obj = parse(tmpl, ['word'])\n list.push(obj)\n return obj.word || ''\n },\n rhymes: (tmpl, list) => {\n let obj = parse(tmpl, ['word'])\n list.push(obj)\n return 'Rhymes: -' + (obj.word || '')\n }\n}\n\n//https://en.wiktionary.org/wiki/Category:Form-of_templates\nlet conjugations = [\n 'abbreviation',\n 'abessive plural',\n 'abessive singular',\n 'accusative plural',\n 'accusative singular',\n 'accusative',\n 'acronym',\n 'active participle',\n 'agent noun',\n 'alternative case form',\n 'alternative form',\n 'alternative plural',\n 'alternative reconstruction',\n 'alternative spelling',\n 'alternative typography',\n 'aphetic form',\n 'apocopic form',\n 'archaic form',\n 'archaic spelling',\n 'aspirate mutation',\n 'associative plural',\n 'associative singular',\n 'attributive form',\n 'attributive form',\n 'augmentative',\n 'benefactive plural',\n 'benefactive singular',\n 'causative plural',\n 'causative singular',\n 'causative',\n 'clipping',\n 'combining form',\n 'comitative plural',\n 'comitative singular',\n 'comparative plural',\n 'comparative singular',\n 'comparative',\n 'contraction',\n 'dated form',\n 'dated spelling',\n 'dative plural definite',\n 'dative plural indefinite',\n 'dative plural',\n 'dative singular',\n 'dative',\n 'definite',\n 'deliberate misspelling',\n 'diminutive',\n 'distributive plural',\n 'distributive singular',\n 'dual',\n 'early form',\n 'eclipsis',\n 'elative',\n 'ellipsis',\n 'equative',\n 'euphemistic form',\n 'euphemistic spelling',\n 'exclusive plural',\n 'exclusive singular',\n 'eye dialect',\n 'feminine noun',\n 'feminine plural past participle',\n 'feminine plural',\n 'feminine singular past participle',\n 'feminine singular',\n 'feminine',\n 'form',\n 'former name',\n 'frequentative',\n 'future participle',\n 'genitive plural definite',\n 'genitive plural indefinite',\n 'genitive plural',\n 'genitive singular definite',\n 'genitive singular indefinite',\n 'genitive singular',\n 'genitive',\n 'gerund',\n 'h-prothesis',\n 'hard mutation',\n 'harmonic variant',\n 'imperative',\n 'imperfective form',\n 'inflected form',\n 'inflection',\n 'informal form',\n 'informal spelling',\n 'initialism',\n 'ja-form',\n 'jyutping reading',\n 'late form',\n 'lenition',\n 'masculine plural past participle',\n 'masculine plural',\n 'medieval spelling',\n 'misconstruction',\n 'misromanization',\n 'misspelling',\n 'mixed mutation',\n 'monotonic form',\n 'mutation',\n 'nasal mutation',\n 'negative',\n 'neuter plural past participle',\n 'neuter plural',\n 'neuter singular past participle',\n 'neuter singular',\n 'nominalization',\n 'nominative plural',\n 'nominative singular',\n 'nonstandard form',\n 'nonstandard spelling',\n 'oblique plural',\n 'oblique singular',\n 'obsolete form',\n 'obsolete spelling',\n 'obsolete typography',\n 'official form',\n 'participle',\n 'passive participle',\n 'passive',\n 'past active participle',\n 'past participle',\n 'past passive participle',\n 'past tense',\n 'perfective form',\n 'plural definite',\n 'plural indefinite',\n 'plural',\n 'polytonic form',\n 'present active participle',\n 'present participle',\n 'present tense',\n 'pronunciation spelling',\n 'rare form',\n 'rare spelling',\n 'reflexive',\n 'second-person singular past',\n 'short for',\n 'singular definite',\n 'singular',\n 'singulative',\n 'soft mutation',\n 'spelling',\n 'standard form',\n 'standard spelling',\n 'substantivisation',\n 'superlative',\n 'superseded spelling',\n 'supine',\n 'syncopic form',\n 'synonym',\n 'terminative plural',\n 'terminative singular',\n 'uncommon form',\n 'uncommon spelling',\n 'verbal noun',\n 'vocative plural',\n 'vocative singular'\n]\nconjugations.forEach(name => {\n templates[name + ' of'] = (tmpl, list) => {\n let obj = parse(tmpl, ['lemma'])\n obj.tags = obj.list\n delete obj.list\n obj.type = 'form-of'\n list.push(obj)\n return obj.lemma || ''\n }\n})\nmodule.exports = templates\n","module.exports = Object.assign(\n {},\n require('./dates'),\n require('./formatting'),\n require('./geo'),\n require('./wikipedia'),\n\n require('./brackets'),\n require('./currency'),\n require('./elections'),\n require('./flags'),\n require('./ipa'),\n require('./languages'),\n require('./math'),\n require('./misc'),\n require('./punctuation'),\n require('./science'),\n require('./soccer'),\n require('./sports'),\n require('./stock-exchanges'),\n require('./weather'),\n require('./websites'),\n require('./wiktionary')\n)\n","const ignore = require('./_ignore')\nconst parse = require('./_parsers/parse')\nconst inf = require('./_infobox')\nconst templates = require('./templates')\nconst generic = require('./_parsers/parse')\nconst nums = ['0', '1', '2', '3', '4', '5', '6', '7', '8']\n\nconst isArray = function(arr) {\n return Object.prototype.toString.call(arr) === '[object Array]'\n}\n\n//this gets all the {{template}} strings and decides how to parse them\nconst parseTemplate = function(tmpl, list) {\n let name = tmpl.name\n\n if (ignore.hasOwnProperty(name) === true) {\n return ''\n }\n\n // {{infobox settlement...}}\n if (inf.isInfobox(name) === true) {\n let obj = parse(tmpl.body, list, 'raw')\n let infobox = inf.format(obj)\n list.push(infobox)\n return ''\n }\n // //cite book, cite arxiv...\n if (/^cite [a-z]/.test(name) === true) {\n let obj = parse(tmpl.body, list)\n obj.type = obj.template\n obj.template = 'citation'\n list.push(obj)\n return ''\n }\n\n // known template\n if (templates.hasOwnProperty(name) === true) {\n // handle number-syntax\n if (typeof templates[name] === 'number') {\n let obj = generic(tmpl.body, nums)\n let key = String(templates[name])\n return obj[key] || ''\n }\n // handle string-syntax\n if (typeof templates[name] === 'string') {\n return templates[name]\n }\n // handle array sytax\n if (isArray(templates[name]) === true) {\n let obj = generic(tmpl.body, templates[name])\n list.push(obj)\n return ''\n }\n // handle function syntax\n if (typeof templates[name] === 'function') {\n return templates[name](tmpl.body, list)\n }\n }\n\n // unknown template, try to parse it\n let parsed = parse(tmpl.body)\n if (list && Object.keys(parsed).length > 0) {\n list.push(parsed)\n }\n // ..then remove it\n return ''\n}\nmodule.exports = parseTemplate\n","const Template = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\nconst methods = {\n text: function() {\n return ''\n },\n json: function() {\n return this.data\n }\n}\nObject.keys(methods).forEach(k => {\n Template.prototype[k] = methods[k]\n})\nmodule.exports = Template\n","const Infobox = require('../infobox/Infobox')\nconst Reference = require('../reference/Reference')\nconst findTemplates = require('./find')\nconst parse = require('./parse')\nconst Template = require('./Template')\nconst isCitation = new RegExp('^(cite |citation)', 'i')\n\nconst references = {\n citation: true,\n refn: true,\n harvnb: true\n}\n\nconst isReference = function(obj) {\n return references[obj.template] === true || isCitation.test(obj.template) === true\n}\n\nconst isObject = function(obj) {\n return obj && Object.prototype.toString.call(obj) === '[object Object]'\n}\n\nconst isInfobox = function(obj) {\n return obj.template === 'infobox' && obj.data && isObject(obj.data)\n}\n\n//reduce the scary recursive situations\nconst allTemplates = function(section) {\n let wiki = section.wiki\n // nested data-structure of templates\n let list = findTemplates(wiki)\n let keep = []\n\n // recursive template-parser\n const parseThem = function(obj, parent) {\n obj.parent = parent\n // do tail-first recurion\n if (obj.children && obj.children.length > 0) {\n obj.children.forEach(ch => parseThem(ch, obj))\n }\n obj.out = parse(obj, keep)\n // remove the text from every parent\n const removeIt = function(node, body, out) {\n if (node.parent) {\n node.parent.body = node.parent.body.replace(body, out)\n removeIt(node.parent, body, out)\n }\n }\n removeIt(obj, obj.body, obj.out)\n wiki = wiki.replace(obj.body, obj.out)\n }\n\n //kick it off\n list.forEach(node => parseThem(node, null))\n\n // sort-out the templates we decide to keep\n section.infoboxes = section.infoboxes || []\n section.references = section.references || []\n section.templates = section.templates || []\n section.templates = section.templates.concat(keep)\n // remove references and infoboxes from our list\n section.templates = section.templates.filter(obj => {\n if (isReference(obj) === true) {\n section.references.push(new Reference(obj))\n return false\n }\n if (isInfobox(obj) === true) {\n section.infoboxes.push(new Infobox(obj))\n return false\n }\n return true\n })\n section.templates = section.templates.map(obj => new Template(obj))\n\n // remove the templates from our wiki text\n list.forEach(node => {\n wiki = wiki.replace(node.body, node.out)\n })\n section.wiki = wiki\n}\n\nmodule.exports = allTemplates\n","const parseSentence = require('../../04-sentence/').fromText\nconst Image = require('../../image/Image')\n//okay, is a xml-tag, with newline-seperated data, somehow pivoted by '|'...\n//all deities help us. truly -> https://en.wikipedia.org/wiki/Help:Gallery_tag\n// - not to be confused with https://en.wikipedia.org/wiki/Template:Gallery...\nconst parseGallery = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/]*?)>([\\s\\S]+?)<\\/gallery>/g, (_, attrs, inside) => {\n let images = inside.split(/\\n/g)\n images = images.filter(str => str && str.trim() !== '')\n //parse the line, which has an image and sometimes a caption\n images = images.map(str => {\n let arr = str.split(/\\|/)\n let obj = {\n file: arr[0].trim()\n }\n let img = new Image(obj).json()\n let caption = arr.slice(1).join('|')\n if (caption !== '') {\n img.caption = parseSentence(caption)\n }\n return img\n })\n //add it to our templates list\n if (images.length > 0) {\n section.templates.push({\n template: 'gallery',\n images: images,\n pos: section.title\n })\n }\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseGallery\n","const parseTemplates = require('../../template')\n//this is a non-traditional template, for some reason\n//https://en.wikipedia.org/wiki/Template:Election_box\nconst parseElection = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/\\{\\{election box begin([\\s\\S]+?)\\{\\{election box end\\}\\}/gi, tmpl => {\n let data = {\n wiki: tmpl,\n templates: []\n }\n //put it through our full template parser..\n parseTemplates(data)\n //okay, pull it apart into something sensible..\n let templates = data.templates.map(t => t.json())\n let start = templates.find(t => t.template === 'election box') || {}\n let candidates = templates.filter(t => t.template === 'election box candidate')\n let summary = templates.find(t => t.template === 'election box gain' || t.template === 'election box hold') || {}\n if (candidates.length > 0 || summary) {\n section.templates.push({\n template: 'election box',\n title: start.title,\n candidates: candidates,\n summary: summary.data\n })\n }\n //remove it all\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseElection\n","const tableParser = require('../../table/parse')\nconst keys = {\n coach: ['team', 'year', 'g', 'w', 'l', 'w-l%', 'finish', 'pg', 'pw', 'pl', 'pw-l%'],\n player: ['year', 'team', 'gp', 'gs', 'mpg', 'fg%', '3p%', 'ft%', 'rpg', 'apg', 'spg', 'bpg', 'ppg'],\n roster: ['player', 'gp', 'gs', 'mpg', 'fg%', '3fg%', 'ft%', 'rpg', 'apg', 'spg', 'bpg', 'ppg']\n}\n\n//https://en.wikipedia.org/wiki/Template:NBA_player_statistics_start\nconst parseNBA = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/\\{\\{nba (coach|player|roster) statistics start([\\s\\S]+?)\\{\\{s-end\\}\\}/gi, (tmpl, name) => {\n tmpl = tmpl.replace(/^\\{\\{.*?\\}\\}/, '')\n tmpl = tmpl.replace(/\\{\\{s-end\\}\\}/, '')\n name = name.toLowerCase().trim()\n let headers = '! ' + keys[name].join(' !! ')\n let table = '{|\\n' + headers + '\\n' + tmpl + '\\n|}'\n let rows = tableParser(table)\n\n rows = rows.map(row => {\n Object.keys(row).forEach(k => {\n row[k] = row[k].text()\n })\n return row\n })\n section.templates.push({\n template: 'NBA ' + name + ' statistics',\n data: rows\n })\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseNBA\n","const tableParser = require('../../table/parse')\n//https://en.wikipedia.org/wiki/Template:MLB_game_log_section\n\n//this is pretty nuts\nconst whichHeadings = function(tmpl) {\n let headings = ['#', 'date', 'opponent', 'score', 'win', 'loss', 'save', 'attendance', 'record']\n if (/\\|stadium=y/i.test(tmpl) === true) {\n headings.splice(7, 0, 'stadium') //save, stadium, attendance\n }\n if (/\\|time=y/i.test(tmpl) === true) {\n headings.splice(7, 0, 'time') //save, time, stadium, attendance\n }\n if (/\\|box=y/i.test(tmpl) === true) {\n headings.push('box') //record, box\n }\n return headings\n}\n\nconst parseMlb = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/\\{\\{mlb game log (section|month)[\\s\\S]+?\\{\\{mlb game log (section|month) end\\}\\}/gi, tmpl => {\n let headings = whichHeadings(tmpl)\n tmpl = tmpl.replace(/^\\{\\{.*?\\}\\}/, '')\n tmpl = tmpl.replace(/\\{\\{mlb game log (section|month) end\\}\\}/i, '')\n let headers = '! ' + headings.join(' !! ')\n let table = '{|\\n' + headers + '\\n' + tmpl + '\\n|}'\n let rows = tableParser(table)\n rows = rows.map(row => {\n Object.keys(row).forEach(k => {\n row[k] = row[k].text()\n })\n return row\n })\n section.templates.push({\n template: 'mlb game log section',\n data: rows\n })\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseMlb\n","const tableParser = require('../../table/parse')\nlet headings = ['res', 'record', 'opponent', 'method', 'event', 'date', 'round', 'time', 'location', 'notes']\n\n//https://en.wikipedia.org/wiki/Template:MMA_record_start\nconst parseMMA = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/\\{\\{mma record start[\\s\\S]+?\\{\\{end\\}\\}/gi, tmpl => {\n tmpl = tmpl.replace(/^\\{\\{.*?\\}\\}/, '')\n tmpl = tmpl.replace(/\\{\\{end\\}\\}/i, '')\n let headers = '! ' + headings.join(' !! ')\n let table = '{|\\n' + headers + '\\n' + tmpl + '\\n|}'\n let rows = tableParser(table)\n rows = rows.map(row => {\n Object.keys(row).forEach(k => {\n row[k] = row[k].text()\n })\n return row\n })\n section.templates.push({\n template: 'mma record start',\n data: rows\n })\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseMMA\n","const parseSentence = require('../../04-sentence/').fromText\n//xml y=mx+b support\n//https://en.wikipedia.org/wiki/Help:Displaying_a_formula\nconst parseMath = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/]*?)>([\\s\\S]+?)<\\/math>/g, (_, attrs, inside) => {\n //clean it up a little?\n let formula = parseSentence(inside).text()\n section.templates.push({\n template: 'math',\n formula: formula,\n raw: inside\n })\n //should we atleast try to render it in plaintext? :/\n if (formula && formula.length < 12) {\n return formula\n }\n return ''\n })\n //try chemistry version too\n wiki = wiki.replace(/]*?)>([\\s\\S]+?)<\\/chem>/g, (_, attrs, inside) => {\n section.templates.push({\n template: 'chem',\n data: inside\n })\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseMath\n","const parseGallery = require('./gallery')\nconst parseElection = require('./election')\nconst parseNBA = require('./nba')\nconst parseMlb = require('./mlb')\nconst parseMMA = require('./mma')\nconst parseMath = require('./math')\n// Most templates are '{{template}}', but then, some are ''.\n// ... others are {{start}}...{{end}}\n// -> these are those ones.\nconst xmlTemplates = function(section) {\n parseElection(section)\n parseGallery(section)\n parseMath(section)\n parseMlb(section)\n parseMMA(section)\n parseNBA(section)\n}\n\nmodule.exports = xmlTemplates\n","const Section = require('./Section')\nconst i18n = require('../_data/i18n')\nconst isReference = new RegExp('^(' + i18n.references.join('|') + '):?', 'i')\nconst section_reg = /(?:\\n|^)(={2,5}.{1,200}?={2,5})/g\n\n//interpret ==heading== lines\nconst parse = {\n heading: require('./heading'),\n table: require('../table'),\n paragraphs: require('../03-paragraph'),\n templates: require('../template'),\n references: require('../reference'),\n startEndTemplates: require('./start-to-end')\n}\n\nconst oneSection = function(section, doc) {\n parse.startEndTemplates(section)\n //parse-out the tags\n parse.references(section)\n //parse-out all {{templates}}\n parse.templates(section)\n // //parse the tables\n parse.table(section)\n //now parse all double-newlines\n parse.paragraphs(section, doc)\n section = new Section(section)\n return section\n}\n\nconst removeReferenceSection = function(sections) {\n return sections.filter((s, i) => {\n if (isReference.test(s.title()) === true) {\n if (s.paragraphs().length > 0) {\n return true\n }\n //does it have some wacky templates?\n if (s.templates().length > 0) {\n return true\n }\n //what it has children? awkward\n if (sections[i + 1] && sections[i + 1].depth > s.depth) {\n sections[i + 1].depth -= 1 //move it up a level?...\n }\n return false\n }\n return true\n })\n}\n\nconst parseSections = function(doc) {\n let sections = []\n let split = doc.wiki.split(section_reg)\n for (let i = 0; i < split.length; i += 2) {\n let heading = split[i - 1] || ''\n let wiki = split[i] || ''\n if (wiki === '' && heading === '') {\n //usually an empty 'intro' section\n continue\n }\n let section = {\n title: '',\n depth: null,\n wiki: wiki,\n templates: [],\n tables: [],\n infoboxes: [],\n references: []\n }\n //figure-out title/depth\n parse.heading(section, heading)\n //parse it up\n let s = oneSection(section, doc)\n sections.push(s)\n }\n //remove empty references section\n doc.sections = removeReferenceSection(sections)\n}\n\nmodule.exports = parseSections\n","const i18n = require('../_data/i18n')\nconst cat_reg = new RegExp('\\\\[\\\\[:?(' + i18n.categories.join('|') + '):(.{2,178}?)]](w{0,10})', 'ig')\nconst cat_remove_reg = new RegExp('^\\\\[\\\\[:?(' + i18n.categories.join('|') + '):', 'ig')\n\nconst parse_categories = function(doc) {\n let wiki = doc.wiki\n let tmp = wiki.match(cat_reg) //regular links\n if (tmp) {\n tmp.forEach(function(c) {\n c = c.replace(cat_remove_reg, '')\n c = c.replace(/\\|?[ \\*]?\\]\\]$/i, '') //parse fancy onces..\n c = c.replace(/\\|.*/, '') //everything after the '|' is metadata\n if (c && !c.match(/[\\[\\]]/)) {\n doc.categories.push(c.trim())\n }\n })\n }\n wiki = wiki.replace(cat_reg, '')\n doc.wiki = wiki\n}\nmodule.exports = parse_categories\n","const Document = require('./Document')\nconst redirects = require('./redirects')\nconst preProcess = require('./preProcess')\nconst parse = {\n section: require('../02-section'),\n categories: require('./categories')\n}\n\n//convert wikiscript markup lang to json\nconst main = function(wiki, options) {\n options = options || {}\n let data = Object.assign(options, {\n title: options.title || null,\n pageID: options.pageID || options.id || null,\n namespace: options.namespace || options.ns || null,\n type: 'page',\n wiki: wiki || '',\n categories: [],\n sections: [],\n coordinates: []\n })\n //detect if page is just redirect, and return it\n if (redirects.isRedirect(wiki) === true) {\n data.type = 'redirect'\n data.redirectTo = redirects.parse(wiki)\n parse.categories(data)\n return new Document(data)\n }\n //give ourselves a little head-start\n preProcess(data)\n //pull-out [[category:whatevers]]\n parse.categories(data)\n //parse all the headings, and their texts/sentences\n parse.section(data)\n //all together now\n return new Document(data)\n}\n\nmodule.exports = main\n","const wtf = require('../01-document')\n\n// flip response object into proper Doc objs\nconst parseDoc = function(res) {\n res = res.filter(o => o)\n let docs = res.map(o => {\n return wtf(o.wiki, o.meta)\n })\n if (docs.length === 0) {\n return null\n }\n if (docs.length === 1) {\n return docs[0]\n }\n return docs\n}\nmodule.exports = parseDoc\n","// use the native client-side fetch function\nconst request = function(url, opts) {\n //eslint-disable-next-line\n return fetch(url, opts).then(function(res) {\n return res.json()\n })\n}\nmodule.exports = request\n","const makeHeaders = function(options) {\n let agent =\n options.userAgent ||\n options['User-Agent'] ||\n options['Api-User-Agent'] ||\n 'User of the wtf_wikipedia library'\n\n const opts = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'Api-User-Agent': agent,\n 'User-Agent': agent,\n Origin: '*'\n },\n redirect: 'follow'\n }\n return opts\n}\nmodule.exports = makeHeaders\n","const parseUrl = require('./00-parseUrl')\nconst makeUrl = require('./01-makeUrl')\nconst getResult = require('./02-getResult')\nconst parseDoc = require('./03-parseDoc')\nconst http = require('./http/server')\nconst makeHeaders = require('./_headers')\nconst isUrl = /^https?:\\/\\//\n\nconst defaults = {\n lang: 'en',\n wiki: 'wikipedia',\n domain: null,\n follow_redirects: true,\n path: 'api.php' //some 3rd party sites use a weird path\n}\n\nconst fetch = function(title, options, c) {\n let callback = null\n if (typeof options === 'function') {\n callback = options\n options = {}\n }\n if (typeof c === 'function') {\n callback = c\n c = {}\n }\n //support lang 2nd param\n if (typeof options === 'string') {\n c = c || {}\n options = Object.assign({}, { lang: options }, c)\n }\n options = options || {}\n options = Object.assign({}, defaults, options)\n options.title = title\n // parse url input\n if (isUrl.test(title)) {\n options = Object.assign(options, parseUrl(title))\n }\n\n const url = makeUrl(options)\n const headers = makeHeaders(options)\n return http(url, headers)\n .then(res => {\n try {\n let data = getResult(res, options)\n data = parseDoc(data)\n if (callback) {\n callback(null, data)\n }\n return data\n } catch (e) {\n throw e\n }\n })\n .catch(e => {\n console.error(e)\n if (callback) {\n callback(e, null)\n }\n return null\n })\n}\nmodule.exports = fetch\n","const http = require('./http/server')\nconst makeHeaders = require('./_headers')\nconst getResult = require('./02-getResult')\nconst parseDoc = require('./03-parseDoc')\n\nconst defaults = {\n lang: 'en',\n wiki: 'wikipedia',\n domain: null,\n path: 'w/api.php' //some 3rd party sites use a weird path\n}\nconst isObject = function(obj) {\n return obj && Object.prototype.toString.call(obj) === '[object Object]'\n}\n\nconst fetchRandom = function(lang, options) {\n options = options || {}\n options = Object.assign({}, defaults, options)\n //support lang 2nd param\n if (typeof lang === 'string') {\n options.lang = lang\n } else if (isObject(lang)) {\n options = Object.assign(options, lang)\n }\n\n let url = `https://${options.lang}.wikipedia.org/${options.path}?`\n if (options.domain) {\n url = `https://${options.domain}/${options.path}?`\n }\n url += `format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*`\n\n const headers = makeHeaders(options)\n return http(url, headers)\n .then(res => {\n try {\n let data = getResult(res)\n return parseDoc(data)\n } catch (e) {\n throw e\n }\n })\n .catch(e => {\n console.error(e)\n return null\n })\n}\nmodule.exports = fetchRandom\n","const http = require('./http/server')\nconst makeHeaders = require('./_headers')\n\nconst defaults = {\n lang: 'en',\n wiki: 'wikipedia',\n domain: null,\n path: 'w/api.php' //some 3rd party sites use a weird path\n}\n\nconst normalizeCategory = function(cat = '') {\n if (/^Category/i.test(cat) === false) {\n cat = 'Category:' + cat\n }\n cat = cat.replace(/ /g, '_')\n return cat\n}\n\nconst isObject = function(obj) {\n return obj && Object.prototype.toString.call(obj) === '[object Object]'\n}\n\nconst getResult = function(body) {\n let list = body.query.categorymembers || []\n let res = {\n pages: [],\n categories: []\n }\n list.forEach(p => {\n if (p.ns === 14) {\n delete p.ns\n res.categories.push(p)\n } else {\n delete p.ns\n res.pages.push(p)\n }\n })\n return res\n}\n\nconst makeUrl = function(category, options, cm) {\n category = normalizeCategory(category)\n category = encodeURIComponent(category)\n let url = `https://${options.lang}.wikipedia.org/${options.path}?`\n if (options.domain) {\n url = `https://${options.domain}/${options.path}?`\n }\n url += `action=query&list=categorymembers&cmtitle=${category}&cmlimit=500&format=json&origin=*&redirects=true&cmtype=page|subcat`\n if (cm) {\n url += '&cmcontinue=' + cm\n }\n return url\n}\n\nconst fetchCategory = function(category, lang, options) {\n options = options || {}\n options = Object.assign({}, defaults, options)\n //support lang 2nd param\n if (typeof lang === 'string') {\n options.lang = lang\n } else if (isObject(lang)) {\n options = Object.assign(options, lang)\n }\n let res = {\n pages: [],\n categories: []\n }\n // wrap a promise around potentially-many requests\n return new Promise((resolve, reject) => {\n const doit = function(cm) {\n let url = makeUrl(category, options, cm)\n const headers = makeHeaders(options)\n return http(url, headers)\n .then(body => {\n res = getResult(body, res)\n if (body.continue && body.continue.cmcontinue) {\n doit(body.continue.cmcontinue)\n } else {\n resolve(res)\n }\n })\n .catch(e => {\n console.error(e)\n reject(e)\n })\n }\n doit(null)\n })\n}\n\nmodule.exports = fetchCategory\n","module.exports = '8.1.0'","const fetch = require('./_fetch')\nconst random = require('./_fetch/random')\nconst category = require('./_fetch/category')\nconst version = require('./_version')\nconst parseDocument = require('./01-document/index.js')\n\n//the main 'factory' exported method\nconst wtf = function(wiki, options) {\n return parseDocument(wiki, options)\n}\n\n// export classes for plugin development\nconst models = {\n Doc: require('./01-document/Document'),\n Section: require('./02-section/Section'),\n Paragraph: require('./03-paragraph/Paragraph'),\n Sentence: require('./04-sentence/Sentence'),\n Image: require('./image/Image'),\n Infobox: require('./infobox/Infobox'),\n Link: require('./link/Link'),\n List: require('./list/List'),\n Reference: require('./reference/Reference'),\n Table: require('./table/Table'),\n Template: require('./template/Template'),\n wtf: wtf\n}\nlet templates = require('./template/templates')\n\nwtf.fetch = function(title, lang, options, cb) {\n return fetch(title, lang, options, cb)\n}\nwtf.random = function(lang, options, cb) {\n return random(lang, options, cb)\n}\nwtf.category = function(cat, lang, options, cb) {\n return category(cat, lang, options, cb)\n}\nwtf.extend = function(fn) {\n fn(models, templates, this)\n return this\n}\nwtf.version = version\n\nmodule.exports = wtf\n"],"names":["parseUrl","url","parsed","URL","title","pathname","replace","decodeURIComponent","domain","host","isInterWiki","defaults","action","prop","rvprop","maxlag","rvslots","origin","format","redirects","toQueryString","obj","Object","entries","map","key","value","encodeURIComponent","join","isArray","arr","prototype","toString","call","cleanTitle","page","trim","makeUrl","options","params","assign","lang","wiki","wikiUrl","path","test","follow_redirects","pageids","titles","getResult","data","pages","keys","query","docs","id","hasOwnProperty","text","revisions","slots","main","meta","pageID","pageid","namespace","ns","e","console","error","sectionMap","doc","fn","clue","sections","forEach","sec","list","t","push","setDefaults","categories","toJSON","i","json","isRedirect","redirectTo","coordinates","infoboxes","images","plaintext","citations","references","i18n","require$$0","reduce","h","str","d","english","isDisambig","templates","found","find","template","firstLine","sentences","caption","alt","links","thumb","toJson","img","file","thumbnail","server","encodeTitle","charAt","toUpperCase","substring","makeSrc","Image","defineProperty","enumerable","methods","size","split","length","toLowerCase","k","src","tables","lists","paragraphs","Document","undefined","guess","sen","bolds","language","type","isDisambiguation","disambig","s","n","concat","paragraph","sentence","info","image","unshift","interwiki","sort","a","b","debug","log","indent","depth","plurals","sing","res","redirectsTo","redirect","require$$1","require$$2","require$$3","require$$4","require$$5","aa","ab","af","ak","als","am","an","ang","ar","arc","as","ast","av","ay","az","ba","bar","bcl","be","bg","bh","bi","bm","bn","bo","bpy","br","bs","bug","bxr","ca","cdo","ce","ceb","ch","cho","chr","chy","co","cr","cs","csb","cu","cv","cy","da","de","diq","dsb","dv","dz","ee","far","el","en","eo","es","et","eu","ext","ff","fi","fj","fo","fr","frp","fur","fy","ga","gan","gd","gil","gl","gn","got","gu","gv","ha","hak","haw","he","hi","ho","hr","ht","hu","hy","hz","ia","ie","ig","ii","ik","ilo","io","is","it","iu","ja","jbo","jv","ka","kg","ki","kj","kk","kl","km","kn","khw","ko","kr","ks","ksh","ku","kv","kw","ky","la","lad","lan","lb","lg","li","lij","lmo","ln","lo","lt","lv","mg","man","mh","mi","min","mk","ml","mn","mo","mr","ms","mt","mus","my","na","nah","nap","nd","nds","ne","ng","nl","nn","no","nr","nso","nrm","nv","ny","oc","oj","om","or","os","pa","pag","pam","pap","pdc","pi","pih","pl","pms","ps","pt","qu","rm","rmy","rn","ro","ru","rw","sa","sc","scn","sco","sd","se","sg","sh","si","simple","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tet","tg","th","ti","tk","tl","tlh","tn","to","tpi","tr","ts","tt","tum","tw","ty","udm","ug","uk","ur","uz","ve","vi","vec","vls","vo","wa","war","wo","xal","xh","yi","yo","za","zh","zu","wp","wm","w","acronym","advisory","advogato","aew","appropedia","aquariumwiki","arborwiki","arxiv","atmwiki","baden","battlestarwiki","bcnbio","beacha","betawiki","bibcode","bibliowiki","bluwiki","blw","botwiki","boxrec","brickwiki","bugzilla","bulba","c","c2","c2find","cache","ĉej","cellwiki","centralwikia","chej","choralwiki","citizendium","ckwiss","comixpedia","commons","communityscheme","communitywiki","comune","creativecommons","creativecommonswiki","cxej","dcc","dcdatabase","dcma","debian","delicious","devmo","dictionary","dict","disinfopedia","distributedproofreaders","distributedproofreadersca","dmoz","dmozs","doi","donate","doom_wiki","download","dbdump","dpd","drae","dreamhost","drumcorpswiki","dwjwiki","eĉei","ecoreality","ecxei","elibre","emacswiki","encyc","energiewiki","englyphwiki","enkol","eokulturcentro","esolang","etherpad","ethnologue","ethnologuefamily","evowiki","exotica","fanimutationwiki","fedora","finalfantasy","finnix","flickruser","flickrphoto","floralwiki","foldoc","foundation","foundationsite","foxwiki","freebio","freebsdman","freeculturewiki","freedomdefined","freefeel","freekiwiki","freesoft","ganfyd","gardenology","gausswiki","gentoo","genwiki","gerrit","git","google","googledefine","googlegroups","guildwarswiki","guildwiki","guc","gucprefix","gutenberg","gutenbergwiki","hackerspaces","h2wiki","hammondwiki","hdl","heraldik","heroeswiki","horizonlabs","hrwiki","hrfwiki","hupwiki","iarchive","imdbname","imdbtitle","imdbcompany","imdbcharacter","incubator","infosecpedia","infosphere","issn","iuridictum","jaglyphwiki","jefo","jerseydatabase","jira","jspwiki","jstor","kamelo","karlsruhe","kinowiki","komicawiki","kontuwiki","wikitech","libreplanet","linguistlist","linuxwiki","linuxwikide","liswiki","literateprograms","livepedia","localwiki","lojban","lostpedia","lqwiki","luxo","mail","mailarchive","mariowiki","marveldatabase","meatball","mw","mediazilla","memoryalpha","metawiki","metawikimedia","metawikipedia","mineralienatlas","moinmoin","monstropedia","mosapedia","mozcom","mozillawiki","mozillazinekb","musicbrainz","mediawikiwiki","mwod","mwot","nkcells","nara","nosmoke","nost","nostalgia","oeis","oldwikisource","olpc","omegawiki","onelook","openlibrary","openstreetmap","openwetware","opera7wiki","organicdesign","orthodoxwiki","osmwiki","otrs","otrswiki","ourmedia","outreach","outreachwiki","owasp","panawiki","patwiki","personaltelco","petscan","phab","phabricator","phwiki","phpwiki","planetmath","pmeg","pmid","pokewiki","pokéwiki","policy","proofwiki","pyrev","pythoninfo","pythonwiki","pywiki","psycle","quality","quarry","regiowiki","rev","revo","rfc","rheinneckar","robowiki","rodovid","reuterswiki","rowiki","rt","s23wiki","scholar","schoolswp","scores","scoutwiki","scramble","seapig","seattlewiki","slwiki","senseislibrary","sharemap","silcode","slashdot","sourceforge","spcom","species","squeak","stats","stewardry","strategy","strategywiki","sulutil","swtrain","svn","swinbrain","tabwiki","tclerswiki","technorati","tenwiki","testwiki","testwikidata","test2wiki","tfwiki","thelemapedia","theopedia","thinkwiki","ticket","tmbw","tmnet","tmwiki","toolforge","toollabs","tools","tswiki","translatewiki","tviv","tvtropes","twiki","tyvawiki","umap","uncyclopedia","unihan","unreal","urbandict","usej","usemod","usability","utrs","vikidia","vlos","vkol","voipinfo","votewiki","werelate","wg","wikia","wikiasite","wikiapiary","wikibooks","wikichristian","wikicities","wikicity","wikiconference","wikidata","wikif1","wikifur","wikihow","wikiindex","wikilemon","wikilivres","wikilivresru","wikimedia","wikinews","wikinfo","wikinvest","wikiotics","wikipapers","wikipedia","wikipediawikipedia","wikiquote","wikisophia","wikisource","wikispecies","wikispot","wikiskripta","labsconsole","wikiti","wikiversity","wikivoyage","betawikiversity","wikiwikiweb","wiktionary","wipipedia","wlug","wmam","wmar","wmat","wmau","wmbd","wmbe","wmbr","wmca","wmch","wmcl","wmcn","wmco","wmcz","wmdc","securewikidc","wmde","wmdk","wmee","wmec","wmes","wmet","wmfdashboard","wmfi","wmfr","wmge","wmhi","wmhk","wmhu","wmid","wmil","wmin","wmit","wmke","wmmk","wmmx","wmnl","wmnyc","wmno","wmph","wmpl","wmpt","wmpunjabi","wmromd","wmrs","wmru","wmse","wmsk","wmtr","wmtw","wmua","wmuk","wmve","wmza","wm2005","wm2006","wm2007","wm2008","wm2009","wm2010","wm2011","wm2012","wm2013","wm2014","wm2015","wm2016","wm2017","wm2018","wmania","wikimania","wmteam","wmf","wmfblog","wmdeblog","wookieepedia","wowwiki","wqy","wurmpedia","viaf","zrhwiki","zum","zwiki","m","sep11","minnan","nb","nan","vro","cmn","lzh","rup","gsw","sgs","egl","wikt","q","chapter","v","voy","languages","interwikis","parseInterwiki","indexOf","match","site","ignore_links","external_link","link_reg","external_links","raw","protocol","link","internal_links","suffix","txt","anchor","parse_interwiki","parse_links","REDIRECT_REGEX","RegExp","parse","parseLink","ignore","openTag","closeTag","anyChar","noThanks","kill_xml","preProcess","specialChar","encodeStr","encodeObj","headers","section","p","encode","ref","Section","_title","index","indentation","templ","o","filter","name","num","remove","bads","children","nextSibling","lastSibling","parent","pList","next","last","previousSibling","previous","capitalise","slice","trim_whitespace","Link","href","wikis","removeLinks","line","getLinks","parseLinks","formatting","italics","fmt","bold","italic","isNumber","dates","numbers","Number","isNaN","number","l","Sentence","abbreviations","literalAbbreviations","abbrev_reg","acronym_reg","elipses_reg","hasWord","flatten","all","naiive_split","splits","isBalanced","open","closed","quotes","sentence_parser","chunks","isSentence","hmm","postprocess","helpers","fromText","parseFmt","byParagraph","sentenceParser","strip","tmpl","fmtName","pipeSplitter","pop","hasKey","reserved","parseKey","parts","val","keyMaker","order","whoCares","classname","style","align","margin","left","boxsize","framestyle","item_style","collapsible","list_style_type","colwidth","cleanup","parseSentence","makeFormat","parser","shift","Reference","encyclopedia","author","hasCitation","parseCitation","parseInline","inline","parseRefs","r","heading_reg","parseHeading","parseReferences","fns","lines","findRows","rows","row","getRowSpan","getColSpan","doColSpan","parseInt","splice","doRowSpan","handleSpans","isHeading","headings","age","born","date","year","city","country","population","count","cleanText","skipSpanRow","len","hasTxt","removeMidSpans","findHeaders","first","Boolean","parseRow","firstRowHeader","parseTable","want","table","Table","keyValue","keyvalue","keyval","openReg","closeReg","findTables","stack","Paragraph","opener","closer","nested_find","out","chars","open_count","close_count","j","isFile","fileNames","file_reg","imgLayouts","border","right","center","top","bottom","none","upright","baseline","middle","sub","oneImage","imgData","parseTemplate","parseImages","matches","toText","List","list_reg","bullet_reg","number_reg","has_word","isList","cleanList","grabList","parseList","theRest","parseSentences","twoNewLines","parseParagraphs","infobox","normalize","Infobox","_type","get","tmp","close","findFlat","carry","getName","hasTemplate","body","doEach","substr","inside","findTemplates","i18nReg","startReg","endReg","yearIn","known","editnotice","geobox","hybridbox","ichnobox","infraspeciesbox","mycomorphbox","oobox","speciesbox","subspeciesbox","taxobox","nhlteamseason","edencharacter","samurai","protein","ordination","mlbbioret","isInfobox","fmtInfobox","monthName","months","ymd","units","month","String","tz","pad","hour","minute","time","second","misc","reign","start","end","circa","Date","getFullYear","getMonth","getDate","monthname","oldstyledate","day","getEpoch","getTime","delta","from","diff","years","Math","floor","days","getBoth","parsers","timezone","natural_date","one_year","two_dates","birth_year","birth_month","birth_date","death_year","death_month","death_date","timeSince","now","predicate","abs","hours","dateTmpl","currentday","currentdayname","getDay","currentmonth","currentyear","monthyear","setMonth","birth_day","dts","birth","death","birthdeathage","dob","localday","localdayname","localmonth","localyear","currentmonthname","currentmonthabbrev","bda","tag","span","div","content","attribs","plural","word","sep","trunc","p1","p2","p3","braces","attrs","nobold","noitalic","nocaps","syntaxhighlight","code","samp","vanchor","resize","ra","minutes","seconds","deg2hms","degrees","hms2deg","decdeg","deg","rnd","dec","toLocaleString","u","ul","upl","tmpls","plainlist","hlist","pagelist","catlist","f","flatlist","ublist","collist","columnslist","convert","two","four","three","term","defn","lino","linum","ill","frac","height","result","unit","quote","lbs","lbc","lbb","own","sic","one","nolink","formatnum","lc","lcfirst","uc","ucfirst","padleft","padStart","padright","padEnd","abbr","abbrlink","finedetail","parseDms","hemisphere","sign","decDeg","round","places","negative","findLatLng","types","lat","lon","convertDMS","parseParams","props","parseCoor","coord","display","geo","etyl","mention","sortname","target","dab","ll","sisterProjects","commonscat","about","desc","sfn","alias","teplate","audio","rp","gallery","unreferenced","citation","titlecase","cells","moreCells","won","place","zeroPad","parseTeam","team","score","seed","playoffBracket","rounds","brackets","codes","a$","au$","aud","bdt","brl","ca$","cad","chf","cny","czk","dkk","dkk2","euro","gbp","hk$","hkd","ils","inr","jpy","myr","nis","nok","nok2","nz$","nzd","peso","pkr","r$","rmb","rub","ruble","rupee","s$","sek","sek2","sfr","sgd","shekel","sheqel","ttd","us$","usd","yen","zar","parseCurrency","amount","inrConvert","currency_formatting","multiplier","rupee_value","currencies","currency","monnaie","unité","nombre","iso4217","inrconvert","flag","flags","flagcountry","flagcu","flagicon","flagdeco","fb","fbicon","flagathlete","getLang","english_title","ipa","ipac","transcription","transl","text2","iso","taste","nihongo","romaji","kanji","percentage","numerator","denominator","perc","decimals","toFixed","math","formula","integer","radic","before","after","done","total","digits","wins","losses","ties","games","ignore_ties","winlosspct","generic","persondata","portal","reflist","uss","isbn","marriage","spouse","releases","region","barrels","punctuation","mpc","chem2","equation","sky","ascension","asc_hours","asc_minutes","asc_seconds","declination","dec_sign","dec_degrees","dec_minutes","dec_seconds","distance","sports","player","goal","note","summary","yel","subon","suboff","pengoal","penmiss","cards","mins","mlbplayer","adx","aim","bvpasa","asx","athex","bhse","bvb","bbv","bsx","b3","bwse","bse","bpse","bcba","bvc","cse","darse","dse","dfm","euronext","fwb","fse","gse","gtsm","sehk","idx","nse","ise","isin","bist","bit","jasdaq","jse","kase","krx","bvl","lse","luxse","bmad","myx","bmv","mcx","mutf","nag","nasdaq","neeq","nepse","nyse","nzx","amex","omx","ose","otcqb","otcqx","prse","qe","bcs","sgx","sse","szse","swx","set","tase","tyo","tsx","twse","tsxv","nex","ttse","wse","wbag","zse","parseStockExchange","ticketnumber","hasMonth","isYear","monthList","toNumber","byMonth","properties","byYear","source","low","high","precip","idName","externals","allgame","youtube","twitter","facebook","instagram","tumblr","pinterest","hockeydb","worldcat","playmate","congbio","imdb","inflection","tags","lemma","rhymes","conjugations","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","nums","inf","Template","isCitation","refn","harvnb","isReference","isObject","allTemplates","keep","parseThem","removeIt","node","parseGallery","_","pos","parseElection","parseTemplates","candidates","coach","roster","parseNBA","tableParser","whichHeadings","parseMlb","parseMMA","parseMath","xmlTemplates","section_reg","heading","startEndTemplates","oneSection","removeReferenceSection","parseSections","cat_reg","cat_remove_reg","parse_categories","parseDoc","wtf","request","opts","fetch","then","makeHeaders","agent","userAgent","method","Origin","isUrl","callback","http","fetchRandom","normalizeCategory","cat","categorymembers","category","cm","fetchCategory","Promise","resolve","reject","doit","cmcontinue","parseDocument","models","Doc","cb","random","extend","version"],"mappings":";;;;;;;EAAA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAASC,GAAT,EAAc;EAC7B,MAAIC,MAAM,GAAG,IAAIC,GAAJ,CAAQF,GAAR,CAAb,CAD6B;;EAE7B,MAAIG,KAAK,GAAGF,MAAM,CAACG,QAAP,CAAgBC,OAAhB,CAAwB,cAAxB,EAAwC,EAAxC,CAAZ;EACAF,EAAAA,KAAK,GAAGG,kBAAkB,CAACH,KAAD,CAA1B;EACA,SAAO;EACLI,IAAAA,MAAM,EAAEN,MAAM,CAACO,IADV;EAELL,IAAAA,KAAK,EAAEA;EAFF,GAAP;EAID,CARD;;EASA,eAAc,GAAGJ,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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+BqkD,EAA/B,EAAmC;EAC7C,SAAOzB,MAAK,CAAC9kD,KAAD,EAAQqC,IAAR,EAAcH,OAAd,CAAZ;EACD,CAFD;;EAGAyiD,GAAG,CAAC6B,MAAJ,GAAa,UAASnkD,IAAT,EAAeH,OAAf,EAAwBqkD,EAAxB,EAA4B;EACvC,SAAOC,MAAM,CAACnkD,IAAD,EAAOH,OAAP,CAAb;EACD,CAFD;;EAGAyiD,GAAG,CAACiB,QAAJ,GAAe,UAASF,GAAT,EAAcrjD,IAAd,EAAoBH,OAApB,EAA6BqkD,EAA7B,EAAiC;EAC9C,SAAOX,QAAQ,CAACF,GAAD,EAAMrjD,IAAN,EAAYH,OAAZ,CAAf;EACD,CAFD;;EAGAyiD,GAAG,CAAC8B,MAAJ,GAAa,UAAStiD,EAAT,EAAa;EACxBA,EAAAA,EAAE,CAACkiD,MAAD,EAASrgD,WAAT,EAAoB,IAApB,CAAF;EACA,SAAO,IAAP;EACD,CAHD;;EAIA2+C,GAAG,CAAC+B,OAAJ,GAAcA,QAAd;EAEA,OAAc,GAAG/B,GAAjB;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"wtf_wikipedia-client.js","sources":["../src/_fetch/00-parseUrl.js","../src/_fetch/01-makeUrl.js","../src/_fetch/02-getResult.js","../src/01-document/_sectionMap.js","../src/_lib/setDefaults.js","../src/01-document/toJson.js","../src/_data/disambig.js","../src/01-document/disambig.js","../src/image/toJson.js","../src/image/Image.js","../src/01-document/Document.js","../src/_data/categories.js","../src/_data/images.js","../src/_data/infoboxes.js","../src/_data/redirects.js","../src/_data/references.js","../src/_data/i18n.js","../src/_data/languages.js","../src/_data/interwiki.js","../src/link/interwiki.js","../src/link/parse.js","../src/01-document/redirects.js","../src/01-document/preProcess/kill_xml.js","../src/01-document/preProcess/index.js","../src/_lib/encode.js","../src/02-section/toJson.js","../src/02-section/Section.js","../src/_lib/helpers.js","../src/link/Link.js","../src/link/index.js","../src/04-sentence/formatting.js","../src/04-sentence/toJson.js","../src/04-sentence/Sentence.js","../src/04-sentence/_abbreviations.js","../src/04-sentence/parse.js","../src/04-sentence/index.js","../src/template/_parsers/_strip.js","../src/template/_parsers/_fmtName.js","../src/template/_parsers/01-pipe-splitter.js","../src/template/_parsers/02-keyMaker.js","../src/template/_parsers/03-cleanup.js","../src/template/_parsers/parse.js","../src/reference/Reference.js","../src/reference/index.js","../src/02-section/heading.js","../src/table/parse/_findRows.js","../src/table/parse/_spans.js","../src/table/parse/index.js","../src/table/toJson.js","../src/table/Table.js","../src/table/index.js","../src/03-paragraph/toJson.js","../src/03-paragraph/Paragraph.js","../src/image/nested_find.js","../src/image/index.js","../src/list/List.js","../src/list/index.js","../src/03-paragraph/index.js","../src/infobox/toJson.js","../src/infobox/Infobox.js","../src/template/find/flat.js","../src/template/_parsers/_getName.js","../src/template/find/index.js","../src/template/_ignore.js","../src/template/_infobox.js","../src/template/templates/dates/_months.js","../src/template/templates/dates/_format.js","../src/template/templates/dates/misc.js","../src/template/templates/dates/_delta.js","../src/template/templates/dates/parsers.js","../src/template/templates/dates/_timeSince.js","../src/template/templates/dates/index.js","../src/template/templates/formatting/format.js","../src/template/templates/formatting/lists.js","../src/template/templates/formatting/misc.js","../src/template/templates/formatting/index.js","../src/template/templates/geo/dms-format.js","../src/template/templates/geo/coor.js","../src/template/templates/geo/index.js","../src/template/templates/wikipedia/links.js","../src/template/templates/wikipedia/page.js","../src/template/templates/wikipedia/table-cell.js","../src/template/templates/wikipedia/index.js","../src/template/templates/brackets.js","../src/template/templates/currency.js","../src/template/templates/elections.js","../src/_data/flags.js","../src/template/templates/flags.js","../src/template/templates/ipa.js","../src/template/templates/languages.js","../src/template/templates/math.js","../src/template/templates/misc.js","../src/template/templates/punctuation.js","../src/template/templates/science.js","../src/template/templates/soccer.js","../src/template/templates/sports.js","../src/template/templates/stock-exchanges.js","../src/template/templates/weather.js","../src/template/templates/websites.js","../src/template/templates/wiktionary.js","../src/template/templates/index.js","../src/template/parse.js","../src/template/Template.js","../src/template/index.js","../src/02-section/start-to-end/gallery.js","../src/02-section/start-to-end/election.js","../src/02-section/start-to-end/nba.js","../src/02-section/start-to-end/mlb.js","../src/02-section/start-to-end/mma.js","../src/02-section/start-to-end/math.js","../src/02-section/start-to-end/index.js","../src/02-section/index.js","../src/01-document/categories.js","../src/01-document/index.js","../src/_fetch/03-parseDoc.js","../src/_fetch/http/client.js","../src/_fetch/_headers.js","../src/_fetch/index.js","../src/_fetch/random.js","../src/_fetch/category.js","../src/_version.js","../src/index.js"],"sourcesContent":["const parseUrl = function(url) {\n let parsed = new URL(url) //eslint-disable-line\n let title = parsed.pathname.replace(/^\\/(wiki\\/)?/, '')\n title = decodeURIComponent(title)\n return {\n domain: parsed.host,\n title: title\n }\n}\nmodule.exports = parseUrl\n","const isInterWiki = /(wiktionary|wikinews|wikibooks|wikiquote|wikisource|wikispecies|wikiversity|wikivoyage|wikipedia|wikimedia|foundation|meta)\\.org/\n\nconst defaults = {\n action: 'query',\n prop: 'revisions', //we use the 'revisions' api here, instead of the Raw api, for its CORS-rules..\n rvprop: 'content',\n maxlag: 5,\n rvslots: 'main',\n origin: '*',\n format: 'json',\n redirects: 'true'\n}\n\nconst toQueryString = function(obj) {\n return Object.entries(obj)\n .map(([key, value]) => {\n return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`\n })\n .join('&')\n}\n\nconst isArray = function(arr) {\n return Object.prototype.toString.call(arr) === '[object Array]'\n}\n\nconst cleanTitle = page => {\n page = page.replace(/ /g, '_')\n page = page.trim()\n // page = encodeURIComponent(page)\n return page\n}\n\nconst makeUrl = function(options) {\n let params = Object.assign({}, defaults)\n // default url\n let url = `https://${options.lang}.${options.wiki}.org/w/api.php?`\n // from a 3rd party wiki\n options.domain = options.domain || options.wikiUrl //support old syntax\n if (options.domain) {\n let path = options.path\n //wikimedia api uses ./w/api path. no others do\n if (isInterWiki.test(options.domain)) {\n path = 'w/api.php'\n }\n url = `https://${options.domain}/${path}?`\n }\n if (!options.follow_redirects) {\n delete params.redirects\n }\n // support numerical ids\n let page = options.title\n if (typeof page === 'number') {\n params.pageids = page //single pageId\n } else if (isArray(page) && typeof page[0] === 'number') {\n params.pageids = page.join('|') //pageid array\n } else if (isArray(page) === true) {\n //support array\n params.titles = page.map(cleanTitle).join('|')\n } else {\n // single page\n params.titles = cleanTitle(page)\n }\n // make it!\n url += toQueryString(params)\n return url\n}\nmodule.exports = makeUrl\n","//this data-format from mediawiki api is nutso\nconst getResult = function(data, options) {\n options = options || {}\n let pages = Object.keys(data.query.pages)\n let docs = pages.map(id => {\n let page = data.query.pages[id] || {}\n if (page.hasOwnProperty('missing') || page.hasOwnProperty('invalid')) {\n return null\n }\n let text = page.revisions[0]['*']\n // console.log(page.revisions[0])\n //us the 'generator' result format, for the random() method\n if (!text && page.revisions[0].slots) {\n text = page.revisions[0].slots.main['*']\n }\n let meta = Object.assign({}, options, {\n title: page.title,\n pageID: page.pageid,\n namespace: page.ns\n })\n try {\n return { wiki: text, meta: meta }\n } catch (e) {\n console.error(e)\n throw e\n }\n })\n return docs\n}\nmodule.exports = getResult\n","//helper for looping around all sections of a document\nconst sectionMap = function(doc, fn, clue) {\n let arr = []\n doc.sections().forEach(sec => {\n let list = []\n if (typeof clue === 'string') {\n list = sec[fn](clue)\n } else {\n list = sec[fn]()\n }\n list.forEach(t => {\n arr.push(t)\n })\n })\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n}\nmodule.exports = sectionMap\n","//\nconst setDefaults = function(options, defaults) {\n return Object.assign({}, defaults, options)\n}\nmodule.exports = setDefaults\n","const setDefaults = require('../_lib/setDefaults')\nconst defaults = {\n title: true,\n sections: true,\n pageID: true,\n categories: true\n}\n\n//an opinionated output of the most-wanted data\nconst toJSON = function(doc, options) {\n options = setDefaults(options, defaults)\n let data = {}\n if (options.title) {\n data.title = doc.title()\n }\n if (options.pageID) {\n data.pageID = doc.pageID()\n }\n if (options.categories) {\n data.categories = doc.categories()\n }\n if (options.sections) {\n data.sections = doc.sections().map(i => i.json(options))\n }\n if (doc.isRedirect() === true) {\n data.isRedirect = true\n data.redirectTo = doc.data.redirectTo\n data.sections = []\n }\n\n //these are default-off\n if (options.coordinates) {\n data.coordinates = doc.coordinates()\n }\n if (options.infoboxes) {\n data.infoboxes = doc.infoboxes().map(i => i.json(options))\n }\n if (options.images) {\n data.images = doc.images().map(i => i.json(options))\n }\n if (options.plaintext) {\n data.plaintext = doc.text(options)\n }\n if (options.citations || options.references) {\n data.references = doc.references()\n }\n return data\n}\nmodule.exports = toJSON\n","module.exports = [\n 'dab', //en\n 'disamb', //en\n 'disambig', //en\n 'disambiguation', //en\n\n 'aðgreining', //is\n 'aimai', //ja\n 'ałtsʼáʼáztiin', //nv\n 'anlam ayrımı', //gag\n 'anlam ayrımı', //tr\n 'apartigilo', //eo\n 'argipen', //eu\n 'begriepskloorenge', //stq\n 'begriffsklärung', //als\n 'begriffsklärung', //de\n 'begriffsklärung', //pdc\n 'begriffsklearung', //bar\n 'bisongidila', //kg\n 'bkl', //pfl\n 'bokokani', //ln\n 'caddayn', //so\n 'clerheans', //kw\n 'cudakirin', //ku\n 'čvor', //bs\n 'db', //vls\n 'desambig', //nov\n 'desambigación', //an\n 'desambiguação', //pt\n 'desambiguació', //ca\n 'desambiguación', //es\n 'desambiguáncia', //ext\n 'desambiguasion', //lad\n 'desambiguassiù', //lmo\n 'desambigui', //lfn\n 'dezambiguizare', //ro\n 'dəqiqləşdirmə', //az\n 'disambigua', //it\n 'disambigua', //lij\n 'disambigua', //nap\n 'disambìgua', //sc\n 'disambigua', //scn\n 'disambiguasi', //id\n 'disambiguasi', //su\n 'discretiva', //la\n 'disheñvelout', //br\n 'disingkek', //min\n 'dixanbigua', //vec\n 'dixebra', //ast\n 'diżambigwazzjoni', //mt\n 'doorverwijspagina', //nl\n 'dp', //nl\n 'dp', //zea\n 'dubbelsinnig', //af\n 'dudalipen', //rmy\n 'dv', //nds_nl\n 'egyért', //hu\n 'fleiri týdningar', //fo\n 'fleirtyding', //nn\n 'flertydig', //da\n 'förgrening', //sv\n 'gì-ngiê', //cdo\n 'giklaro', //ceb\n 'gwahaniaethu', //cy\n 'homonimo', //io\n 'homónimos', //gl\n 'homonymie', //fr\n 'huaʻōlelo puana like', //haw\n 'idirdhealú', //ga\n 'khu-pia̍t', //zh_min_nan\n 'kthjellim', //sq\n 'kujekesa', //sn\n 'maana', //sw\n 'maneo bin', //diq\n 'mehrdüdig begreep', //nds\n 'menm non', //ht\n 'muardüüdag artiikel', //frr\n 'neibetsjuttings', //fy\n 'nozīmju atdalīšana', //lv\n 'nuorodinis', //lt\n 'nyahkekaburan', //ms\n 'omonimeye', //wa\n 'omonimia', //oc\n 'page dé frouque', //nrm\n 'paglilinaw', //tl\n 'panangilawlawag', //ilo\n 'pansayod', //war\n 'pejy mitovy anarana', //mg\n 'peker', //no\n 'razdvojba', //hr\n 'razločitev', //sl\n 'razvrstavanje', //sh\n 'reddaghey', //gv\n 'rozcestník', //cs\n 'rozlišovacia stránka', //sk\n 'sclerir noziun', //rm\n 'selvendyssivu', //olo\n 'soilleireachadh', //gd\n 'suzmunski', //jbo\n 'täpsustuslehekülg', //et\n 'täsmennyssivu', //fi\n 'telplänov', //vo\n 'tlahtolmelahuacatlaliztli', //nah\n 'trang định hướng', //vi\n 'ujednoznacznienie', //pl\n 'verdudeliking', //li\n 'wěcejwóznamowosć', //dsb\n 'wjacezmyslnosć', //hsb\n 'zambiguaçon', //mwl\n 'zeimeibu škiršona', //ltg\n 'αποσαφήνιση', //el\n 'айрық', //kk\n 'аҵакырацәа', //ab\n 'вишезначна одредница', //sr\n 'ибҳомзудоӣ', //tg\n 'кёб магъаналы', //krc\n 'күп мәгънәләр', //tt\n 'күп мәғәнәлелек', //ba\n 'мъногосъмꙑслиѥ', //cu\n 'неадназначнасць', //be\n 'неадназначнасьць', //be_x_old\n 'неоднозначность', //ru\n 'олон удхатай', //bxr\n 'појаснување', //mk\n 'пояснение', //bg\n 'са шумуд манавал', //lez\n 'салаа утгатай', //mn\n 'суолталар', //sah\n 'текмаанисиздик', //ky\n 'цо магіна гуреб', //av\n 'чеперушка', //rue\n 'чолхалла', //ce\n 'шуко ончыктымаш-влак', //mhr\n 'მრავალმნიშვნელოვანი', //ka\n 'բազմիմաստութիւն', //hyw\n 'բազմիմաստություն', //hy\n 'באדייטן', //yi\n 'פירושונים', //he\n 'ابهام‌زدایی', //fa\n 'توضيح', //ar\n 'توضيح', //arz\n 'دقیقلشدیرمه', //azb\n 'ڕوونکردنەوە', //ckb\n 'سلجهائپ', //sd\n 'ضد ابہام', //ur\n 'گجگجی بیری', //mzn\n 'نامبهمېدنه', //ps\n 'መንታ', //am\n 'अस्पष्टता', //ne\n 'बहुअर्थी', //bh\n 'बहुविकल्पी शब्द', //hi\n 'দ্ব্যর্থতা নিরসন', //bn\n 'ਗੁੰਝਲ-ਖੋਲ੍ਹ', //pa\n 'સંદિગ્ધ શીર્ષક', //gu\n 'பக்கவழி நெறிப்படுத்தல்', //ta\n 'అయోమయ నివృత్తి', //te\n 'ದ್ವಂದ್ವ ನಿವಾರಣೆ', //kn\n 'വിവക്ഷകൾ', //ml\n 'වක්‍රෝත්ති', //si\n 'แก้ความกำกวม', //th\n 'သံတူကြောင်းကွဲ', //my\n 'ណែនាំ', //km\n '동음이의', //ko\n '扤清楚', //gan\n '搞清楚', //zh_yue\n '曖昧さ回避', //ja\n '消歧义', //zh\n '釋義', //zh_classical\n \"gestion dj'omònim\", //pms\n \"sut'ichana qillqa\" //qu\n // 'z', //vep\n // 'သဵင်မိူၼ် တူၼ်ႈထႅဝ်ပႅၵ်ႇ', //shn\n]\n","const i18n = require('../_data/disambig').reduce((h, str) => {\n h[str] = true\n return h\n}, {})\n\n//special disambig-templates en-wikipedia uses\nlet d = ' disambiguation'\nconst english = [\n 'dab',\n 'dab',\n 'disamb',\n 'disambig',\n 'geodis',\n 'hndis',\n 'setindex',\n 'ship index',\n 'split dab',\n 'sport index',\n 'wp disambig',\n 'disambiguation cleanup',\n 'airport' + d,\n 'biology' + d,\n 'call sign' + d,\n 'caselaw' + d,\n 'chinese title' + d,\n 'genus' + d,\n 'hospital' + d,\n 'lake index',\n 'letter' + d,\n 'letter-number combination' + d,\n 'mathematical' + d,\n 'military unit' + d,\n 'mountainindex',\n 'number' + d,\n 'phonetics' + d,\n 'place name' + d,\n 'portal' + d,\n 'road' + d,\n 'school' + d,\n 'species latin name abbreviation' + d,\n 'species latin name' + d,\n 'station' + d,\n 'synagogue' + d,\n 'taxonomic authority' + d,\n 'taxonomy' + d\n].reduce((h, str) => {\n h[str] = true\n return h\n}, {})\n\nconst isDisambig = function(doc) {\n let templates = doc.templates()\n let found = templates.find(obj => {\n return english.hasOwnProperty(obj.template) || i18n.hasOwnProperty(obj.template)\n })\n if (found) {\n return true\n }\n // try 'may refer to' on first line for en-wiki?\n let firstLine = doc.sentences(0).text()\n if (firstLine !== null && firstLine[0]) {\n if (/. may refer to ./i.test(firstLine) === true) {\n return true\n }\n }\n return false\n}\n\nmodule.exports = isDisambig\n","const setDefaults = require('../_lib/setDefaults')\n\nconst defaults = {\n caption: true,\n alt: true,\n links: true,\n thumb: true,\n url: true\n}\n//\nconst toJson = function(img, options) {\n options = setDefaults(options, defaults)\n let json = {\n file: img.file()\n }\n if (options.thumb !== false) {\n json.thumb = img.thumbnail()\n }\n if (options.url !== false) {\n json.url = img.url()\n }\n //add captions\n if (options.caption !== false && img.data.caption) {\n json.caption = img.caption()\n if (options.links !== false && img.data.caption.links()) {\n json.links = img.links()\n }\n }\n if (options.alt !== false && img.data.alt) {\n json.alt = img.alt()\n }\n return json\n}\nmodule.exports = toJson\n","const toJson = require('./toJson')\nconst server = 'https://wikipedia.org/wiki/Special:Redirect/file/'\n\nconst encodeTitle = function(file) {\n let title = file.replace(/^(image|file?)\\:/i, '')\n //titlecase it\n title = title.charAt(0).toUpperCase() + title.substring(1)\n //spaces to underscores\n title = title.trim().replace(/ /g, '_')\n return title\n}\n\n//the wikimedia image url is a little silly:\nconst makeSrc = function(file) {\n let title = encodeTitle(file)\n title = encodeURIComponent(title)\n return title\n}\n\n//the class for our image generation functions\nconst Image = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n file() {\n return this.data.file || ''\n },\n alt() {\n let str = this.data.alt || this.data.file || ''\n str = str.replace(/^(file|image):/i, '')\n str = str.replace(/\\.(jpg|jpeg|png|gif|svg)/i, '')\n return str.replace(/_/g, ' ')\n },\n caption() {\n if (this.data.caption) {\n return this.data.caption.text()\n }\n return ''\n },\n links() {\n if (this.data.caption) {\n return this.data.caption.links()\n }\n return []\n },\n url() {\n return server + makeSrc(this.file())\n },\n thumbnail(size) {\n size = size || 300\n let path = makeSrc(this.file())\n return server + path + '?width=' + size\n },\n format() {\n let arr = this.file().split('.')\n if (arr[arr.length - 1]) {\n return arr[arr.length - 1].toLowerCase()\n }\n return null\n },\n json: function(options) {\n options = options || {}\n return toJson(this, options)\n },\n text: function() {\n return ''\n }\n}\n\nObject.keys(methods).forEach(k => {\n Image.prototype[k] = methods[k]\n})\n\nImage.prototype.src = Image.prototype.url\nImage.prototype.thumb = Image.prototype.thumbnail\nmodule.exports = Image\n","const sectionMap = require('./_sectionMap')\nconst toJSON = require('./toJson')\nconst disambig = require('./disambig')\nconst setDefaults = require('../_lib/setDefaults')\nconst Image = require('../image/Image')\n\nconst defaults = {\n tables: true,\n lists: true,\n paragraphs: true\n}\n\n//\nconst Document = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n title: function(str) {\n //use like a setter\n if (str !== undefined) {\n this.data.title = str\n return str\n }\n //if we have it already\n if (this.data.title) {\n return this.data.title\n }\n //guess the title of this page from first sentence bolding\n let guess = null\n let sen = this.sentences(0)\n if (sen) {\n guess = sen.bolds(0)\n }\n return guess\n },\n pageID: function(id) {\n if (id !== undefined) {\n this.data.pageID = id\n }\n return this.data.pageID\n },\n language: function(lang) {\n if (lang !== undefined) {\n this.data.lang = lang\n }\n return this.data.lang\n },\n url: function() {\n let title = this.title()\n if (!title) {\n return null\n }\n let lang = this.language() || 'en'\n let domain = this.data.domain || 'wikipedia.org'\n // replace blank to underscore\n title = title.replace(/ /g, '_')\n title = encodeURIComponent(title)\n return `https://${lang}.${domain}.org/wiki/${title}`\n },\n namespace: function(ns) {\n if (ns !== undefined) {\n this.data.namespace = ns\n }\n return this.data.namespace\n },\n isRedirect: function() {\n return this.data.type === 'redirect'\n },\n redirectTo: function() {\n return this.data.redirectTo\n },\n isDisambiguation: function() {\n return disambig(this)\n },\n categories: function(clue) {\n if (typeof clue === 'number') {\n return this.data.categories[clue]\n }\n return this.data.categories || []\n },\n sections: function(clue) {\n let arr = this.data.sections || []\n arr.forEach(sec => (sec.doc = this))\n //grab a specific section, by its title\n if (typeof clue === 'string') {\n let str = clue.toLowerCase().trim()\n return arr.find(s => {\n return s.title().toLowerCase() === str\n })\n }\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n paragraphs: function(n) {\n let arr = []\n this.data.sections.forEach(s => {\n arr = arr.concat(s.paragraphs())\n })\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n paragraph: function(n) {\n let arr = this.paragraphs() || []\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr[0]\n },\n sentences: function(n) {\n let arr = []\n this.sections().forEach(sec => {\n arr = arr.concat(sec.sentences())\n })\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n sentence: function() {\n return this.sentences(0)\n },\n images: function(clue) {\n let arr = sectionMap(this, 'images', null)\n //grab image from infobox, first\n this.infoboxes().forEach(info => {\n let img = info.image()\n if (img) {\n arr.unshift(img) //put it at the top\n }\n })\n //look for 'gallery' templates, too\n this.templates().forEach(obj => {\n if (obj.template === 'gallery') {\n obj.images = obj.images || []\n obj.images.forEach(img => {\n if (img instanceof Image === false) {\n img = new Image(img)\n }\n arr.push(img)\n })\n }\n })\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n image: function() {\n return this.images(0)\n },\n links: function(clue) {\n return sectionMap(this, 'links', clue)\n },\n interwiki: function(clue) {\n return sectionMap(this, 'interwiki', clue)\n },\n lists: function(clue) {\n return sectionMap(this, 'lists', clue)\n },\n tables: function(clue) {\n return sectionMap(this, 'tables', clue)\n },\n templates: function(clue) {\n return sectionMap(this, 'templates', clue)\n },\n references: function(clue) {\n return sectionMap(this, 'references', clue)\n },\n coordinates: function(clue) {\n return sectionMap(this, 'coordinates', clue)\n },\n infoboxes: function(clue) {\n let arr = sectionMap(this, 'infoboxes')\n //sort them by biggest-first\n arr = arr.sort((a, b) => {\n if (Object.keys(a.data).length > Object.keys(b.data).length) {\n return -1\n }\n return 1\n })\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n text: function(options) {\n options = setDefaults(options, defaults)\n //nah, skip these.\n if (this.isRedirect() === true) {\n return ''\n }\n let arr = this.sections().map(sec => sec.text(options))\n return arr.join('\\n\\n')\n },\n json: function(options) {\n options = setDefaults(options, defaults)\n return toJSON(this, options)\n },\n debug: function() {\n console.log('\\n')\n this.sections().forEach(sec => {\n let indent = ' - '\n for (let i = 0; i < sec.depth; i += 1) {\n indent = ' -' + indent\n }\n console.log(indent + (sec.title() || '(Intro)'))\n })\n return this\n }\n}\n\nconst isArray = function(arr) {\n return Object.prototype.toString.call(arr) === '[object Array]'\n}\n//add singular-methods, too\nlet plurals = [\n 'sections',\n 'infoboxes',\n 'sentences',\n 'citations',\n 'references',\n 'coordinates',\n 'tables',\n 'lists',\n 'links',\n 'images',\n 'templates',\n 'categories'\n]\nplurals.forEach(fn => {\n let sing = fn.replace(/ies$/, 'y')\n sing = sing.replace(/oxes$/, 'ox')\n sing = sing.replace(/s$/, '')\n methods[sing] = function(n) {\n n = n || 0\n let res = this[fn](n)\n if (isArray(res)) {\n return res[0]\n }\n return res\n }\n})\n\nObject.keys(methods).forEach(k => {\n Document.prototype[k] = methods[k]\n})\n\n//alias these ones\nDocument.prototype.lang = Document.prototype.language\nDocument.prototype.ns = Document.prototype.namespace\nDocument.prototype.plaintext = Document.prototype.text\nDocument.prototype.isDisambig = Document.prototype.isDisambiguation\nDocument.prototype.citations = Document.prototype.references\nDocument.prototype.redirectsTo = Document.prototype.redirectTo\nDocument.prototype.redirect = Document.prototype.redirectTo\nDocument.prototype.redirects = Document.prototype.redirectTo\n\nmodule.exports = Document\n","module.exports = [\n 'category', //en\n\n 'abdeeling', //\tpdc\n 'bólkur', //\tfo\n 'catagóir', //\tga\n 'categori', //\tcy\n 'categoria',\n 'categoria', //\tco\n 'categoría', //\tes\n 'categorîa', //\tlij\n 'categorìa', //\tpms\n 'catégorie',\n 'categorie',\n 'catègorie', //\tfrp\n 'category',\n 'categuria', //\tlmo\n 'catigurìa', //\tscn\n 'class', //\tkw\n 'ẹ̀ka', //\tyo\n 'flocc',\n 'flocc', //\tang\n 'flokkur',\n 'grup', //\ttpi\n 'jamii', //\tsw\n 'kaarangay', //\twar\n 'kateggoría', //\tlad\n 'kategooria', //\tet\n 'kategori', //\tda\n 'kategorî', //\tku\n 'kategoria', //\teu\n 'kategória', //\thu\n 'kategorie', //de\n 'kategoriija', //\tse\n 'kategorija', //\tsl\n 'kategorio', //\teo\n 'kategoriya',\n 'kategoriýa', //\ttk\n 'kategoriye', //\tdiq\n 'kategory', //\tfy\n 'kategorya', //\ttl\n 'kateqoriya', //\taz\n 'katiguriya', //\tqu\n 'klad', //\tvo\n 'luokka',\n 'ñemohenda', //\tgn\n 'roinn', //-seòrsa\tgd\n 'ronney', //\tgv\n 'rummad', //\tbr\n 'setensele', //\tnso\n 'sokajy', //\tmg\n 'sumut', // atassuseq\tkl\n 'thể', // loại\tvi\n 'turkum', //\tuz\n 'категорија',\n 'категория', //\tru\n 'категорія', //\tuk\n 'катэгорыя',\n 'төркем', //\ttt\n 'קטגוריה', //\the\n 'تصنيف',\n 'تۈر', //\tug\n 'رده',\n 'श्रेणी',\n 'श्रेणी', //\thi\n 'বিষয়শ্রেণী', //\tbn\n 'หมวดหมู่', //\tth\n '분류', //\tko\n '분류', //ko\n '分类' //\tza\n //--\n]\n","module.exports = [\n 'file', //en\n 'image', //en\n 'चित्र', //img\n\n 'archivo', //es\n 'attēls', //lv\n 'berkas', //id\n 'bestand', //nl\n 'datei', //de\n 'dosiero', //eo\n 'dosya', //lad\n 'fájl', //hu\n 'fasciculus', //la\n 'fichier', //fr\n 'fil', //da\n 'fitxategi', //eu\n 'fitxer', //ca\n 'gambar', //su\n 'imagem', //pt\n 'imej', //ms\n 'immagine', //it\n 'larawan', //tl\n 'lêer', //af\n 'plik', //pl\n 'restr', //br\n 'slika', //bs\n 'wêne', //ku\n 'wobraz', //dsb\n 'выява', //be\n 'податотека', //mk\n 'слика', //sr\n 'файл', //ru\n 'სურათი', //ka\n 'պատկեր', //hy\n 'קובץ', //he\n 'پرونده', //fa\n 'دوتنه', //ps\n 'ملف', //ar\n 'وێنە', //ckb\n 'चित्र', //hi\n 'ไฟล์', //th\n '파일', //ko\n 'ファイル' //ja\n]\n","module.exports = [\n 'infobox', //en\n\n 'anfo', //mwl\n 'anuāmapa', //haw\n 'bilgi kutusu', //tr\n 'bilgi', //tr\n 'bilgiquti', //uz\n 'boaty', //mg\n 'boestkelaouiñ', //br\n 'bosca', //ga\n 'capsa', //la\n 'diehtokássa', //se\n 'faktamall', //sv\n 'ficha', //es\n 'generalni', //hr\n 'gwybodlen3', //cy\n 'info', //pt\n 'infobokis', //tpi\n 'infoboks', //da\n 'infochascha', //rm\n 'infokašćik', //dsb\n 'infokast', //et\n 'infokutija', //bs\n 'infolentelė', //lt\n 'infopolje', //sl\n 'informkesto', //eo\n 'infoskreine', //ltg\n 'infotaula', //eu\n 'inligtingskas',\n 'inligtingskas3', //af\n 'inligtingskas4', //af\n 'kishtey', //gv\n 'kotak', //su\n 'tertcita', //jbo\n 'tietolaatikko', //fi\n 'yerleşim bilgi kutusu',\n 'ynfoboks', //fy\n 'πλαίσιο', //el\n 'акарточка', //ab\n 'аҥа', //mhr\n 'инфобокс', //kk\n 'инфокутија', //sr\n 'инфокутия', //bg\n 'інфобокс', //rue\n 'канадский',\n 'картка', //be\n 'карточка', //ru\n 'карточка2', //mdf\n 'карточкарус', //ba\n 'картуш', //koi\n 'қуттӣ', //tg\n 'ინფოდაფა', //ka\n 'տեղեկաքարտ', //hy\n 'אינפאקעסטל', //yi\n 'תבנית', //he\n 'بطاقة', //ar\n 'ڄاڻخانو', //sd\n 'خانہ', //ur\n 'لغة',\n 'ज्ञानसन्दूक', //hi\n 'তথ্যছক', //bn\n 'ਜਾਣਕਾਰੀਡੱਬਾ', //pa\n 'సమాచారపెట్టె', //te\n 'තොරතුරුකොටුව', //si\n 'กล่องข้อมูล', //th\n 'ប្រអប់ព័ត៌មាន', //km\n '정보상자', //ko\n '明細' //zh_yue\n]\n","module.exports = [\n 'adkas', //br\n 'aýdaw',\n 'doorverwijzing',\n 'ohjaus',\n 'patrz', //pl\n 'přesměruj',\n 'redirección',\n 'redireccion',\n 'redirección', //es\n 'redirecionamento', //pt\n 'redirect', //en\n 'redirection',\n 'redirection', //fr\n 'rinvia', //it\n 'tilvísun',\n 'uudelleenohjaus',\n 'weiterleitung',\n 'weiterleitung', //de\n 'yönlendi̇r',\n 'yönlendirme',\n 'yönlendi̇rme', //tr\n 'ανακατευθυνση', //el\n 'айдау',\n 'перанакіраваньне',\n 'перенаправлення', //uk\n 'пренасочување', //mk\n 'преусмери',\n 'преусмјери',\n 'تغییر_مسیر',\n 'تغییرمسیر',\n 'تغییرمسیر', //fa\n 'เปลี่ยนทาง', //th\n 'ប្តូរទីតាំងទៅ', //km\n '転送', //ja\n '重定向'\n]\n","module.exports = [\n 'references',\n 'reference',\n 'einzelnachweise',\n 'referencias',\n 'références',\n 'notes et références',\n '脚注',\n 'referenser',\n 'bronnen',\n 'примечания'\n]\n","// wikipedia special terms lifted and augmented from parsoid parser april 2015\n// and then manually on March 2020\nmodule.exports = {\n categories: require('./categories'),\n disambig: require('./disambig'),\n images: require('./images'),\n infoboxes: require('./infoboxes'),\n redirects: require('./redirects'),\n references: require('./references')\n\n // specials: [\n // 'спэцыяльныя',\n // 'especial',\n // 'speciální',\n // 'spezial',\n // 'special',\n // 'ویژه',\n // 'toiminnot',\n // 'kerfissíða',\n // 'arnawlı',\n // 'spécial',\n // 'speciaal',\n // 'посебно',\n // 'özel',\n // '特別'\n // ],\n // users: [\n // 'удзельнік',\n // 'usuari',\n // 'uživatel',\n // 'benutzer',\n // 'user',\n // 'usuario',\n // 'کاربر',\n // 'käyttäjä',\n // 'notandi',\n // 'paydalanıwshı',\n // 'utilisateur',\n // 'gebruiker',\n // 'корисник',\n // 'kullanıcı',\n // '利用者'\n // ],\n // sources: [\n // //blacklist these headings, as they're not plain-text\n // 'references',\n // 'see also',\n // 'external links',\n // 'further reading',\n // 'notes et références',\n // 'voir aussi',\n // 'liens externes',\n // '参考文献', //references (ja)\n // '脚注', //citations (ja)\n // '関連項目', //see also (ja)\n // '外部リンク' //external links (ja)\n // ]\n}\n","module.exports = {\n aa: 'Afar', //Afar\n ab: 'Аҧсуа', //Abkhazian\n af: 'Afrikaans', //Afrikaans\n ak: 'Akana', //Akan\n als: 'Alemannisch', //Alemannic\n am: 'አማርኛ', //Amharic\n an: 'Aragonés', //Aragonese\n ang: 'Englisc', //Anglo-Saxon\n ar: 'العربية', //Arabic\n arc: 'ܣܘܪܬ', //Aramaic\n as: 'অসমীয়া', //Assamese\n ast: 'Asturianu', //Asturian\n av: 'Авар', //Avar\n ay: 'Aymar', //Aymara\n az: 'Azərbaycanca', //Azerbaijani\n ba: 'Башҡорт', //Bashkir\n bar: 'Boarisch', //Bavarian\n 'bat-smg': 'Žemaitėška', //Samogitian\n bcl: 'Bikol', //Bikol\n be: 'Беларуская', //Belarusian\n 'be-x-old': 'ltr', //Belarusian\n bg: 'Български', //Bulgarian\n bh: 'भोजपुरी', //Bihari\n bi: 'Bislama', //Bislama\n bm: 'Bamanankan', //Bambara\n bn: 'বাংলা', //Bengali\n bo: 'བོད་ཡིག', //Tibetan\n bpy: 'ltr', //Bishnupriya\n br: 'Brezhoneg', //Breton\n bs: 'Bosanski', //Bosnian\n bug: 'ᨅᨔ', //Buginese\n bxr: 'ltr', //Buriat\n ca: 'Català', //Catalan\n cdo: 'Chinese', //Min\n ce: 'Нохчийн', //Chechen\n ceb: 'Sinugboanong', //Cebuano\n ch: 'Chamoru', //Chamorro\n cho: 'Choctaw', //Choctaw\n chr: 'ᏣᎳᎩ', //Cherokee\n chy: 'Tsetsêhestâhese', //Cheyenne\n co: 'Corsu', //Corsican\n cr: 'Nehiyaw', //Cree\n cs: 'Česky', //Czech\n csb: 'Kaszëbsczi', //Kashubian\n cu: 'Slavonic', //Old\n cv: 'Чăваш', //Chuvash\n cy: 'Cymraeg', //Welsh\n da: 'Dansk', //Danish\n de: 'Deutsch', //German\n diq: 'Zazaki', //Dimli\n dsb: 'ltr', //Lower\n dv: 'ދިވެހިބަސް', //Divehi\n dz: 'ཇོང་ཁ', //Dzongkha\n ee: 'Ɛʋɛ', //Ewe\n far: 'فارسی', //Farsi\n el: 'Ελληνικά', //Greek\n en: 'English', //English\n eo: 'Esperanto', //Esperanto\n es: 'Español', //Spanish\n et: 'Eesti', //Estonian\n eu: 'Euskara', //Basque\n ext: 'Estremeñu', //Extremaduran\n ff: 'Fulfulde', //Peul\n fi: 'Suomi', //Finnish\n 'fiu-vro': 'Võro', //Võro\n fj: 'Na', //Fijian\n fo: 'Føroyskt', //Faroese\n fr: 'Français', //French\n frp: 'Arpitan', //Arpitan\n fur: 'Furlan', //Friulian\n fy: 'ltr', //West\n ga: 'Gaeilge', //Irish\n gan: 'ltr', //Gan\n gd: 'ltr', //Scottish\n gil: 'Taetae', //Gilbertese\n gl: 'Galego', //Galician\n gn: \"Avañe'ẽ\", //Guarani\n got: 'gutisk', //Gothic\n gu: 'ગુજરાતી', //Gujarati\n gv: 'Gaelg', //Manx\n ha: 'هَوُسَ', //Hausa\n hak: 'ltr', //Hakka\n haw: 'Hawai`i', //Hawaiian\n he: 'עברית', //Hebrew\n hi: 'हिन्दी', //Hindi\n ho: 'ltr', //Hiri\n hr: 'Hrvatski', //Croatian\n ht: 'Krèyol', //Haitian\n hu: 'Magyar', //Hungarian\n hy: 'Հայերեն', //Armenian\n hz: 'Otsiherero', //Herero\n ia: 'Interlingua', //Interlingua\n id: 'Bahasa', //Indonesian\n ie: 'Interlingue', //Interlingue\n ig: 'Igbo', //Igbo\n ii: 'ltr', //Sichuan\n ik: 'Iñupiak', //Inupiak\n ilo: 'Ilokano', //Ilokano\n io: 'Ido', //Ido\n is: 'Íslenska', //Icelandic\n it: 'Italiano', //Italian\n iu: 'ᐃᓄᒃᑎᑐᑦ', //Inuktitut\n ja: '日本語', //Japanese\n jbo: 'Lojban', //Lojban\n jv: 'Basa', //Javanese\n ka: 'ქართული', //Georgian\n kg: 'KiKongo', //Kongo\n ki: 'Gĩkũyũ', //Kikuyu\n kj: 'Kuanyama', //Kuanyama\n kk: 'Қазақша', //Kazakh\n kl: 'Kalaallisut', //Greenlandic\n km: 'ភាសាខ្មែរ', //Cambodian\n kn: 'ಕನ್ನಡ', //Kannada\n khw: 'کھوار', //Khowar\n ko: '한국어', //Korean\n kr: 'Kanuri', //Kanuri\n ks: 'कश्मीरी', //Kashmiri\n ksh: 'Ripoarisch', //Ripuarian\n ku: 'Kurdî', //Kurdish\n kv: 'Коми', //Komi\n kw: 'Kernewek', //Cornish\n ky: 'Kırgızca', //Kirghiz\n la: 'Latina', //Latin\n lad: 'Dzhudezmo', //Ladino\n lan: 'Leb', //Lango\n lb: 'Lëtzebuergesch', //Luxembourgish\n lg: 'Luganda', //Ganda\n li: 'Limburgs', //Limburgian\n lij: 'Líguru', //Ligurian\n lmo: 'Lumbaart', //Lombard\n ln: 'Lingála', //Lingala\n lo: 'ລາວ', //Laotian\n lt: 'Lietuvių', //Lithuanian\n lv: 'Latviešu', //Latvian\n 'map-bms': 'Basa', //Banyumasan\n mg: 'Malagasy', //Malagasy\n man: '官話', //Mandarin\n mh: 'Kajin', //Marshallese\n mi: 'Māori', //Maori\n min: 'Minangkabau', //Minangkabau\n mk: 'Македонски', //Macedonian\n ml: 'മലയാളം', //Malayalam\n mn: 'Монгол', //Mongolian\n mo: 'Moldovenească', //Moldovan\n mr: 'मराठी', //Marathi\n ms: 'Bahasa', //Malay\n mt: 'bil-Malti', //Maltese\n mus: 'Muskogee', //Creek\n my: 'Myanmasa', //Burmese\n na: 'Dorerin', //Nauruan\n nah: 'Nahuatl', //Nahuatl\n nap: 'Nnapulitano', //Neapolitan\n nd: 'ltr', //North\n nds: 'Plattdüütsch', //Low German\n 'nds-nl': 'Saxon', //Dutch\n ne: 'नेपाली', //Nepali\n new: 'नेपालभाषा', //Newar\n ng: 'Oshiwambo', //Ndonga\n nl: 'Nederlands', //Dutch\n nn: 'ltr', //Norwegian\n no: 'Norsk', //Norwegian\n nr: 'ltr', //South\n nso: 'ltr', //Northern\n nrm: 'Nouormand', //Norman\n nv: 'Diné', //Navajo\n ny: 'Chi-Chewa', //Chichewa\n oc: 'Occitan', //Occitan\n oj: 'ᐊᓂᔑᓈᐯᒧᐎᓐ', //Ojibwa\n om: 'Oromoo', //Oromo\n or: 'ଓଡ଼ିଆ', //Oriya\n os: 'Иронау', //Ossetian\n pa: 'ਪੰਜਾਬੀ', //Panjabi\n pag: 'Pangasinan', //Pangasinan\n pam: 'Kapampangan', //Kapampangan\n pap: 'Papiamentu', //Papiamentu\n pdc: 'ltr', //Pennsylvania\n pi: 'Pāli', //Pali\n pih: 'Norfuk', //Norfolk\n pl: 'Polski', //Polish\n pms: 'Piemontèis', //Piedmontese\n ps: 'پښتو', //Pashto\n pt: 'Português', //Portuguese\n qu: 'Runa', //Quechua\n rm: 'ltr', //Raeto\n rmy: 'Romani', //Romani\n rn: 'Kirundi', //Kirundi\n ro: 'Română', //Romanian\n 'roa-rup': 'Armâneashti', //Aromanian\n ru: 'Русский', //Russian\n rw: 'Kinyarwandi', //Rwandi\n sa: 'संस्कृतम्', //Sanskrit\n sc: 'Sardu', //Sardinian\n scn: 'Sicilianu', //Sicilian\n sco: 'Scots', //Scots\n sd: 'सिनधि', //Sindhi\n se: 'ltr', //Northern\n sg: 'Sängö', //Sango\n sh: 'Srpskohrvatski', //Serbo-Croatian\n si: 'සිංහල', //Sinhalese\n simple: 'ltr', //Simple\n sk: 'Slovenčina', //Slovak\n sl: 'Slovenščina', //Slovenian\n sm: 'Gagana', //Samoan\n sn: 'chiShona', //Shona\n so: 'Soomaaliga', //Somalia\n sq: 'Shqip', //Albanian\n sr: 'Српски', //Serbian\n ss: 'SiSwati', //Swati\n st: 'ltr', //Southern\n su: 'Basa', //Sundanese\n sv: 'Svenska', //Swedish\n sw: 'Kiswahili', //Swahili\n ta: 'தமிழ்', //Tamil\n te: 'తెలుగు', //Telugu\n tet: 'Tetun', //Tetum\n tg: 'Тоҷикӣ', //Tajik\n th: 'ไทย', //Thai\n ti: 'ትግርኛ', //Tigrinya\n tk: 'Туркмен', //Turkmen\n tl: 'Tagalog', //Tagalog\n tlh: 'tlhIngan-Hol', //Klingon\n tn: 'Setswana', //Tswana\n to: 'Lea', //Tonga\n tpi: 'ltr', //Tok\n tr: 'Türkçe', //Turkish\n ts: 'Xitsonga', //Tsonga\n tt: 'Tatarça', //Tatar\n tum: 'chiTumbuka', //Tumbuka\n tw: 'Twi', //Twi\n ty: 'Reo', //Tahitian\n udm: 'Удмурт', //Udmurt\n ug: 'Uyƣurqə', //Uyghur\n uk: 'Українська', //Ukrainian\n ur: 'اردو', //Urdu\n uz: 'Ўзбек', //Uzbek\n ve: 'Tshivenḓa', //Venda\n vi: 'Việtnam', //Vietnamese\n vec: 'Vèneto', //Venetian\n vls: 'ltr', //West\n vo: 'Volapük', //Volapük\n wa: 'Walon', //Walloon\n war: 'Winaray', //Waray-Waray\n wo: 'Wollof', //Wolof\n xal: 'Хальмг', //Kalmyk\n xh: 'isiXhosa', //Xhosa\n yi: 'ייִדיש', //Yiddish\n yo: 'Yorùbá', //Yoruba\n za: 'Cuengh', //Zhuang\n zh: '中文', //Chinese\n 'zh-classical': 'ltr', //Classical\n 'zh-min-nan': 'Bân-lâm-gú', //Minnan\n 'zh-yue': '粵語', //Cantonese\n zu: 'isiZulu' //Zulu\n}\n","const wp = '.wikipedia.org/wiki/$1'\nconst wm = '.wikimedia.org/wiki/$1'\nconst w = 'www.'\n\nmodule.exports = {\n acronym: w + 'acronymfinder.com/$1.html',\n advisory: 'advisory' + wm,\n advogato: w + 'advogato.org/$1',\n aew: 'wiki.arabeyes.org/$1',\n appropedia: w + 'appropedia.org/$1',\n aquariumwiki: w + 'theaquariumwiki.com/$1',\n arborwiki: 'localwiki.org/ann-arbor/$1',\n arxiv: 'arxiv.org/abs/$1',\n atmwiki: w + 'otterstedt.de/wiki/index.php/$1',\n baden: w + 'stadtwiki-baden-baden.de/wiki/$1/',\n battlestarwiki: 'en.battlestarwiki.org/wiki/$1',\n bcnbio: 'historiapolitica.bcn.cl/resenas_parlamentarias/wiki/$1',\n beacha: w + 'beachapedia.org/$1',\n betawiki: 'translatewiki.net/wiki/$1',\n bibcode: 'adsabs.harvard.edu/abs/$1',\n bibliowiki: 'wikilivres.org/wiki/$1',\n bluwiki: 'bluwiki.com/go/$1',\n blw: 'britainloves' + wp,\n botwiki: 'botwiki.sno.cc/wiki/$1',\n boxrec: w + 'boxrec.com/media/index.php?$1',\n brickwiki: w + 'brickwiki.info/wiki/$1',\n bugzilla: 'bugzilla.wikimedia.org/show_bug.cgi?id=$1',\n bulba: 'bulbapedia.bulbagarden.net/wiki/$1',\n c: 'commons' + wm,\n c2: 'c2.com/cgi/wiki?$1',\n c2find: 'c2.com/cgi/wiki?FindPage&value=$1',\n cache: w + 'google.com/search?q=cache:$1',\n ĉej: 'esperanto.blahus.cz/cxej/vikio/index.php/$1',\n cellwiki: 'cell.wikia.com/wiki/$1',\n centralwikia: 'community.wikia.com/wiki/$1',\n chej: 'esperanto.blahus.cz/cxej/vikio/index.php/$1',\n choralwiki: w + 'cpdl.org/wiki/index.php/$1',\n citizendium: 'en.citizendium.org/wiki/$1',\n ckwiss: w + 'ck-wissen.de/ckwiki/index.php?title=$1',\n comixpedia: w + 'comixpedia.org/index.php?title=$1',\n commons: 'commons' + wm,\n communityscheme: 'community.schemewiki.org/?c=s&key=$1',\n communitywiki: 'communitywiki.org/$1',\n comune: 'rete.comuni-italiani.it/wiki/$1',\n creativecommons: 'creativecommons.org/licenses/$1',\n creativecommonswiki: 'wiki.creativecommons.org/$1',\n cxej: 'esperanto.blahus.cz/cxej/vikio/index.php/$1',\n dcc: w + 'dccwiki.com/$1',\n dcdatabase: 'dc.wikia.com/$1',\n dcma: 'christian-morgenstern.de/dcma/index.php?title=$1',\n debian: 'wiki.debian.org/$1',\n delicious: w + 'delicious.com/tag/$1',\n devmo: 'developer.mozilla.org/en/docs/$1',\n dictionary: w + 'dict.org/bin/Dict?Database=*&Form=Dict1&Strategy=*&Query=$1',\n dict: w + 'dict.org/bin/Dict?Database=*&Form=Dict1&Strategy=*&Query=$1',\n disinfopedia: 'sourcewatch.org/index.php/$1',\n distributedproofreaders: w + 'pgdp.net/wiki/$1',\n distributedproofreadersca: w + 'pgdpcanada.net/wiki/index.php/$1',\n dmoz: 'curlie.org/$1',\n dmozs: 'curlie.org/search?q=$1',\n doi: 'doi.org/$1',\n donate: 'donate' + wm,\n doom_wiki: 'doom.wikia.com/wiki/$1',\n download: 'releases.wikimedia.org/$1',\n dbdump: 'dumps.wikimedia.org/$1/latest/',\n dpd: 'lema.rae.es/dpd/?key=$1',\n drae: 'dle.rae.es/?w=$1',\n dreamhost: 'wiki.dreamhost.com/index.php/$1',\n drumcorpswiki: w + 'drumcorpswiki.com/index.php/$1',\n dwjwiki: w + 'suberic.net/cgi-bin/dwj/wiki.cgi?$1',\n eĉei: w + 'ikso.net/cgi-bin/wiki.pl?$1',\n ecoreality: w + 'EcoReality.org/wiki/$1',\n ecxei: w + 'ikso.net/cgi-bin/wiki.pl?$1',\n elibre: 'enciclopedia.us.es/index.php/$1',\n emacswiki: w + 'emacswiki.org/emacs?$1',\n encyc: 'encyc.org/wiki/$1',\n energiewiki: w + 'netzwerk-energieberater.de/wiki/index.php/$1',\n englyphwiki: 'en.glyphwiki.org/wiki/$1',\n enkol: 'enkol.pl/$1',\n eokulturcentro: 'esperanto.toulouse.free.fr/nova/wikini/wakka.php?wiki=$1',\n esolang: 'esolangs.org/wiki/$1',\n etherpad: 'etherpad.wikimedia.org/$1',\n ethnologue: w + 'ethnologue.com/language/$1',\n ethnologuefamily: w + 'ethnologue.com/show_family.asp?subid=$1',\n evowiki: 'wiki.cotch.net/index.php/$1',\n exotica: w + 'exotica.org.uk/wiki/$1',\n fanimutationwiki: 'wiki.animutationportal.com/index.php/$1',\n fedora: 'fedoraproject.org/wiki/$1',\n finalfantasy: 'finalfantasy.wikia.com/wiki/$1',\n finnix: w + 'finnix.org/$1',\n flickruser: w + 'flickr.com/people/$1',\n flickrphoto: w + 'flickr.com/photo.gne?id=$1',\n floralwiki: w + 'floralwiki.co.uk/wiki/$1',\n foldoc: 'foldoc.org/$1',\n foundation: 'foundation' + wm,\n foundationsite: 'wikimediafoundation.org/$1',\n foxwiki: 'fox.wikis.com/wc.dll?Wiki~$1',\n freebio: 'freebiology.org/wiki/$1',\n freebsdman: w + 'FreeBSD.org/cgi/man.cgi?apropos=1&query=$1',\n freeculturewiki: 'wiki.freeculture.org/index.php/$1',\n freedomdefined: 'freedomdefined.org/$1',\n freefeel: 'freefeel.org/wiki/$1',\n freekiwiki: 'wiki.freegeek.org/index.php/$1',\n // freenode: 'irc://irc.freenode.net/$1',\n freesoft: 'directory.fsf.org/wiki/$1',\n ganfyd: 'ganfyd.org/index.php?title=$1',\n gardenology: w + 'gardenology.org/wiki/$1',\n gausswiki: 'gauss.ffii.org/$1',\n gentoo: 'wiki.gentoo.org/wiki/$1',\n genwiki: 'wiki.genealogy.net/index.php/$1',\n gerrit: 'gerrit.wikimedia.org/r/$1',\n git: 'gerrit.wikimedia.org/g/$1',\n google: w + 'google.com/search?q=$1',\n googledefine: w + 'google.com/search?q=define:$1',\n googlegroups: 'groups.google.com/groups?q=$1',\n guildwarswiki: 'wiki.guildwars.com/wiki/$1',\n guildwiki: 'guildwars.wikia.com/wiki/$1',\n guc: 'tools.wmflabs.org/guc/?user=$1',\n gucprefix: 'tools.wmflabs.org/guc/?isPrefixPattern=1&src=rc&user=$1',\n gutenberg: w + 'gutenberg.org/etext/$1',\n gutenbergwiki: w + 'gutenberg.org/wiki/$1',\n hackerspaces: 'hackerspaces.org/wiki/$1',\n h2wiki: 'halowiki.net/p/$1',\n hammondwiki: w + 'dairiki.org/HammondWiki/index.php3?$1',\n hdl: 'hdl.handle.net/$1',\n heraldik: 'heraldik-wiki.de/wiki/$1',\n heroeswiki: 'heroeswiki.com/$1',\n horizonlabs: 'horizon.wikimedia.org/$1',\n hrwiki: w + 'hrwiki.org/index.php/$1',\n hrfwiki: 'fanstuff.hrwiki.org/index.php/$1',\n hupwiki: 'wiki.hup.hu/index.php/$1',\n iarchive: 'archive.org/details/$1',\n imdbname: w + 'imdb.com/name/nm$1/',\n imdbtitle: w + 'imdb.com/title/tt$1/',\n imdbcompany: w + 'imdb.com/company/co$1/',\n imdbcharacter: w + 'imdb.com/character/ch$1/',\n incubator: 'incubator' + wm,\n infosecpedia: 'infosecpedia.org/wiki/$1',\n infosphere: 'theinfosphere.org/$1',\n // irc: 'irc://irc.freenode.net/$1',\n // ircs: 'ircs://irc.freenode.net/$1',\n // ircrc: 'irc://irc.wikimedia.org/$1',\n // rcirc: 'irc://irc.wikimedia.org/$1',\n 'iso639-3': 'iso639-3.sil.org/code/$1',\n issn: w + 'worldcat.org/issn/$1',\n iuridictum: 'iuridictum.pecina.cz/w/$1',\n jaglyphwiki: 'glyphwiki.org/wiki/$1',\n jefo: 'esperanto-jeunes.org/wiki/$1',\n jerseydatabase: 'jerseydatabase.com/wiki.php?id=$1',\n jira: 'jira.toolserver.org/browse/$1',\n jspwiki: w + 'ecyrd.com/JSPWiki/Wiki.jsp?page=$1',\n jstor: w + 'jstor.org/journals/$1',\n kamelo: 'kamelopedia.mormo.org/index.php/$1',\n karlsruhe: 'ka.stadtwiki.net/$1',\n kinowiki: 'kino.skripov.com/index.php/$1',\n komicawiki: 'wiki.komica.org/?$1',\n kontuwiki: 'kontu.wiki/$1',\n wikitech: 'wikitech' + wm,\n libreplanet: 'libreplanet.org/wiki/$1',\n linguistlist: 'linguistlist.org/forms/langs/LLDescription.cfm?code=$1',\n linuxwiki: w + 'linuxwiki.de/$1',\n linuxwikide: w + 'linuxwiki.de/$1',\n liswiki: 'liswiki.org/wiki/$1',\n literateprograms: 'en.literateprograms.org/$1',\n livepedia: w + 'livepedia.gr/index.php?title=$1',\n localwiki: 'localwiki.org/$1',\n lojban: 'mw.lojban.org/papri/$1',\n lostpedia: 'lostpedia.wikia.com/wiki/$1',\n lqwiki: 'wiki.linuxquestions.org/wiki/$1',\n luxo: 'tools.wmflabs.org/guc/?user=$1',\n mail: 'lists.wikimedia.org/mailman/listinfo/$1',\n mailarchive: 'lists.wikimedia.org/pipermail/$1',\n mariowiki: w + 'mariowiki.com/$1',\n marveldatabase: w + 'marveldatabase.com/wiki/index.php/$1',\n meatball: 'meatballwiki.org/wiki/$1',\n mw: w + 'mediawiki.org/wiki/$1',\n mediazilla: 'bugzilla.wikimedia.org/$1',\n memoryalpha: 'memory-alpha.fandom.com/wiki/$1',\n metawiki: 'meta' + wm,\n metawikimedia: 'meta' + wm,\n metawikipedia: 'meta' + wm,\n mineralienatlas: w + 'mineralienatlas.de/lexikon/index.php/$1',\n moinmoin: 'moinmo.in/$1',\n monstropedia: w + 'monstropedia.org/?title=$1',\n mosapedia: 'mosapedia.de/wiki/index.php/$1',\n mozcom: 'mozilla.wikia.com/wiki/$1',\n mozillawiki: 'wiki.mozilla.org/$1',\n mozillazinekb: 'kb.mozillazine.org/$1',\n musicbrainz: 'musicbrainz.org/doc/$1',\n mediawikiwiki: w + 'mediawiki.org/wiki/$1',\n mwod: w + 'merriam-webster.com/dictionary/$1',\n mwot: w + 'merriam-webster.com/thesaurus/$1',\n nkcells: w + 'nkcells.info/index.php?title=$1',\n nara: 'catalog.archives.gov/id/$1',\n nosmoke: 'no-smok.net/nsmk/$1',\n nost: 'nostalgia.' + wp,\n nostalgia: 'nostalgia.' + wp,\n oeis: 'oeis.org/$1',\n oldwikisource: 'wikisource.org/wiki/$1',\n olpc: 'wiki.laptop.org/go/$1',\n omegawiki: w + 'omegawiki.org/Expression:$1',\n onelook: w + 'onelook.com/?ls=b&w=$1',\n openlibrary: 'openlibrary.org/$1',\n openstreetmap: 'wiki.openstreetmap.org/wiki/$1',\n openwetware: 'openwetware.org/wiki/$1',\n opera7wiki: 'operawiki.info/$1',\n organicdesign: w + 'organicdesign.co.nz/$1',\n orthodoxwiki: 'orthodoxwiki.org/$1',\n osmwiki: 'wiki.openstreetmap.org/wiki/$1',\n otrs: 'ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom&TicketID=$1',\n otrswiki: 'otrs-wiki' + wm,\n ourmedia: w + 'socialtext.net/ourmedia/index.cgi?$1',\n outreach: 'outreach' + wm,\n outreachwiki: 'outreach' + wm,\n owasp: w + 'owasp.org/index.php/$1',\n panawiki: 'wiki.alairelibre.net/index.php?title=$1',\n patwiki: 'gauss.ffii.org/$1',\n personaltelco: 'personaltelco.net/wiki/$1',\n petscan: 'petscan.wmflabs.org/?psid=$1',\n phab: 'phabricator.wikimedia.org/$1',\n phabricator: 'phabricator.wikimedia.org/$1',\n phwiki: w + 'pocketheaven.com/ph/wiki/index.php?title=$1',\n phpwiki: 'phpwiki.sourceforge.net/phpwiki/index.php?$1',\n planetmath: 'planetmath.org/node/$1',\n pmeg: w + 'bertilow.com/pmeg/$1',\n pmid: w + 'ncbi.nlm.nih.gov/pubmed/$1?dopt=Abstract',\n pokewiki: 'pokewiki.de/$1',\n pokéwiki: 'pokewiki.de/$1',\n policy: 'policy.wikimedia.org/$1',\n proofwiki: w + 'proofwiki.org/wiki/$1',\n pyrev: w + 'mediawiki.org/wiki/Special:Code/pywikipedia/$1',\n pythoninfo: 'wiki.python.org/moin/$1',\n pythonwiki: w + 'pythonwiki.de/$1',\n pywiki: 'c2.com/cgi/wiki?$1',\n psycle: 'psycle.sourceforge.net/wiki/$1',\n quality: 'quality' + wm,\n quarry: 'quarry.wmflabs.org/$1',\n regiowiki: 'regiowiki.at/wiki/$1',\n rev: w + 'mediawiki.org/wiki/Special:Code/MediaWiki/$1',\n revo: 'purl.org/NET/voko/revo/art/$1.html',\n rfc: 'tools.ietf.org/html/rfc$1',\n rheinneckar: 'rhein-neckar-wiki.de/$1',\n robowiki: 'robowiki.net/?$1',\n rodovid: 'en.rodovid.org/wk/$1',\n reuterswiki: 'glossary.reuters.com/index.php/$1',\n rowiki: 'wiki.rennkuckuck.de/index.php/$1',\n rt: 'rt.wikimedia.org/Ticket/Display.html?id=$1',\n // rtfm: 'ftp://rtfm.mit.edu/pub/faqs/$1',\n s23wiki: 's23.org/wiki/$1',\n scholar: 'scholar.google.com/scholar?q=$1',\n schoolswp: 'schools-' + wp,\n scores: 'imslp.org/wiki/$1',\n scoutwiki: 'en.scoutwiki.org/$1',\n scramble: w + 'scramble.nl/wiki/index.php?title=$1',\n seapig: w + 'seapig.org/$1',\n seattlewiki: 'seattle.wikia.com/wiki/$1',\n slwiki: 'wiki.secondlife.com/wiki/$1',\n 'semantic-mw': w + 'semantic-mediawiki.org/wiki/$1',\n senseislibrary: 'senseis.xmp.net/?$1',\n sharemap: 'sharemap.org/$1',\n silcode: w + 'sil.org/iso639-3/documentation.asp?id=$1',\n slashdot: 'slashdot.org/article.pl?sid=$1',\n sourceforge: 'sourceforge.net/$1',\n spcom: 'spcom' + wm,\n species: 'species' + wm,\n squeak: 'wiki.squeak.org/squeak/$1',\n stats: 'stats.wikimedia.org/$1',\n stewardry: 'tools.wmflabs.org/meta/stewardry/?wiki=$1',\n strategy: 'strategy' + wm,\n strategywiki: 'strategywiki.org/wiki/$1',\n sulutil: 'meta.wikimedia.org/wiki/Special:CentralAuth/$1',\n swtrain: 'train.spottingworld.com/$1',\n svn: 'svn.wikimedia.org/viewvc/mediawiki/$1?view=log',\n swinbrain: 'swinbrain.ict.swin.edu.au/wiki/$1',\n tabwiki: w + 'tabwiki.com/index.php/$1',\n tclerswiki: 'wiki.tcl.tk/$1',\n technorati: w + 'technorati.com/search/$1',\n tenwiki: 'ten.' + wp,\n testwiki: 'test.' + wp,\n testwikidata: 'test.wikidata.org/wiki/$1',\n test2wiki: 'test2.' + wp,\n tfwiki: 'tfwiki.net/wiki/$1',\n thelemapedia: w + 'thelemapedia.org/index.php/$1',\n theopedia: w + 'theopedia.com/$1',\n thinkwiki: w + 'thinkwiki.org/wiki/$1',\n ticket: 'ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom&TicketNumber=$1',\n tmbw: 'tmbw.net/wiki/$1',\n tmnet: w + 'technomanifestos.net/?$1',\n tmwiki: w + 'EasyTopicMaps.com/?page=$1',\n toolforge: 'tools.wmflabs.org/$1',\n toollabs: 'tools.wmflabs.org/$1',\n tools: 'toolserver.org/$1',\n tswiki: w + 'mediawiki.org/wiki/Toolserver:$1',\n translatewiki: 'translatewiki.net/wiki/$1',\n tviv: 'tviv.org/wiki/$1',\n tvtropes: w + 'tvtropes.org/pmwiki/pmwiki.php/Main/$1',\n twiki: 'twiki.org/cgi-bin/view/$1',\n tyvawiki: w + 'tyvawiki.org/wiki/$1',\n umap: 'umap.openstreetmap.fr/$1',\n uncyclopedia: 'en.uncyclopedia.co/wiki/$1',\n unihan: w + 'unicode.org/cgi-bin/GetUnihanData.pl?codepoint=$1',\n unreal: 'wiki.beyondunreal.com/wiki/$1',\n urbandict: w + 'urbandictionary.com/define.php?term=$1',\n usej: w + 'tejo.org/usej/$1',\n usemod: w + 'usemod.com/cgi-bin/wiki.pl?$1',\n usability: 'usability' + wm,\n utrs: 'utrs.wmflabs.org/appeal.php?id=$1',\n vikidia: 'fr.vikidia.org/wiki/$1',\n vlos: 'tusach.thuvienkhoahoc.com/wiki/$1',\n vkol: 'kol.coldfront.net/thekolwiki/index.php/$1',\n voipinfo: w + 'voip-info.org/wiki/view/$1',\n votewiki: 'vote' + wm,\n werelate: w + 'werelate.org/wiki/$1',\n wg: 'wg-en.' + wp,\n wikia: w + 'wikia.com/wiki/w:c:$1',\n wikiasite: w + 'wikia.com/wiki/w:c:$1',\n wikiapiary: 'wikiapiary.com/wiki/$1',\n wikibooks: 'en.wikibooks.org/wiki/$1',\n wikichristian: w + 'wikichristian.org/index.php?title=$1',\n wikicities: w + 'wikia.com/wiki/w:$1',\n wikicity: w + 'wikia.com/wiki/w:c:$1',\n wikiconference: 'wikiconference.org/wiki/$1',\n wikidata: w + 'wikidata.org/wiki/$1',\n wikif1: w + 'wikif1.org/$1',\n wikifur: 'en.wikifur.com/wiki/$1',\n wikihow: w + 'wikihow.com/$1',\n wikiindex: 'wikiindex.org/$1',\n wikilemon: 'wiki.illemonati.com/$1',\n wikilivres: 'wikilivres.org/wiki/$1',\n wikilivresru: 'wikilivres.ru/$1',\n 'wikimac-de': 'apfelwiki.de/wiki/Main/$1',\n wikimedia: 'foundation' + wm,\n wikinews: 'en.wikinews.org/wiki/$1',\n wikinfo: 'wikinfo.org/w/index.php/$1',\n wikinvest: 'meta.wikimedia.org/wiki/Interwiki_map/discontinued#Wikinvest',\n wikiotics: 'wikiotics.org/$1',\n wikipapers: 'wikipapers.referata.com/wiki/$1',\n wikipedia: 'en.' + wp,\n wikipediawikipedia: 'en.wikipedia.org/wiki/Wikipedia:$1',\n wikiquote: 'en.wikiquote.org/wiki/$1',\n wikisophia: 'wikisophia.org/index.php?title=$1',\n wikisource: 'en.wikisource.org/wiki/$1',\n wikispecies: 'species' + wm,\n wikispot: 'wikispot.org/?action=gotowikipage&v=$1',\n wikiskripta: w + 'wikiskripta.eu/index.php/$1',\n labsconsole: 'wikitech' + wm,\n wikiti: 'wikiti.denglend.net/index.php?title=$1',\n wikiversity: 'en.wikiversity.org/wiki/$1',\n wikivoyage: 'en.wikivoyage.org/wiki/$1',\n betawikiversity: 'beta.wikiversity.org/wiki/$1',\n wikiwikiweb: 'c2.com/cgi/wiki?$1',\n wiktionary: 'en.wiktionary.org/wiki/$1',\n wipipedia: 'wipipedia.org/index.php/$1',\n wlug: w + 'wlug.org.nz/$1',\n wmam: 'am' + wm,\n wmar: w + 'wikimedia.org.ar/wiki/$1',\n wmat: 'mitglieder.wikimedia.at/$1',\n wmau: 'wikimedia.org.au/wiki/$1',\n wmbd: 'bd' + wm,\n wmbe: 'be' + wm,\n wmbr: 'br' + wm,\n wmca: 'ca' + wm,\n wmch: w + 'wikimedia.ch/$1',\n wmcl: w + 'wikimediachile.cl/index.php?title=$1',\n wmcn: 'cn' + wm,\n wmco: 'co' + wm,\n wmcz: w + 'wikimedia.cz/web/$1',\n wmdc: 'wikimediadc.org/wiki/$1',\n securewikidc: 'secure.wikidc.org/$1',\n wmde: 'wikimedia.de/wiki/$1',\n wmdk: 'dk' + wm,\n wmee: 'ee' + wm,\n wmec: 'ec' + wm,\n wmes: w + 'wikimedia.es/wiki/$1',\n wmet: 'ee' + wm,\n wmfdashboard: 'outreachdashboard.wmflabs.org/$1',\n wmfi: 'fi' + wm,\n wmfr: 'wikimedia.fr/$1',\n wmge: 'ge' + wm,\n wmhi: 'hi' + wm,\n wmhk: 'meta.wikimedia.org/wiki/Wikimedia_Hong_Kong',\n wmhu: 'wikimedia.hu/wiki/$1',\n wmid: 'id' + wm,\n wmil: w + 'wikimedia.org.il/$1',\n wmin: 'wiki.wikimedia.in/$1',\n wmit: 'wiki.wikimedia.it/wiki/$1',\n wmke: 'meta.wikimedia.org/wiki/Wikimedia_Kenya',\n wmmk: 'mk' + wm,\n wmmx: 'mx' + wm,\n wmnl: 'nl' + wm,\n wmnyc: 'nyc' + wm,\n wmno: 'no' + wm,\n 'wmpa-us': 'pa-us' + wm,\n wmph: 'meta.wikimedia.org/wiki/Wikimedia_Philippines',\n wmpl: 'pl' + wm,\n wmpt: 'pt' + wm,\n wmpunjabi: 'punjabi' + wm,\n wmromd: 'romd' + wm,\n wmrs: 'rs' + wm,\n wmru: 'ru' + wm,\n wmse: 'se' + wm,\n wmsk: 'wikimedia.sk/$1',\n wmtr: 'tr' + wm,\n wmtw: 'wikimedia.tw/wiki/index.php5/$1',\n wmua: 'ua' + wm,\n wmuk: 'wikimedia.org.uk/wiki/$1',\n wmve: 'wikimedia.org.ve/wiki/$1',\n wmza: 'wikimedia.org.za/wiki/$1',\n wm2005: 'wikimania2005' + wm,\n wm2006: 'wikimania2006' + wm,\n wm2007: 'wikimania2007' + wm,\n wm2008: 'wikimania2008' + wm,\n wm2009: 'wikimania2009' + wm,\n wm2010: 'wikimania2010' + wm,\n wm2011: 'wikimania2011' + wm,\n wm2012: 'wikimania2012' + wm,\n wm2013: 'wikimania2013' + wm,\n wm2014: 'wikimania2014' + wm,\n wm2015: 'wikimania2015' + wm,\n wm2016: 'wikimania2016' + wm,\n wm2017: 'wikimania2017' + wm,\n wm2018: 'wikimania2018' + wm,\n wmania: 'wikimania' + wm,\n wikimania: 'wikimania' + wm,\n wmteam: 'wikimaniateam' + wm,\n wmf: 'foundation' + wm,\n wmfblog: 'blog.wikimedia.org/$1',\n wmdeblog: 'blog.wikimedia.de/$1',\n wookieepedia: 'starwars.wikia.com/wiki/$1',\n wowwiki: w + 'wowwiki.com/$1',\n wqy: 'wqy.sourceforge.net/cgi-bin/index.cgi?$1',\n wurmpedia: 'wurmpedia.com/index.php/$1',\n viaf: 'viaf.org/viaf/$1',\n zrhwiki: w + 'zrhwiki.ch/wiki/$1',\n zum: 'wiki.zum.de/$1',\n zwiki: w + 'zwiki.org/$1',\n m: 'meta' + wm,\n meta: 'meta' + wm,\n sep11: 'sep11.' + wp,\n d: w + 'wikidata.org/wiki/$1',\n minnan: 'zh-min-nan.' + wp,\n nb: 'no.' + wp,\n 'zh-cfr': 'zh-min-nan.' + wp,\n 'zh-cn': 'zh.' + wp,\n 'zh-tw': 'zh.' + wp,\n nan: 'zh-min-nan.' + wp,\n vro: 'fiu-vro.' + wp,\n cmn: 'zh.' + wp,\n lzh: 'zh-classical.' + wp,\n rup: 'roa-rup.' + wp,\n gsw: 'als.' + wp,\n 'be-tarask': 'be-x-old.' + wp,\n sgs: 'bat-smg.' + wp,\n egl: 'eml.' + wp,\n w: 'en.' + wp,\n wikt: 'en.wiktionary.org/wiki/$1',\n q: 'en.wikiquote.org/wiki/$1',\n b: 'en.wikibooks.org/wiki/$1',\n n: 'en.wikinews.org/wiki/$1',\n s: 'en.wikisource.org/wiki/$1',\n chapter: 'en' + wm,\n v: 'en.wikiversity.org/wiki/$1',\n voy: 'en.wikivoyage.org/wiki/$1'\n}\n","const languages = require('../_data/languages')\n//some colon symbols are valid links, like `America: That place`\n//so we have to whitelist allowable interwiki links\nconst interwikis = require('../_data/interwiki')\n\n//add language prefixes too..\nObject.keys(languages).forEach(k => {\n interwikis[k] = k + '.wikipedia.org/wiki/$1'\n})\n\n//this is predictably very complicated.\n// https://meta.wikimedia.org/wiki/Help:Interwiki_linking\nconst parseInterwiki = function(obj) {\n let str = obj.page || ''\n if (str.indexOf(':') !== -1) {\n let m = str.match(/^(.*):(.*)/)\n if (m === null) {\n return obj\n }\n let site = m[1] || ''\n site = site.toLowerCase()\n //only allow interwikis to these specific places\n if (interwikis.hasOwnProperty(site) === false) {\n return obj\n }\n obj.wiki = site\n obj.page = m[2]\n }\n return obj\n}\nmodule.exports = parseInterwiki\n","const parse_interwiki = require('./interwiki')\nconst ignore_links = /^:?(category|catégorie|Kategorie|Categoría|Categoria|Categorie|Kategoria|تصنيف|image|file|image|fichier|datei|media):/i\nconst external_link = /\\[(https?|news|ftp|mailto|gopher|irc)(:\\/\\/[^\\]\\| ]{4,1500})([\\| ].*?)?\\]/g\nconst link_reg = /\\[\\[(.{0,160}?)\\]\\]([a-z]+)?(\\w{0,10})/gi //allow dangling suffixes - \"[[flanders]]s\"\n\nconst external_links = function(links, str) {\n str.replace(external_link, function(raw, protocol, link, text) {\n text = text || ''\n links.push({\n type: 'external',\n site: protocol + link,\n text: text.trim(),\n raw: raw\n })\n return text\n })\n return links\n}\n\nconst internal_links = function(links, str) {\n //regular links\n str.replace(link_reg, function(raw, s, suffix) {\n let txt = null\n //make a copy of original\n let link = s\n if (s.match(/\\|/)) {\n //replacement link [[link|text]]\n s = s.replace(/\\[\\[(.{2,100}?)\\]\\](\\w{0,10})/g, '$1$2') //remove ['s and keep suffix\n link = s.replace(/(.{2,100})\\|.{0,200}/, '$1') //replaced links\n txt = s.replace(/.{2,100}?\\|/, '')\n //handle funky case of [[toronto|]]\n if (txt === null && link.match(/\\|$/)) {\n link = link.replace(/\\|$/, '')\n txt = link\n }\n }\n //kill off non-wikipedia namespaces\n if (link.match(ignore_links)) {\n return s\n }\n //kill off just these just-anchor links [[#history]]\n // if (link.match(/^#/i)) {\n // console.log(s)\n // return s\n // }\n //remove anchors from end [[toronto#history]]\n let obj = {\n page: link,\n raw: raw\n }\n obj.page = obj.page.replace(/#(.*)/, (a, b) => {\n obj.anchor = b\n return ''\n })\n //grab any fr:Paris parts\n obj = parse_interwiki(obj)\n if (obj.wiki) {\n obj.type = 'interwiki'\n }\n if (txt !== null && txt !== obj.page) {\n obj.text = txt\n }\n //finally, support [[link]]'s apostrophe\n if (suffix) {\n obj.text = obj.text || obj.page\n obj.text += suffix.trim()\n }\n //titlecase it, if necessary\n if (obj.page && /^[A-Z]/.test(obj.page) === false) {\n if (!obj.text) {\n obj.text = obj.page\n }\n obj.page = obj.page\n }\n links.push(obj)\n return s\n })\n return links\n}\n\n//grab an array of internal links in the text\nconst parse_links = function(str) {\n let links = []\n //first, parse external links\n links = external_links(links, str)\n //internal links\n links = internal_links(links, str)\n if (links.length === 0) {\n return undefined\n }\n return links\n}\nmodule.exports = parse_links\n","const i18n = require('../_data/i18n')\nconst parseLink = require('../link/parse')\n//pulls target link out of redirect page\nconst REDIRECT_REGEX = new RegExp(\n '^[ \\n\\t]*?#(' + i18n.redirects.join('|') + ') *?(\\\\[\\\\[.{2,180}?\\\\]\\\\])',\n 'i'\n)\n\nconst isRedirect = function(wiki) {\n //too long to be a redirect?\n if (!wiki || wiki.length > 500) {\n return false\n }\n return REDIRECT_REGEX.test(wiki)\n}\n\nconst parse = function(wiki) {\n let m = wiki.match(REDIRECT_REGEX)\n if (m && m[2]) {\n let links = parseLink(m[2]) || []\n return links[0]\n }\n return {}\n}\n\nmodule.exports = {\n isRedirect: isRedirect,\n parse: parse\n}\n","//okay, i know you're not supposed to regex html, but...\n//https://en.wikipedia.org/wiki/Help:HTML_in_wikitext\n\n//these are things we throw-away\n//these will mess-up if they're nested, but they're not usually.\nconst ignore = [\n 'table',\n 'code',\n 'score',\n 'data',\n 'categorytree',\n 'charinsert',\n 'hiero',\n 'imagemap',\n 'inputbox',\n 'nowiki',\n 'poem',\n 'references',\n 'source',\n 'syntaxhighlight',\n 'timeline'\n]\nconst openTag = `< ?(${ignore.join('|')}) ?[^>]{0,200}?>`\nconst closeTag = `< ?/ ?(${ignore.join('|')}) ?>`\nconst anyChar = '\\\\s\\\\S' //including newline\nconst noThanks = new RegExp(`${openTag}[${anyChar}]+?${closeTag}`, 'ig')\n\nconst kill_xml = function(wiki) {\n //( tags are parsed in Section class) - luckily, refs can't be recursive.\n //types of html/xml that we want to trash completely.\n wiki = wiki.replace(noThanks, ' ')\n //some xml-like fragments we can also kill\n wiki = wiki.replace(/ ?< ?(span|div|table|data) [a-zA-Z0-9=%\\.#:;'\" ]{2,100}\\/? ?> ?/g, ' ') //\n //only kill ref tags if they are selfclosing\n wiki = wiki.replace(/ ?< ?(ref) [a-zA-Z0-9=\" ]{2,100}\\/ ?> ?/g, ' ') //\n //some formatting xml, we'll keep their insides though\n wiki = wiki.replace(/ ?<[ \\/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \\/]?> ?/g, ' ') //, \n wiki = wiki.replace(/ ?<[ \\/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \\/]?> ?/g, ' ') //, \n wiki = wiki.replace(/ ?<[ \\/]?h[0-9][ \\/]?> ?/g, ' ') //

,

\n wiki = wiki.replace(/ ?< ?br ?\\/> ?/g, '\\n') //
\n return wiki.trim()\n}\nmodule.exports = kill_xml\n","const kill_xml = require('./kill_xml')\n\n//this mostly-formatting stuff can be cleaned-up first, to make life easier\nfunction preProcess(doc) {\n let wiki = doc.wiki\n //remove comments\n wiki = wiki.replace(//g, '')\n wiki = wiki.replace(/__(NOTOC|NOEDITSECTION|FORCETOC|TOC)__/gi, '')\n //signitures\n wiki = wiki.replace(/~~{1,3}/g, '')\n //windows newlines\n wiki = wiki.replace(/\\r/g, '')\n //japanese periods - '。'\n wiki = wiki.replace(/\\u3002/g, '. ')\n //horizontal rule\n wiki = wiki.replace(/----/g, '')\n //formatting for templates-in-templates...\n wiki = wiki.replace(/\\{\\{\\}\\}/g, ' – ')\n wiki = wiki.replace(/\\{\\{\\\\\\}\\}/g, ' / ')\n //space\n wiki = wiki.replace(/ /g, ' ')\n //give it the inglorious send-off it deserves..\n wiki = kill_xml(wiki)\n //({{template}},{{template}}) leaves empty parentheses\n wiki = wiki.replace(/\\([,;: ]+?\\)/g, '')\n //these templates just screw things up, too\n wiki = wiki.replace(/{{(baseball|basketball) (primary|secondary) (style|color).*?\\}\\}/i, '')\n doc.wiki = wiki\n}\nmodule.exports = preProcess\n","// dumpster-dive throws everything into mongodb - github.com/spencermountain/dumpster-dive\n// mongo has some opinions about what characters are allowed as keys and ids.\n//https://stackoverflow.com/questions/12397118/mongodb-dot-in-key-name/30254815#30254815\nconst specialChar = /[\\\\\\.$]/\n\nconst encodeStr = function(str) {\n if (typeof str !== 'string') {\n str = ''\n }\n str = str.replace(/\\\\/g, '\\\\\\\\')\n str = str.replace(/^\\$/, '\\\\u0024')\n str = str.replace(/\\./g, '\\\\u002e')\n return str\n}\n\nconst encodeObj = function(obj = {}) {\n let keys = Object.keys(obj)\n for (let i = 0; i < keys.length; i += 1) {\n if (specialChar.test(keys[i]) === true) {\n let str = encodeStr(keys[i])\n if (str !== keys[i]) {\n obj[str] = obj[keys[i]]\n delete obj[keys[i]]\n }\n }\n }\n return obj\n}\n\nmodule.exports = {\n encodeObj: encodeObj\n}\n","const setDefaults = require('../_lib/setDefaults')\nconst encode = require('../_lib/encode')\n\nconst defaults = {\n headers: true,\n depth: true,\n paragraphs: true,\n images: true,\n tables: true,\n templates: true,\n infoboxes: true,\n lists: true,\n references: true\n}\n//\nconst toJSON = function(section, options) {\n options = setDefaults(options, defaults)\n let data = {}\n if (options.headers === true) {\n data.title = section.title()\n }\n if (options.depth === true) {\n data.depth = section.depth\n }\n //these return objects\n if (options.paragraphs === true) {\n let paragraphs = section.paragraphs().map(p => p.json(options))\n if (paragraphs.length > 0) {\n data.paragraphs = paragraphs\n }\n }\n //image json data\n if (options.images === true) {\n let images = section.images().map(img => img.json(options))\n if (images.length > 0) {\n data.images = images\n }\n }\n //table json data\n if (options.tables === true) {\n let tables = section.tables().map(t => t.json(options))\n if (tables.length > 0) {\n data.tables = tables\n }\n }\n //template json data\n if (options.templates === true) {\n let templates = section.templates()\n if (templates.length > 0) {\n data.templates = templates\n //encode them, for mongodb\n if (options.encode === true) {\n data.templates.forEach(t => encode.encodeObj(t))\n }\n }\n }\n //infobox json data\n if (options.infoboxes === true) {\n let infoboxes = section.infoboxes().map(i => i.json(options))\n if (infoboxes.length > 0) {\n data.infoboxes = infoboxes\n }\n }\n //list json data\n if (options.lists === true) {\n let lists = section.lists().map(list => list.json(options))\n if (lists.length > 0) {\n data.lists = lists\n }\n }\n //list references - default true\n if (options.references === true || options.citations === true) {\n let references = section.references().map(ref => ref.json(options))\n if (references.length > 0) {\n data.references = references\n }\n }\n //default off\n if (options.sentences === true) {\n data.sentences = section.sentences().map(s => s.json(options))\n }\n return data\n}\nmodule.exports = toJSON\n","const toJSON = require('./toJson')\nconst setDefaults = require('../_lib/setDefaults')\n\nconst defaults = {\n tables: true,\n references: true,\n paragraphs: true,\n templates: true,\n infoboxes: true\n}\n\n//the stuff between headings - 'History' section for example\nconst Section = function(data) {\n this.depth = data.depth\n this.doc = null\n this._title = data.title || ''\n Object.defineProperty(this, 'doc', {\n enumerable: false,\n value: null\n })\n data.templates = data.templates || []\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n title: function() {\n return this._title || ''\n },\n index: function() {\n if (!this.doc) {\n return null\n }\n let index = this.doc.sections().indexOf(this)\n if (index === -1) {\n return null\n }\n return index\n },\n indentation: function() {\n return this.depth\n },\n sentences: function(n) {\n let arr = this.paragraphs().reduce((list, p) => {\n return list.concat(p.sentences())\n }, [])\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr || []\n },\n paragraphs: function(n) {\n let arr = this.data.paragraphs || []\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr || []\n },\n paragraph: function(n) {\n let arr = this.data.paragraphs || []\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr[0]\n },\n links: function(n) {\n let arr = []\n this.infoboxes().forEach(templ => {\n templ.links(n).forEach(link => arr.push(link))\n })\n this.sentences().forEach(s => {\n s.links(n).forEach(link => arr.push(link))\n })\n this.tables().forEach(t => {\n t.links(n).forEach(link => arr.push(link))\n })\n this.lists().forEach(list => {\n list.links(n).forEach(link => arr.push(link))\n })\n if (typeof n === 'number') {\n return arr[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = arr.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return arr\n },\n tables: function(clue) {\n let arr = this.data.tables || []\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n templates: function(clue) {\n let arr = this.data.templates || []\n arr = arr.map(t => t.json())\n if (typeof clue === 'number') {\n return arr[clue]\n }\n if (typeof clue === 'string') {\n clue = clue.toLowerCase()\n return arr.filter(o => o.template === clue || o.name === clue)\n }\n return arr\n },\n infoboxes: function(clue) {\n let arr = this.data.infoboxes || []\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n coordinates: function(clue) {\n let arr = [].concat(this.templates('coord'), this.templates('coor'))\n if (typeof clue === 'number') {\n if (!arr[clue]) {\n return []\n }\n return arr[clue]\n }\n return arr\n },\n lists: function(clue) {\n let arr = []\n this.paragraphs().forEach(p => {\n arr = arr.concat(p.lists())\n })\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n interwiki(num) {\n let arr = []\n this.paragraphs().forEach(p => {\n arr = arr.concat(p.interwiki())\n })\n if (typeof num === 'number') {\n return arr[num]\n }\n return arr || []\n },\n images: function(clue) {\n let arr = []\n this.paragraphs().forEach(p => {\n arr = arr.concat(p.images())\n })\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr || []\n },\n references: function(clue) {\n let arr = this.data.references || []\n if (typeof clue === 'number') {\n return arr[clue]\n }\n return arr\n },\n\n //transformations\n remove: function() {\n if (!this.doc) {\n return null\n }\n let bads = {}\n bads[this.title()] = true\n //remove children too\n this.children().forEach(sec => (bads[sec.title()] = true))\n let arr = this.doc.data.sections\n arr = arr.filter(sec => bads.hasOwnProperty(sec.title()) !== true)\n this.doc.data.sections = arr\n return this.doc\n },\n\n //move-around sections like in jquery\n nextSibling: function() {\n if (!this.doc) {\n return null\n }\n let sections = this.doc.sections()\n let index = this.index()\n for (let i = index + 1; i < sections.length; i += 1) {\n if (sections[i].depth < this.depth) {\n return null\n }\n if (sections[i].depth === this.depth) {\n return sections[i]\n }\n }\n return null\n },\n lastSibling: function() {\n if (!this.doc) {\n return null\n }\n let sections = this.doc.sections()\n let index = this.index()\n return sections[index - 1] || null\n },\n children: function(n) {\n if (!this.doc) {\n return null\n }\n\n let sections = this.doc.sections()\n let index = this.index()\n let children = []\n //(immediately preceding sections with higher depth)\n if (sections[index + 1] && sections[index + 1].depth > this.depth) {\n for (let i = index + 1; i < sections.length; i += 1) {\n if (sections[i].depth > this.depth) {\n children.push(sections[i])\n } else {\n break\n }\n }\n }\n if (typeof n === 'string') {\n n = n.toLowerCase()\n return children.find(s => s.title().toLowerCase() === n)\n }\n if (typeof n === 'number') {\n return children[n]\n }\n return children\n },\n parent: function() {\n if (!this.doc) {\n return null\n }\n let sections = this.doc.sections()\n let index = this.index()\n for (let i = index; i >= 0; i -= 1) {\n if (sections[i] && sections[i].depth < this.depth) {\n return sections[i]\n }\n }\n return null\n },\n text: function(options) {\n options = setDefaults(options, defaults)\n let pList = this.paragraphs()\n pList = pList.map(p => p.text(options))\n return pList.join('\\n\\n')\n },\n json: function(options) {\n options = setDefaults(options, defaults)\n return toJSON(this, options)\n }\n}\n//aliases\nmethods.next = methods.nextSibling\nmethods.last = methods.lastSibling\nmethods.previousSibling = methods.lastSibling\nmethods.previous = methods.lastSibling\nmethods.citations = methods.references\nmethods.sections = methods.children\nObject.keys(methods).forEach(k => {\n Section.prototype[k] = methods[k]\n})\n\nmodule.exports = Section\n","module.exports = {\n capitalise: function(str) {\n if (str && typeof str === 'string') {\n return str.charAt(0).toUpperCase() + str.slice(1)\n }\n return ''\n },\n trim_whitespace: function(str) {\n if (str && typeof str === 'string') {\n str = str.replace(/^\\s\\s*/, '')\n str = str.replace(/\\s\\s*$/, '')\n str = str.replace(/ {2}/, ' ')\n str = str.replace(/\\s, /, ', ')\n return str\n }\n return ''\n }\n}\n","const wikis = require('../_data/interwiki')\n\nconst defaults = {\n type: 'internal'\n}\nconst Link = function(data) {\n data = data || {}\n data = Object.assign({}, defaults, data)\n // console.log(data)\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\nconst methods = {\n text: function(str) {\n if (str !== undefined) {\n this.data.text = str\n }\n return this.data.text\n },\n json: function() {\n let obj = {\n text: this.text(),\n type: this.type()\n }\n if (obj.type === 'internal') {\n obj.page = this.page()\n } else if (obj.type === 'interwiki') {\n obj.wiki = this.wiki()\n } else {\n obj.site = this.site()\n }\n let anchor = this.anchor()\n if (anchor) {\n obj.anchor = anchor\n }\n return obj\n },\n page: function(str) {\n if (str !== undefined) {\n this.data.page = str\n }\n return this.data.page\n },\n anchor: function(str) {\n if (str !== undefined) {\n this.data.anchor = str\n }\n return this.data.anchor || ''\n },\n wiki: function(str) {\n if (str !== undefined) {\n this.data.wiki = str\n }\n return this.data.wiki\n },\n type: function(str) {\n if (str !== undefined) {\n this.data.type = str\n }\n return this.data.type\n },\n site: function(str) {\n if (str !== undefined) {\n this.data.site = str\n }\n return this.data.site\n },\n // create a url for any type of link\n href: function() {\n let type = this.type()\n if (type === 'external') {\n return this.site()\n }\n let page = this.page()\n page = page.replace(/ /g, '_')\n page = encodeURIComponent(page)\n let url = ''\n\n if (type === 'interwiki') {\n let wiki = this.wiki()\n url = 'https://en.wikipedia.org/wiki/$1'\n if (wikis.hasOwnProperty(wiki)) {\n url = 'http://' + wikis[this.wiki()]\n }\n url = url.replace(/\\$1/g, page)\n } else {\n //internal link\n url = `./${this.page()}`\n }\n // add anchor on the end\n if (this.anchor()) {\n url += '#' + this.anchor()\n }\n return url\n }\n}\nObject.keys(methods).forEach(k => {\n Link.prototype[k] = methods[k]\n})\nmodule.exports = Link\n","const Link = require('./Link')\nconst parseLinks = require('./parse')\n// const i18n = require('../_data/i18n')\n// const cat_reg = new RegExp('\\\\[\\\\[:?(' + i18n.categories.join('|') + '):[^\\\\]\\\\]]{2,80}\\\\]\\\\]', 'gi')\n\n//return only rendered text of wiki links\nconst removeLinks = function(line) {\n // [[File:with|Size]]\n line = line.replace(/\\[\\[File:(.{2,80}?)\\|([^\\]]+?)\\]\\](\\w{0,5})/g, '$1')\n return line\n}\n\nconst getLinks = function(data) {\n let wiki = data.text\n let links = parseLinks(wiki) || []\n data.links = links.map(link => {\n wiki = wiki.replace(link.raw, link.text || link.page || '')\n delete link.raw\n return new Link(link)\n })\n wiki = removeLinks(wiki)\n data.text = wiki\n}\nmodule.exports = getLinks\n","//handle the bold/italics\nconst formatting = function(obj) {\n let bolds = []\n let italics = []\n let wiki = obj.text || ''\n //bold and italics combined 5 's\n wiki = wiki.replace(/'''''(.{0,200}?)'''''/g, (a, b) => {\n bolds.push(b)\n italics.push(b)\n return b\n })\n //''''four'''' → bold with quotes\n wiki = wiki.replace(/''''(.{0,200}?)''''/g, (a, b) => {\n bolds.push(`'${b}'`)\n return `'${b}'`\n })\n //'''bold'''\n wiki = wiki.replace(/'''(.{0,200}?)'''/g, (a, b) => {\n bolds.push(b)\n return b\n })\n //''italic''\n wiki = wiki.replace(/''(.{0,200}?)''/g, (a, b) => {\n italics.push(b)\n return b\n })\n\n //pack it all up..\n obj.text = wiki\n if (bolds.length > 0) {\n obj.fmt = obj.fmt || {}\n obj.fmt.bold = bolds\n }\n if (italics.length > 0) {\n obj.fmt = obj.fmt || {}\n obj.fmt.italic = italics\n }\n return obj\n}\nmodule.exports = formatting\n","const setDefaults = require('../_lib/setDefaults')\nconst isNumber = /^[0-9,.]+$/\n\nconst defaults = {\n text: true,\n links: true,\n formatting: true,\n dates: true,\n numbers: true\n}\n\nconst toJSON = function(s, options) {\n options = setDefaults(options, defaults)\n let data = {}\n let text = s.text()\n if (options.text === true) {\n data.text = text\n }\n //add number field\n if (options.numbers === true && isNumber.test(text)) {\n let num = Number(text.replace(/,/g, ''))\n if (isNaN(num) === false) {\n data.number = num\n }\n }\n if (options.links && s.links().length > 0) {\n data.links = s.links().map(l => l.json())\n }\n if (options.formatting && s.data.fmt) {\n data.formatting = s.data.fmt\n }\n if (options.dates && s.data.dates !== undefined) {\n data.dates = s.data.dates\n }\n return data\n}\nmodule.exports = toJSON\n","const toJSON = require('./toJson')\n\n//where we store the formatting, link, date information\nconst Sentence = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n links: function(n) {\n let arr = this.data.links || []\n if (typeof n === 'number') {\n return arr[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = arr.find(o => o.page === n)\n return link === undefined ? [] : [link]\n }\n return arr\n },\n interwiki: function(n) {\n let arr = this.links().filter(l => l.wiki !== undefined)\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n bolds: function(n) {\n let arr = []\n if (this.data && this.data.fmt && this.data.fmt.bold) {\n arr = this.data.fmt.bold || []\n }\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n italics: function(n) {\n let arr = []\n if (this.data && this.data.fmt && this.data.fmt.italic) {\n arr = this.data.fmt.italic || []\n }\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n dates: function(n) {\n let arr = []\n if (this.data && this.data.dates) {\n arr = this.data.dates || []\n }\n if (typeof n === 'number') {\n return arr[n]\n }\n return arr\n },\n text: function(str) {\n if (str !== undefined && typeof str === 'string') {\n //set the text?\n this.data.text = str\n }\n return this.data.text || ''\n },\n json: function(options) {\n return toJSON(this, options)\n }\n}\n\nObject.keys(methods).forEach(k => {\n Sentence.prototype[k] = methods[k]\n})\nSentence.prototype.italic = Sentence.prototype.italics\nSentence.prototype.bold = Sentence.prototype.bolds\nSentence.prototype.plaintext = Sentence.prototype.text\n\nmodule.exports = Sentence\n","//these are used for the sentence-splitter\nmodule.exports = [\n 'ad',\n 'adj',\n 'adm',\n 'adv',\n 'al',\n 'alta',\n 'approx',\n 'apr',\n 'apt',\n 'arc',\n 'ariz',\n 'assn',\n 'asst',\n 'atty',\n 'aug',\n 'ave',\n 'ba',\n 'bc',\n 'bl',\n 'bldg',\n 'blvd',\n 'brig',\n 'bros',\n 'ca',\n 'cal',\n 'calif',\n 'capt',\n 'cca',\n 'cg',\n 'cl',\n 'cm',\n 'cmdr',\n 'co',\n 'col',\n 'colo',\n 'comdr',\n 'conn',\n 'corp',\n 'cpl',\n 'cres',\n 'ct',\n 'cyn',\n 'dak',\n 'dec',\n 'def',\n 'dept',\n 'det',\n 'dg',\n 'dist',\n 'dl',\n 'dm',\n 'dr',\n 'ea',\n 'eg',\n 'eng',\n 'esp',\n 'esq',\n 'est',\n 'etc',\n 'ex',\n 'exp',\n 'feb',\n 'fem',\n 'fig',\n 'fl oz',\n 'fl',\n 'fla',\n 'fm',\n 'fr',\n 'ft',\n 'fy',\n 'ga',\n 'gal',\n 'gb',\n 'gen',\n 'gov',\n 'hg',\n 'hon',\n 'hr',\n 'hrs',\n 'hwy',\n 'hz',\n 'ia',\n 'ida',\n 'ie',\n 'inc',\n 'inf',\n 'jan',\n 'jd',\n 'jr',\n 'jul',\n 'jun',\n 'kan',\n 'kans',\n 'kb',\n 'kg',\n 'km',\n 'kmph',\n 'lat',\n 'lb',\n 'lit',\n 'llb',\n 'lm',\n 'lng',\n 'lt',\n 'ltd',\n 'lx',\n 'ma',\n 'maj',\n 'mar',\n 'masc',\n 'mb',\n 'md',\n 'messrs',\n 'mg',\n 'mi',\n 'min',\n 'minn',\n 'misc',\n 'mister',\n 'ml',\n 'mlle',\n 'mm',\n 'mme',\n 'mph',\n 'mps',\n 'mr',\n 'mrs',\n 'ms',\n 'mstr',\n 'mt',\n 'neb',\n 'nebr',\n 'nee',\n 'no',\n 'nov',\n 'oct',\n 'okla',\n 'ont',\n 'op',\n 'ord',\n 'oz',\n 'pa',\n 'pd',\n 'penn',\n 'penna',\n 'phd',\n 'pl',\n 'pp',\n 'pref',\n 'prob',\n 'prof',\n 'pron',\n 'ps',\n 'psa',\n 'pseud',\n 'pt',\n 'pvt',\n 'qt',\n 'que',\n 'rb',\n 'rd',\n 'rep',\n 'reps',\n 'res',\n 'rev',\n 'sask',\n 'sec',\n 'sen',\n 'sens',\n 'sep',\n 'sept',\n 'sfc',\n 'sgt',\n 'sir',\n 'situ',\n 'sq ft',\n 'sq',\n 'sr',\n 'ss',\n 'st',\n 'supt',\n 'surg',\n 'tb',\n 'tbl',\n 'tbsp',\n 'tce',\n 'td',\n 'tel',\n 'temp',\n 'tenn',\n 'tex',\n 'tsp',\n 'univ',\n 'usafa',\n 'ut',\n 'va',\n 'vb',\n 'ver',\n 'vet',\n 'vitro',\n 'vivo',\n 'vol',\n 'vs',\n 'vt',\n 'wis',\n 'wisc',\n 'wr',\n 'wy',\n 'wyo',\n 'yb',\n 'µg'\n]\n","//split text into sentences, using regex\n//@spencermountain MIT\n\n//(Rule-based sentence boundary segmentation) - chop given text into its proper sentences.\n// Ignore periods/questions/exclamations used in acronyms/abbreviations/numbers, etc.\n// @spencermountain 2015 MIT\nconst literalAbbreviations = require('./_abbreviations')\nconst abbreviations = literalAbbreviations.concat('[^]][^]]')\nconst abbrev_reg = new RegExp(\"(^| |')(\" + abbreviations.join('|') + `)[.!?] ?$`, 'i')\nconst acronym_reg = new RegExp(\"[ |.|'|[][A-Z].? *?$\", 'i')\nconst elipses_reg = new RegExp('\\\\.\\\\.\\\\.* +?$')\nconst hasWord = new RegExp('[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]', 'iu')\n// 3040-309F : hiragana\n// 30A0-30FF : katakana\n\n//turn a nested array into one array\nconst flatten = function(arr) {\n let all = []\n arr.forEach(function(a) {\n all = all.concat(a)\n })\n return all\n}\n\nconst naiive_split = function(text) {\n //first, split by newline\n let splits = text.split(/(\\n+)/)\n splits = splits.filter(s => s.match(/\\S/))\n //split by period, question-mark, and exclamation-mark\n splits = splits.map(function(str) {\n return str.split(/(\\S.+?[.!?]\"?)(?=\\s+|$)/g) //\\u3002\n })\n return flatten(splits)\n}\n\n// if this looks like a period within a wikipedia link, return false\nconst isBalanced = function(str) {\n str = str || ''\n const open = str.split(/\\[\\[/) || []\n const closed = str.split(/\\]\\]/) || []\n if (open.length > closed.length) {\n return false\n }\n //make sure quotes are closed too\n const quotes = str.match(/\"/g)\n if (quotes && quotes.length % 2 !== 0 && str.length < 900) {\n return false\n }\n return true\n}\n\nconst sentence_parser = function(text) {\n let sentences = []\n //first do a greedy-split..\n let chunks = []\n //ensure it 'smells like' a sentence\n if (!text || typeof text !== 'string' || text.trim().length === 0) {\n return sentences\n }\n // This was the splitter regex updated to fix quoted punctuation marks.\n // let splits = text.split(/(\\S.+?[.\\?!])(?=\\s+|$|\")/g);\n // todo: look for side effects in this regex replacement:\n let splits = naiive_split(text)\n //filter-out the grap ones\n for (let i = 0; i < splits.length; i++) {\n let s = splits[i]\n if (!s || s === '') {\n continue\n }\n //this is meaningful whitespace\n if (!s.match(/\\S/)) {\n //add it to the last one\n if (chunks[chunks.length - 1]) {\n chunks[chunks.length - 1] += s\n continue\n } else if (splits[i + 1]) {\n //add it to the next one\n splits[i + 1] = s + splits[i + 1]\n continue\n }\n }\n chunks.push(s)\n }\n\n //detection of non-sentence chunks\n const isSentence = function(hmm) {\n if (hmm.match(abbrev_reg) || hmm.match(acronym_reg) || hmm.match(elipses_reg)) {\n return false\n }\n //too short? - no consecutive letters\n if (hasWord.test(hmm) === false) {\n return false\n }\n if (!isBalanced(hmm)) {\n return false\n }\n return true\n }\n //loop through these chunks, and join the non-sentence chunks back together..\n for (let i = 0; i < chunks.length; i++) {\n //should this chunk be combined with the next one?\n if (chunks[i + 1] && !isSentence(chunks[i])) {\n chunks[i + 1] = chunks[i] + (chunks[i + 1] || '') //.replace(/ +/g, ' ');\n } else if (chunks[i] && chunks[i].length > 0) {\n //this chunk is a proper sentence..\n sentences.push(chunks[i])\n chunks[i] = ''\n }\n }\n //if we never got a sentence, return the given text\n if (sentences.length === 0) {\n return [text]\n }\n return sentences\n}\n\nmodule.exports = sentence_parser\n","const helpers = require('../_lib/helpers')\nconst parseLinks = require('../link')\nconst parseFmt = require('./formatting')\nconst Sentence = require('./Sentence')\nconst sentenceParser = require('./parse')\n\nfunction postprocess(line) {\n //remove empty parentheses (sometimes caused by removing templates)\n line = line.replace(/\\([,;: ]*\\)/g, '')\n //these semi-colons in parentheses are particularly troublesome\n line = line.replace(/\\( *(; ?)+/g, '(')\n //dangling punctuation\n line = helpers.trim_whitespace(line)\n line = line.replace(/ +\\.$/, '.')\n return line\n}\n\n// returns one sentence object\nfunction fromText(str) {\n let obj = {\n text: str\n }\n //pull-out the [[links]]\n parseLinks(obj)\n obj.text = postprocess(obj.text)\n //pull-out the bolds and ''italics''\n obj = parseFmt(obj)\n //pull-out things like {{start date|...}}\n return new Sentence(obj)\n}\n\n//used for consistency with other class-definitions\nconst byParagraph = function(paragraph) {\n // array of texts\n let sentences = sentenceParser(paragraph.wiki)\n // sentence objects\n sentences = sentences.map(fromText)\n //remove :indented first line, as it is often a disambiguation\n if (sentences[0] && sentences[0].text() && sentences[0].text()[0] === ':') {\n sentences = sentences.slice(1)\n }\n paragraph.sentences = sentences\n}\n\nmodule.exports = {\n fromText: fromText,\n byParagraph: byParagraph\n}\n","//remove the top/bottom off the template\nconst strip = function(tmpl) {\n tmpl = tmpl.replace(/^\\{\\{/, '')\n tmpl = tmpl.replace(/\\}\\}$/, '')\n return tmpl\n}\nmodule.exports = strip\n","//normalize template names\nconst fmtName = function(name) {\n name = (name || '').trim()\n name = name.toLowerCase()\n name = name.replace(/_/g, ' ')\n return name\n}\nmodule.exports = fmtName\n","//turn {{name|one|two|three}} into [name, one, two, three]\nconst pipeSplitter = function(tmpl) {\n //start with a naiive '|' split\n let arr = tmpl.split(/\\n?\\|/)\n //we've split by '|', which is pretty lame\n //look for broken-up links and fix them :/\n arr.forEach((a, i) => {\n if (a === null) {\n return\n }\n //has '[[' but no ']]'\n //has equal number of openning and closing tags. handle nested case '[[[[' ']]'\n if (/\\[\\[[^\\]]+$/.test(a) || /\\{\\{[^\\}]+$/.test(a)\n || \n (a.split('{{').length !== a.split('}}').length)\n || (a.split('[[').length !== a.split(']]').length)\n ) {\n arr[i + 1] = arr[i] + '|' + arr[i + 1]\n arr[i] = null\n }\n })\n //cleanup any mistakes we've made\n arr = arr.filter(a => a !== null)\n arr = arr.map(a => (a || '').trim())\n //remove empty fields, only at the end:\n for (let i = arr.length - 1; i >= 0; i -= 1) {\n if (arr[i] === '') {\n arr.pop()\n }\n break\n }\n return arr\n}\nmodule.exports = pipeSplitter\n","// every value in {{tmpl|a|b|c}} needs a name\n// here we come up with names for them\nconst hasKey = /^[a-z0-9\\u00C0-\\u00FF\\._\\- '()œ]+=/iu\n\n//templates with these properties are asking for trouble\nconst reserved = {\n template: true,\n list: true,\n prototype: true\n}\n\n//turn 'key=val' into {key:key, val:val}\nconst parseKey = function(str) {\n let parts = str.split('=')\n let key = parts[0] || ''\n key = key.toLowerCase().trim()\n let val = parts.slice(1).join('=')\n //don't let it be called 'template'..\n if (reserved.hasOwnProperty(key)) {\n key = '_' + key\n }\n return {\n key: key,\n val: val.trim()\n }\n}\n\n//turn [a, b=v, c] into {'1':a, b:v, '2':c}\nconst keyMaker = function(arr, order) {\n let o = 0\n return arr.reduce((h, str) => {\n str = (str || '').trim()\n //support named keys - 'foo=bar'\n if (hasKey.test(str) === true) {\n let res = parseKey(str)\n if (res.key) {\n h[res.key] = res.val\n return h\n }\n }\n //try a key from given 'order' names\n if (order && order[o]) {\n let key = order[o] //here goes!\n h[key] = str\n } else {\n h.list = h.list || []\n h.list.push(str)\n }\n o += 1\n return h\n }, {})\n}\n\nmodule.exports = keyMaker\n","const whoCares = {\n classname: true,\n style: true,\n align: true,\n margin: true,\n left: true,\n break: true,\n boxsize: true,\n framestyle: true,\n item_style: true,\n collapsible: true,\n list_style_type: true,\n 'list-style-type': true,\n colwidth: true\n}\n\n//remove wiki-cruft & some styling info from templates\nconst cleanup = function(obj) {\n Object.keys(obj).forEach(k => {\n if (whoCares[k.toLowerCase()] === true) {\n delete obj[k]\n }\n //remove empty values, too\n if (obj[k] === null || obj[k] === '') {\n delete obj[k]\n }\n })\n return obj\n}\nmodule.exports = cleanup\n","//remove the top/bottom off the template\nconst strip = require('./_strip')\nconst fmtName = require('./_fmtName')\nconst parseSentence = require('../../04-sentence').fromText\nconst pipeSplitter = require('./01-pipe-splitter')\nconst keyMaker = require('./02-keyMaker')\nconst cleanup = require('./03-cleanup')\n\n// most templates just want plaintext...\nconst makeFormat = function(str, fmt) {\n let s = parseSentence(str)\n //support various output formats\n if (fmt === 'json') {\n return s.json()\n } else if (fmt === 'raw') {\n return s\n }\n //default to flat text\n return s.text()\n}\n\n//\nconst parser = function(tmpl, order, fmt) {\n order = order || []\n //renomove {{}}'s\n tmpl = strip(tmpl || '')\n let arr = pipeSplitter(tmpl)\n //get template name\n let name = arr.shift()\n //name each value\n let obj = keyMaker(arr, order)\n //remove wiki-junk\n obj = cleanup(obj)\n //is this a infobox/reference?\n // let known = isKnown(obj);\n\n //using '|1=content' is an escaping-thing..\n if (obj['1'] && order[0] && obj.hasOwnProperty(order[0]) === false) {\n //move it over..\n obj[order[0]] = obj['1']\n delete obj['1']\n }\n\n Object.keys(obj).forEach(k => {\n if (k === 'list') {\n obj[k] = obj[k].map(v => makeFormat(v, fmt))\n return\n }\n obj[k] = makeFormat(obj[k], fmt)\n })\n //add the template name\n if (name) {\n obj.template = fmtName(name)\n }\n return obj\n}\nmodule.exports = parser\n","//also called 'citations'\nconst Reference = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n title: function() {\n let data = this.data\n return data.title || data.encyclopedia || data.author || ''\n },\n links: function(n) {\n let arr = []\n if (typeof n === 'number') {\n return arr[n]\n }\n //grab a specific link..\n if (typeof n === 'number') {\n return arr[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = arr.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return arr || []\n },\n text: function() {\n return '' //nah, skip these.\n },\n\n json: function() {\n return this.data\n }\n}\nObject.keys(methods).forEach(k => {\n Reference.prototype[k] = methods[k]\n})\nmodule.exports = Reference\n","const parse = require('../template/_parsers/parse')\n// const parse = require('../../templates/wikipedia/page').citation;\nconst parseSentence = require('../04-sentence').fromText\nconst Reference = require('./Reference')\n\n//structured Cite templates - {{Cite..\nconst hasCitation = function(str) {\n return /^ *?\\{\\{ *?(cite|citation)/i.test(str) && /\\}\\} *?$/.test(str) && /citation needed/i.test(str) === false\n}\n\nconst parseCitation = function(tmpl) {\n let obj = parse(tmpl)\n obj.type = obj.template.replace(/cite /, '')\n obj.template = 'citation'\n return obj\n}\n\n//handle unstructured ones - some text\nconst parseInline = function(str) {\n let obj = parseSentence(str) || {}\n return {\n template: 'citation',\n type: 'inline',\n data: {},\n inline: obj\n }\n}\n\n// parse xml tags\nconst parseRefs = function(section) {\n let references = []\n let wiki = section.wiki\n wiki = wiki.replace(/ ?([\\s\\S]{0,1800}?)<\\/ref> ?/gi, function(a, tmpl) {\n if (hasCitation(tmpl)) {\n let obj = parseCitation(tmpl)\n if (obj) {\n references.push(obj)\n }\n wiki = wiki.replace(tmpl, '')\n } else {\n references.push(parseInline(tmpl))\n }\n return ' '\n })\n // \n wiki = wiki.replace(/ ?]{0,200}?\\/> ?/gi, ' ')\n // \n wiki = wiki.replace(/ ?]{0,200}?>([\\s\\S]{0,1800}?)<\\/ref> ?/gi, function(a, tmpl) {\n if (hasCitation(tmpl)) {\n let obj = parseCitation(tmpl)\n if (obj) {\n references.push(obj)\n }\n wiki = wiki.replace(tmpl, '')\n } else {\n references.push(parseInline(tmpl))\n }\n return ' '\n })\n //now that we're done with xml, do a generic + dangerous xml-tag removal\n wiki = wiki.replace(/ ?<[ \\/]?[a-z0-9]{1,8}[a-z0-9=\" ]{2,20}[ \\/]?> ?/g, ' ') //\n section.references = references.map(r => new Reference(r))\n section.wiki = wiki\n}\nmodule.exports = parseRefs\n","const fns = require('../_lib/helpers')\nconst parseSentence = require('../04-sentence/').fromText\nconst parseReferences = require('../reference/')\nconst heading_reg = /^(={1,5})(.{1,200}?)={1,5}$/\n\n//interpret depth, title of headings like '==See also=='\nconst parseHeading = function(section, str) {\n let m = str.match(heading_reg)\n if (!m) {\n section.title = ''\n section.depth = 0\n return section\n }\n let title = m[2] || ''\n title = parseSentence(title).text()\n //amazingly, you can see inline {{templates}} in this text, too\n //... let's not think about that now.\n title = title.replace(/\\{\\{.+?\\}\\}/, '')\n //same for references (i know..)\n let obj = { wiki: title }\n parseReferences(obj)\n title = obj.wiki\n //trim leading/trailing whitespace\n title = fns.trim_whitespace(title)\n let depth = 0\n if (m[1]) {\n depth = m[1].length - 2\n }\n section.title = title\n section.depth = depth\n return section\n}\nmodule.exports = parseHeading\n","//remove top-bottoms\nconst cleanup = function(lines) {\n lines = lines.filter(line => {\n //a '|+' row is a 'table caption', remove it.\n return line && /^\\|\\+/.test(line) !== true\n })\n if (/^{\\|/.test(lines[0]) === true) {\n lines.shift()\n }\n if (/^\\|}/.test(lines[lines.length - 1]) === true) {\n lines.pop()\n }\n if (/^\\|-/.test(lines[0]) === true) {\n lines.shift()\n }\n return lines\n}\n\n//turn newline seperated into '|-' seperated\nconst findRows = function(lines) {\n let rows = []\n let row = []\n lines = cleanup(lines)\n for (let i = 0; i < lines.length; i += 1) {\n let line = lines[i]\n //'|-' is a row-seperator\n if (/^\\|-/.test(line) === true) {\n //okay, we're done the row\n if (row.length > 0) {\n rows.push(row)\n row = []\n }\n } else {\n //look for '||' inline row-splitter\n line = line.split(/(?:\\|\\||!!)/)\n //support newline -> '||'\n if (!line[0] && line[1]) {\n line.shift()\n }\n line.forEach(l => {\n l = l.replace(/^\\| */, '')\n l = l.trim()\n row.push(l)\n })\n }\n }\n //finish the last one\n if (row.length > 0) {\n rows.push(row)\n }\n return rows\n}\nmodule.exports = findRows\n","const getRowSpan = /.*rowspan *?= *?[\"']?([0-9]+)[\"']?[ \\|]*/\nconst getColSpan = /.*colspan *?= *?[\"']?([0-9]+)[\"']?[ \\|]*/\n\n//colspans stretch ←left/right→\nconst doColSpan = function(rows) {\n rows.forEach(row => {\n row.forEach((str, c) => {\n let m = str.match(getColSpan)\n if (m !== null) {\n let num = parseInt(m[1], 10)\n\n //...maybe if num is so big, and centered, remove it?\n // if (num > 3) {\n // rows[r] = []\n // return\n // }\n //splice-in n empty columns right here\n row[c] = str.replace(getColSpan, '')\n for (let i = 1; i < num; i += 1) {\n row.splice(c + 1, 0, '')\n }\n }\n })\n })\n rows = rows.filter(r => r.length > 0)\n return rows\n}\n\n//colspans stretch up/down\nconst doRowSpan = function(rows) {\n rows.forEach((row, r) => {\n row.forEach((str, c) => {\n let m = str.match(getRowSpan)\n if (m !== null) {\n let num = parseInt(m[1], 10)\n //copy this cell down n rows\n str = str.replace(getRowSpan, '')\n row[c] = str\n for (let i = r + 1; i < r + num; i += 1) {\n if (!rows[i]) {\n break\n }\n rows[i].splice(c, 0, str)\n }\n }\n })\n })\n return rows\n}\n\n//\nconst handleSpans = function(rows) {\n rows = doColSpan(rows)\n rows = doRowSpan(rows)\n return rows\n}\nmodule.exports = handleSpans\n","const parseSentence = require('../../04-sentence/').fromText\nconst findRows = require('./_findRows')\nconst handleSpans = require('./_spans')\nconst isHeading = /^!/\n\n//common ones\nconst headings = {\n name: true,\n age: true,\n born: true,\n date: true,\n year: true,\n city: true,\n country: true,\n population: true,\n count: true,\n number: true\n}\n\n//additional table-cruft to remove before parseLine method\nconst cleanText = function(str) {\n str = parseSentence(str).text()\n //anything before a single-pipe is styling, so remove it\n if (str.match(/\\|/)) {\n str = str.replace(/.+\\| ?/, '') //class=\"unsortable\"|title\n }\n str = str.replace(/style=['\"].*?[\"']/, '')\n //'!' is used as a highlighed-column\n str = str.replace(/^!/, '')\n str = str.trim()\n return str\n}\n\nconst skipSpanRow = function(row) {\n row = row || []\n let len = row.length\n let hasTxt = row.filter(str => str).length\n //does it have 3 empty spaces?\n if (len - hasTxt > 3) {\n return true\n }\n return false\n}\n\n//remove non-header span rows\nconst removeMidSpans = function(rows) {\n rows = rows.filter(row => {\n if (row.length === 1 && row[0] && isHeading.test(row[0]) && /rowspan/i.test(row[0]) === false) {\n return false\n }\n return true\n })\n return rows\n}\n\n//'!' starts a header-row\nconst findHeaders = function(rows = []) {\n let headers = []\n\n // is the first-row just a ton of colspan?\n if (skipSpanRow(rows[0])) {\n rows.shift()\n }\n\n let first = rows[0]\n if (first && first[0] && first[1] && (/^!/.test(first[0]) || /^!/.test(first[1]))) {\n headers = first.map(h => {\n h = h.replace(/^\\! */, '')\n h = cleanText(h)\n return h\n })\n rows.shift()\n }\n //try the second row, too (overwrite first-row, if it exists)\n first = rows[0]\n if (first && first[0] && first[1] && /^!/.test(first[0]) && /^!/.test(first[1])) {\n first.forEach((h, i) => {\n h = h.replace(/^\\! */, '')\n h = cleanText(h)\n if (Boolean(h) === true) {\n headers[i] = h\n }\n })\n rows.shift()\n }\n return headers\n}\n\n//turn headers, array into an object\nconst parseRow = function(arr, headers) {\n let row = {}\n arr.forEach((str, i) => {\n let h = headers[i] || 'col' + (i + 1)\n let s = parseSentence(str)\n s.text(cleanText(s.text()))\n row[h] = s\n })\n return row\n}\n\n//should we use the first row as a the headers?\nconst firstRowHeader = function(rows) {\n if (rows.length <= 3) {\n return []\n }\n let headers = rows[0].slice(0)\n headers = headers.map(h => {\n h = h.replace(/^\\! */, '')\n h = parseSentence(h).text()\n h = cleanText(h)\n h = h.toLowerCase()\n return h\n })\n for (let i = 0; i < headers.length; i += 1) {\n if (headings.hasOwnProperty(headers[i])) {\n rows.shift()\n return headers\n }\n }\n return []\n}\n\n//turn a {|...table string into an array of arrays\nconst parseTable = function(wiki) {\n let lines = wiki\n .replace(/\\r/g, '')\n .replace(/\\n(\\s*[^|!{\\s])/g, ' $1') //remove unecessary newlines\n .split(/\\n/)\n .map(l => l.trim())\n let rows = findRows(lines)\n rows = rows.filter(r => r)\n if (rows.length === 0) {\n return []\n }\n\n //remove non-header span rows\n rows = removeMidSpans(rows)\n //support colspan, rowspan...\n rows = handleSpans(rows)\n //grab the header rows\n let headers = findHeaders(rows)\n if (!headers || headers.length <= 1) {\n headers = firstRowHeader(rows)\n let want = rows[rows.length - 1] || []\n //try the second row\n if (headers.length <= 1 && want.length > 2) {\n headers = firstRowHeader(rows.slice(1))\n if (headers.length > 0) {\n rows = rows.slice(2) //remove them\n }\n }\n }\n //index each column by it's header\n let table = rows.map(arr => {\n return parseRow(arr, headers)\n })\n return table\n}\n\nmodule.exports = parseTable\n","const encode = require('../_lib/encode')\n//\nconst toJson = function(tables, options) {\n return tables.map(table => {\n let row = {}\n Object.keys(table).forEach(k => {\n row[k] = table[k].json() //(they're sentence objects)\n })\n //encode them, for mongodb\n if (options.encode === true) {\n row = encode.encodeObj(row)\n }\n return row\n })\n}\nmodule.exports = toJson\n","const setDefaults = require('../_lib/setDefaults')\nconst toJson = require('./toJson')\nconst defaults = {}\n\nconst Table = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n links(n) {\n let links = []\n this.data.forEach(r => {\n Object.keys(r).forEach(k => {\n links = links.concat(r[k].links())\n })\n })\n //grab a specific link..\n if (typeof n === 'number') {\n return links[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = links.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return links\n },\n keyValue(options) {\n let rows = this.json(options)\n rows.forEach(row => {\n Object.keys(row).forEach(k => {\n row[k] = row[k].text\n })\n })\n return rows\n },\n json(options) {\n options = setDefaults(options, defaults)\n return toJson(this.data, options)\n },\n\n text() {\n return ''\n }\n}\nmethods.keyvalue = methods.keyValue\nmethods.keyval = methods.keyValue\n\nObject.keys(methods).forEach(k => {\n Table.prototype[k] = methods[k]\n})\nmodule.exports = Table\n","const parseTable = require('./parse')\nconst Table = require('./Table')\n// const table_reg = /\\{\\|[\\s\\S]+?\\|\\}/g; //the largest-cities table is ~70kchars.\nconst openReg = /^\\s*{\\|/\nconst closeReg = /^\\s*\\|}/\n\n//tables can be recursive, so looky-here.\nconst findTables = function(section) {\n let list = []\n let wiki = section.wiki\n let lines = wiki.split('\\n')\n let stack = []\n for (let i = 0; i < lines.length; i += 1) {\n //start a table\n if (openReg.test(lines[i]) === true) {\n stack.push(lines[i])\n continue\n }\n //close a table\n if (closeReg.test(lines[i]) === true) {\n stack[stack.length - 1] += '\\n' + lines[i]\n let table = stack.pop()\n list.push(table)\n continue\n }\n //keep-going on one\n if (stack.length > 0) {\n stack[stack.length - 1] += '\\n' + lines[i]\n }\n }\n //work-em together for a Table class\n let tables = []\n list.forEach(str => {\n if (str) {\n //also reremove a newline at the end of the table (awkward)\n wiki = wiki.replace(str + '\\n', '')\n wiki = wiki.replace(str, '')\n let data = parseTable(str)\n if (data && data.length > 0) {\n tables.push(new Table(data))\n }\n }\n })\n\n if (tables.length > 0) {\n section.tables = tables\n }\n section.wiki = wiki\n}\n\nmodule.exports = findTables\n","const setDefaults = require('../_lib/setDefaults')\n\nconst defaults = {\n sentences: true\n}\n\nconst toJson = function(p, options) {\n options = setDefaults(options, defaults)\n let data = {}\n if (options.sentences === true) {\n data.sentences = p.sentences().map(s => s.json(options))\n }\n return data\n}\nmodule.exports = toJson\n","const toJSON = require('./toJson')\nconst setDefaults = require('../_lib/setDefaults')\nconst defaults = {\n sentences: true,\n lists: true,\n images: true\n}\n\nconst Paragraph = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n sentences: function(num) {\n if (typeof num === 'number') {\n return this.data.sentences[num]\n }\n return this.data.sentences || []\n },\n references: function(num) {\n if (typeof num === 'number') {\n return this.data.references[num]\n }\n return this.data.references\n },\n lists: function(num) {\n if (typeof num === 'number') {\n return this.data.lists[num]\n }\n return this.data.lists\n },\n images(num) {\n if (typeof num === 'number') {\n return this.data.images[num]\n }\n return this.data.images || []\n },\n links: function(n) {\n let arr = []\n this.sentences().forEach(s => {\n arr = arr.concat(s.links(n))\n })\n if (typeof n === 'number') {\n return arr[n]\n } else if (typeof n === 'string') {\n //grab a specific link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = arr.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return arr || []\n },\n interwiki(num) {\n let arr = []\n this.sentences().forEach(s => {\n arr = arr.concat(s.interwiki())\n })\n if (typeof num === 'number') {\n return arr[num]\n }\n return arr || []\n },\n text: function(options) {\n options = setDefaults(options, defaults)\n let str = this.sentences()\n .map(s => s.text(options))\n .join(' ')\n this.lists().forEach(list => {\n str += '\\n' + list.text()\n })\n return str\n },\n json: function(options) {\n options = setDefaults(options, defaults)\n return toJSON(this, options)\n }\n}\nmethods.citations = methods.references\nObject.keys(methods).forEach(k => {\n Paragraph.prototype[k] = methods[k]\n})\nmodule.exports = Paragraph\n","//find all the pairs of '[[...[[..]]...]]' in the text\n//used to properly root out recursive template calls, [[.. [[...]] ]]\n//basically just adds open tags, and subtracts closing tags\nconst opener = '['\nconst closer = ']'\nfunction nested_find(text) {\n let out = []\n let last = []\n const chars = text.split('')\n let open = 0\n for (let i = 0; i < chars.length; i++) {\n const c = text[i]\n //increment open tag\n if (c === opener) {\n open += 1\n }\n //decrement close tag\n else if (c === closer) {\n open -= 1\n if (open < 0) {\n open = 0\n }\n } else if (last.length === 0) {\n // If we're not inside of a pair of delimiters, we can discard the current letter.\n // The return of this function is only used to extract images.\n continue\n }\n\n last.push(c)\n if (open === 0 && last.length > 0) {\n //first, fix botched parse\n let open_count = 0\n let close_count = 0\n for (let j = 0; j < last.length; j++) {\n if (last[j] === opener) {\n open_count++\n } else if (last[j] === closer) {\n close_count++\n }\n }\n //is it botched?\n if (open_count > close_count) {\n last.push(closer)\n }\n //looks good, keep it\n out.push(last.join(''))\n last = []\n }\n }\n return out\n}\nmodule.exports = nested_find\n","const i18n = require('../_data/i18n')\nconst Image = require('./Image')\nconst parseTemplate = require('../template/_parsers/parse')\nconst parseSentence = require('../04-sentence').fromText\nconst nested_find = require('./nested_find')\n//regexes:\nconst isFile = new RegExp('(' + i18n.images.join('|') + '):', 'i')\nlet fileNames = `(${i18n.images.join('|')})`\nconst file_reg = new RegExp(fileNames + ':(.+?)[\\\\||\\\\]]', 'iu')\n\n//style directives for Wikipedia:Extended_image_syntax\nconst imgLayouts = {\n thumb: true,\n thumbnail: true,\n border: true,\n right: true,\n left: true,\n center: true,\n top: true,\n bottom: true,\n none: true,\n upright: true,\n baseline: true,\n middle: true,\n sub: true,\n super: true\n}\n\n//images are usually [[image:my_pic.jpg]]\nconst oneImage = function(img) {\n let m = img.match(file_reg)\n if (m === null || !m[2]) {\n return null\n }\n let file = `${m[1]}:${m[2] || ''}`\n file = file.trim()\n //titlecase it\n let title = file.charAt(0).toUpperCase() + file.substring(1)\n //spaces to underscores\n title = title.replace(/ /g, '_')\n if (title) {\n let obj = {\n file: file\n }\n //try to grab other metadata, too\n img = img.replace(/^\\[\\[/, '')\n img = img.replace(/\\]\\]$/, '')\n\n //https://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax\n // - [[File:Name|Type|Border|Location|Alignment|Size|link=Link|alt=Alt|lang=Langtag|Caption]]\n let imgData = parseTemplate(img)\n let arr = imgData.list || []\n //parse-out alt text, if explicitly given\n if (imgData.alt) {\n obj.alt = imgData.alt\n }\n //remove 'thumb' and things\n arr = arr.filter(str => imgLayouts.hasOwnProperty(str) === false)\n if (arr[arr.length - 1]) {\n obj.caption = parseSentence(arr[arr.length - 1])\n }\n return new Image(obj, img)\n }\n return null\n}\n\nconst parseImages = function(paragraph) {\n let wiki = paragraph.wiki\n\n //parse+remove scary '[[ [[]] ]]' stuff\n let matches = nested_find(wiki)\n matches.forEach(function(s) {\n if (isFile.test(s) === true) {\n paragraph.images = paragraph.images || []\n let img = oneImage(s)\n if (img) {\n paragraph.images.push(img)\n }\n wiki = wiki.replace(s, '')\n }\n })\n paragraph.wiki = wiki\n}\nmodule.exports = parseImages\n","const setDefaults = require('../_lib/setDefaults')\nconst defaults = {}\n\nconst toText = (list, options) => {\n return list\n .map(s => {\n let str = s.text(options)\n return ' * ' + str\n })\n .join('\\n')\n}\n\nconst List = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\n\nconst methods = {\n lines() {\n return this.data\n },\n links(n) {\n let links = []\n this.lines().forEach(s => {\n links = links.concat(s.links())\n })\n if (typeof n === 'number') {\n return links[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = links.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return links\n },\n json(options) {\n options = setDefaults(options, defaults)\n return this.lines().map(s => s.json(options))\n },\n text() {\n return toText(this.data)\n }\n}\n\nObject.keys(methods).forEach(k => {\n List.prototype[k] = methods[k]\n})\nmodule.exports = List\n","const List = require('./List')\nconst parseSentence = require('../04-sentence/').fromText\nconst list_reg = /^[#\\*:;\\|]+/\nconst bullet_reg = /^\\*+[^:,\\|]{4}/\nconst number_reg = /^ ?\\#[^:,\\|]{4}/\nconst has_word = /[a-z_0-9\\]\\}]/i\n\n// does it start with a bullet point or something?\nconst isList = function(line) {\n return list_reg.test(line) || bullet_reg.test(line) || number_reg.test(line)\n}\n\n//make bullets/numbers into human-readable *'s\nconst cleanList = function(list) {\n let number = 1\n list = list.filter(l => l)\n for (let i = 0; i < list.length; i++) {\n let line = list[i]\n //add # numberings formatting\n if (line.match(number_reg)) {\n line = line.replace(/^ ?#*/, number + ') ')\n line = line + '\\n'\n number += 1\n } else if (line.match(list_reg)) {\n number = 1\n line = line.replace(list_reg, '')\n }\n list[i] = parseSentence(line)\n }\n return list\n}\n\nconst grabList = function(lines, i) {\n let sub = []\n for (let o = i; o < lines.length; o++) {\n if (isList(lines[o])) {\n sub.push(lines[o])\n } else {\n break\n }\n }\n sub = sub.filter(a => a && has_word.test(a))\n sub = cleanList(sub)\n return sub\n}\n\nconst parseList = function(paragraph) {\n let wiki = paragraph.wiki\n let lines = wiki.split(/\\n/g)\n // lines = lines.filter(l => has_word.test(l));\n let lists = []\n let theRest = []\n for (let i = 0; i < lines.length; i++) {\n if (isList(lines[i]) && lines[i + 1] && isList(lines[i + 1])) {\n let sub = grabList(lines, i)\n if (sub.length > 0) {\n lists.push(sub)\n i += sub.length - 1\n }\n } else {\n theRest.push(lines[i])\n }\n }\n paragraph.lists = lists.map(l => new List(l))\n paragraph.wiki = theRest.join('\\n')\n}\nmodule.exports = parseList\n","const Paragraph = require('./Paragraph')\nconst parseSentences = require('../04-sentence').byParagraph\n\nconst twoNewLines = /\\r?\\n\\r?\\n/\nconst parse = {\n image: require('../image'),\n list: require('../list')\n}\n\nconst parseParagraphs = function(section) {\n let wiki = section.wiki\n let paragraphs = wiki.split(twoNewLines)\n //don't create empty paragraphs\n paragraphs = paragraphs.filter(p => p && p.trim().length > 0)\n paragraphs = paragraphs.map(str => {\n let paragraph = {\n wiki: str,\n lists: [],\n sentences: [],\n images: []\n }\n //parse the lists\n parse.list(paragraph)\n // parse images\n parse.image(paragraph)\n //parse the sentences\n parseSentences(paragraph)\n return new Paragraph(paragraph)\n })\n section.wiki = wiki\n section.paragraphs = paragraphs\n}\nmodule.exports = parseParagraphs\n","const encode = require('../_lib/encode')\n\n//turn an infobox into some nice json\nconst toJson = function(infobox, options) {\n let json = Object.keys(infobox.data).reduce((h, k) => {\n if (infobox.data[k]) {\n h[k] = infobox.data[k].json()\n }\n return h\n }, {})\n\n //support mongo-encoding keys\n if (options.encode === true) {\n json = encode.encodeObj(json)\n }\n return json\n}\nmodule.exports = toJson\n","const toJson = require('./toJson')\nconst Image = require('../image/Image')\n\nconst normalize = str => {\n str = str.toLowerCase()\n str = str.replace(/[-_]/g, ' ')\n return str.trim()\n}\n\n//a formal key-value data table about a topic\nconst Infobox = function(obj) {\n this._type = obj.type\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: obj.data\n })\n}\n\nconst methods = {\n type: function() {\n return this._type\n },\n links: function(n) {\n let arr = []\n Object.keys(this.data).forEach(k => {\n this.data[k].links().forEach(l => arr.push(l))\n })\n if (typeof n === 'number') {\n return arr[n]\n } else if (typeof n === 'string') {\n //grab a link like .links('Fortnight')\n n = n.charAt(0).toUpperCase() + n.substring(1) //titlecase it\n let link = arr.find(o => o.page() === n)\n return link === undefined ? [] : [link]\n }\n return arr\n },\n image: function() {\n let s = this.get('image') || this.get('image2') || this.get('logo')\n if (!s) {\n return null\n }\n let obj = s.json()\n obj.file = obj.text\n obj.text = ''\n return new Image(obj)\n },\n get: function(key = '') {\n key = normalize(key)\n let keys = Object.keys(this.data)\n for (let i = 0; i < keys.length; i += 1) {\n let tmp = normalize(keys[i])\n if (key === tmp) {\n return this.data[keys[i]]\n }\n }\n return null\n },\n text: function() {\n return ''\n },\n json: function(options) {\n options = options || {}\n return toJson(this, options)\n },\n keyValue: function() {\n return Object.keys(this.data).reduce((h, k) => {\n if (this.data[k]) {\n h[k] = this.data[k].text()\n }\n return h\n }, {})\n }\n}\n//aliases\n\nObject.keys(methods).forEach(k => {\n Infobox.prototype[k] = methods[k]\n})\nInfobox.prototype.data = Infobox.prototype.keyValue\nInfobox.prototype.template = Infobox.prototype.type\nInfobox.prototype.images = Infobox.prototype.image\nmodule.exports = Infobox\n","const open = '{'\nconst close = '}'\n\n//grab all first-level recursions of '{{...}}'\nconst findFlat = function(wiki) {\n let depth = 0\n let list = []\n let carry = []\n for (let i = wiki.indexOf(open); i !== -1 && i < wiki.length; depth > 0 ? i++ : (i = wiki.indexOf(open, i + 1))) {\n let c = wiki[i]\n //open it\n if (c === open) {\n depth += 1\n }\n //close it\n if (depth > 0) {\n if (c === close) {\n depth -= 1\n if (depth === 0) {\n carry.push(c)\n let tmpl = carry.join('')\n carry = []\n //last check\n if (/\\{\\{/.test(tmpl) && /\\}\\}/.test(tmpl)) {\n list.push(tmpl)\n }\n continue\n }\n }\n //require two '{{' to open it\n if (depth === 1 && c !== open && c !== close) {\n depth = 0\n carry = []\n continue\n }\n carry.push(c)\n }\n }\n return list\n}\nmodule.exports = findFlat\n","const fmtName = require('./_fmtName')\n//get the name of the template\n//templates are usually '{{name|stuff}}'\nconst getName = function(tmpl) {\n let name = null\n //{{name|foo}}\n if (/^\\{\\{[^\\n]+\\|/.test(tmpl)) {\n name = (tmpl.match(/^\\{\\{(.+?)\\|/) || [])[1]\n } else if (tmpl.indexOf('\\n') !== -1) {\n // {{name \\n...\n name = (tmpl.match(/^\\{\\{(.+?)\\n/) || [])[1]\n } else {\n //{{name here}}\n name = (tmpl.match(/^\\{\\{(.+?)\\}\\}$/) || [])[1]\n }\n if (name) {\n name = name.replace(/:.*/, '')\n name = fmtName(name)\n }\n return name || null\n}\nmodule.exports = getName\n","const findFlat = require('./flat')\nconst getName = require('../_parsers/_getName')\nconst hasTemplate = /\\{\\{/\n\nconst parseTemplate = function(tmpl) {\n return {\n body: tmpl,\n name: getName(tmpl),\n children: []\n }\n}\n\nconst doEach = function(obj) {\n // peel-off top-level\n let wiki = obj.body.substr(2)\n wiki = wiki.replace(/\\}\\}$/, '')\n\n // get our child templates\n obj.children = findFlat(wiki)\n obj.children = obj.children.map(parseTemplate)\n\n if (obj.children.length === 0) {\n return obj\n }\n // recurse through children\n obj.children.forEach(ch => {\n let inside = ch.body.substr(2)\n if (hasTemplate.test(inside)) {\n return doEach(ch) //keep going\n }\n return null\n })\n return obj\n}\n\n// return a nested structure of all templates\nconst findTemplates = function(wiki) {\n let list = findFlat(wiki)\n list = list.map(parseTemplate)\n list = list.map(doEach)\n return list\n}\n\nmodule.exports = findTemplates\n","//we explicitly ignore these, because they sometimes have resolve some data\nconst list = [\n //https://en.wikipedia.org/wiki/category:templates_with_no_visible_output\n 'anchor',\n 'defaultsort',\n 'use list-defined references',\n 'void',\n //https://en.wikipedia.org/wiki/Category:Protection_templates\n 'pp',\n 'pp-move-indef',\n 'pp-semi-indef',\n 'pp-vandalism',\n //https://en.wikipedia.org/wiki/Template:R\n 'r',\n //out-of-scope still - https://en.wikipedia.org/wiki/Template:Tag\n '#tag',\n //https://en.wikipedia.org/wiki/Template:Navboxes\n 'navboxes',\n 'reflist',\n 'ref-list',\n 'div col',\n // 'authority control',\n //https://en.wikipedia.org/wiki/Template:Citation_needed\n // 'better source',\n // 'citation needed',\n // 'clarify',\n // 'cite quote',\n // 'dead link',\n // 'by whom',\n // 'dubious',\n // 'when',\n // 'who',\n // 'quantify',\n // 'refimprove',\n // 'weasel inline',\n //https://en.wikipedia.org/wiki/Template:End\n 'pope list end',\n 'shipwreck list end',\n 'starbox end',\n 'end box',\n 'end',\n 's-end'\n]\nconst ignore = list.reduce((h, str) => {\n h[str] = true\n return h\n}, {})\nmodule.exports = ignore\n","const i18n = require('../_data/i18n')\nconst i18nReg = new RegExp('^(subst.)?(' + i18n.infoboxes.join('|') + ')[: \\n]', 'i')\n//some looser ones\nconst startReg = /^infobox /i\nconst endReg = / infobox$/i\nconst yearIn = /$Year in [A-Z]/i\n\n//some known ones from\n// https://en.wikipedia.org/wiki/Wikipedia:List_of_infoboxes\n// and https://en.wikipedia.org/wiki/Category:Infobox_templates\nconst known = {\n 'gnf protein box': true,\n 'automatic taxobox': true,\n 'chembox ': true,\n editnotice: true,\n geobox: true,\n hybridbox: true,\n ichnobox: true,\n infraspeciesbox: true,\n mycomorphbox: true,\n oobox: true,\n 'paraphyletic group': true,\n speciesbox: true,\n subspeciesbox: true,\n 'starbox short': true,\n taxobox: true,\n nhlteamseason: true,\n 'asian games bid': true,\n 'canadian federal election results': true,\n 'dc thomson comic strip': true,\n 'daytona 24 races': true,\n edencharacter: true,\n 'moldova national football team results': true,\n samurai: true,\n protein: true,\n 'sheet authority': true,\n 'order-of-approx': true,\n 'bacterial labs': true,\n 'medical resources': true,\n ordination: true,\n 'hockey team coach': true,\n 'hockey team gm': true,\n 'hockey team player': true,\n 'hockey team start': true,\n mlbbioret: true\n}\n//\nconst isInfobox = function(name) {\n // known\n if (known.hasOwnProperty(name) === true) {\n return true\n }\n if (i18nReg.test(name)) {\n return true\n }\n if (startReg.test(name) || endReg.test(name)) {\n return true\n }\n //these are also infoboxes: 'Year in Belarus'\n if (yearIn.test(name)) {\n return true\n }\n return false\n}\n\n//turns template data into good inforbox data\nconst fmtInfobox = function(obj = {}) {\n let m = obj.template.match(i18nReg)\n let type = obj.template\n if (m && m[0]) {\n type = type.replace(m[0], '')\n }\n type = type.trim()\n let infobox = {\n template: 'infobox',\n type: type,\n data: obj\n }\n delete infobox.data.template // already have this.\n delete infobox.data.list //just in case!\n return infobox\n}\n\nmodule.exports = {\n isInfobox: isInfobox,\n format: fmtInfobox\n}\n","module.exports = [\n undefined, //1-based months.. :/\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n]\n","//assorted parsing methods for date/time templates\nconst months = require('./_months')\n\nconst monthName = months.reduce((h, str, i) => {\n if (i === 0) {\n return h\n }\n h[str.toLowerCase()] = i\n return h\n}, {})\n\n//parse year|month|date numbers\nconst ymd = function(arr) {\n let obj = {}\n let units = ['year', 'month', 'date', 'hour', 'minute', 'second']\n //parse each unit in sequence..\n for (let i = 0; i < units.length; i += 1) {\n //skip it\n if (!arr[i] && arr[1] !== 0) {\n continue\n }\n let num = parseInt(arr[i], 10)\n if (isNaN(num) === false) {\n obj[units[i]] = num //we good.\n } else if (units[i] === 'month' && monthName.hasOwnProperty(arr[i])) {\n //try for month-name, like 'january\n let month = monthName[arr[i]]\n obj[units[i]] = month\n } else {\n //we dead. so skip this unit\n delete obj[units[i]]\n }\n }\n //try for timezone,too ftw\n let last = arr[arr.length - 1] || ''\n last = String(last)\n if (last.toLowerCase() === 'z') {\n obj.tz = 'UTC'\n } else if (/[+-][0-9]+:[0-9]/.test(last)) {\n obj.tz = arr[6]\n }\n return obj\n}\n\n//zero-pad a number\nconst pad = function(num) {\n if (num < 10) {\n return '0' + num\n }\n return String(num)\n}\n\nconst toText = function(date) {\n //eg '1995'\n let str = String(date.year || '')\n if (date.month !== undefined && months.hasOwnProperty(date.month) === true) {\n if (date.date === undefined) {\n //January 1995\n str = `${months[date.month]} ${date.year}`\n } else {\n //January 5, 1995\n str = `${months[date.month]} ${date.date}, ${date.year}`\n //add times, if available\n if (date.hour !== undefined && date.minute !== undefined) {\n let time = `${pad(date.hour)}:${pad(date.minute)}`\n if (date.second !== undefined) {\n time = time + ':' + pad(date.second)\n }\n str = time + ', ' + str\n //add timezone, if there, at the end in brackets\n }\n if (date.tz) {\n str += ` (${date.tz})`\n }\n }\n }\n return str\n}\n\nmodule.exports = {\n toText: toText,\n ymd: ymd\n}\n\n// console.log(toText(ymd([2018, 3, 28])));\n","const format = require('./_format')\nconst parse = require('../../_parsers/parse')\n\nconst misc = {\n reign: tmpl => {\n let order = ['start', 'end']\n let obj = parse(tmpl, order)\n return `(r. ${obj.start} – ${obj.end})`\n },\n circa: tmpl => {\n let obj = parse(tmpl, ['year'])\n return `c. ${obj.year}`\n },\n //we can't do timezones, so fake this one a little bit\n //https://en.wikipedia.org/wiki/Template:Time\n time: () => {\n let d = new Date()\n let obj = format.ymd([d.getFullYear(), d.getMonth(), d.getDate()])\n return format.toText(obj)\n },\n monthname: 0,\n //https://en.wikipedia.org/wiki/Template:OldStyleDate\n oldstyledate: tmpl => {\n let order = ['date', 'year']\n let obj = parse(tmpl, order)\n let str = obj.date\n if (obj.year) {\n str += ' ' + obj.year\n }\n return str\n }\n}\nmodule.exports = misc\n","//this is allowed to be rough\nconst day = 1000 * 60 * 60 * 24\nconst month = day * 30\nconst year = day * 365\n\nconst getEpoch = function(obj) {\n return new Date(`${obj.year}-${obj.month || 0}-${obj.date || 1}`).getTime()\n}\n\n//very rough!\nconst delta = function(from, to) {\n from = getEpoch(from)\n to = getEpoch(to)\n let diff = to - from\n let obj = {}\n //get years\n let years = Math.floor(diff / year, 10)\n if (years > 0) {\n obj.years = years\n diff -= obj.years * year\n }\n //get months\n let months = Math.floor(diff / month, 10)\n if (months > 0) {\n obj.months = months\n diff -= obj.months * month\n }\n //get days\n let days = Math.floor(diff / day, 10)\n if (days > 0) {\n obj.days = days\n // diff -= (obj.days * day);\n }\n return obj\n}\n\nmodule.exports = delta\n","const strip = require('../../_parsers/_strip')\nconst parse = require('../../_parsers/parse')\nconst delta = require('./_delta')\nconst fmt = require('./_format')\nconst ymd = fmt.ymd\nconst toText = fmt.toText\n\n//wrap it up as a template\nconst template = function(date) {\n return {\n template: 'date',\n data: date\n }\n}\n\nconst getBoth = function(tmpl) {\n tmpl = strip(tmpl)\n let arr = tmpl.split('|')\n let from = ymd(arr.slice(1, 4))\n let to = arr.slice(4, 7)\n //assume now, if 'to' is empty\n if (to.length === 0) {\n let d = new Date()\n to = [d.getFullYear(), d.getMonth(), d.getDate()]\n }\n to = ymd(to)\n return {\n from: from,\n to: to\n }\n}\n\nconst parsers = {\n //generic {{date|year|month|date}} template\n date: (tmpl, list) => {\n let order = ['year', 'month', 'date', 'hour', 'minute', 'second', 'timezone']\n let obj = parse(tmpl, order)\n let data = ymd([obj.year, obj.month, obj.date || obj.day])\n obj.text = toText(data) //make the replacement string\n if (obj.timezone) {\n if (obj.timezone === 'Z') {\n obj.timezone = 'UTC'\n }\n obj.text += ` (${obj.timezone})`\n }\n if (obj.hour && obj.minute) {\n if (obj.second) {\n obj.text = `${obj.hour}:${obj.minute}:${obj.second}, ` + obj.text\n } else {\n obj.text = `${obj.hour}:${obj.minute}, ` + obj.text\n }\n }\n if (obj.text) {\n list.push(template(obj))\n }\n return obj.text\n },\n\n //support parsing of 'February 10, 1992'\n natural_date: (tmpl, list) => {\n let order = ['text']\n let obj = parse(tmpl, order)\n let str = obj.text || ''\n // - just a year\n let date = {}\n if (/^[0-9]{4}$/.test(str)) {\n date.year = parseInt(str, 10)\n } else {\n //parse the date, using the js date object (for now?)\n let txt = str.replace(/[a-z]+\\/[a-z]+/i, '')\n txt = txt.replace(/[0-9]+:[0-9]+(am|pm)?/i, '')\n let d = new Date(txt)\n if (isNaN(d.getTime()) === false) {\n date.year = d.getFullYear()\n date.month = d.getMonth() + 1\n date.date = d.getDate()\n }\n }\n list.push(template(date))\n return str.trim()\n },\n\n //just grab the first value, and assume it's a year\n one_year: (tmpl, list) => {\n let order = ['year']\n let obj = parse(tmpl, order)\n let year = Number(obj.year)\n list.push(\n template({\n year: year\n })\n )\n return String(year)\n },\n\n //assume 'y|m|d' | 'y|m|d' // {{BirthDeathAge|B|1976|6|6|1990|8|8}}\n two_dates: (tmpl, list) => {\n let order = [\n 'b',\n 'birth_year',\n 'birth_month',\n 'birth_date',\n 'death_year',\n 'death_month',\n 'death_date'\n ]\n let obj = parse(tmpl, order)\n //'b' means show birth-date, otherwise show death-date\n if (obj.b && obj.b.toLowerCase() === 'b') {\n let date = ymd([obj.birth_year, obj.birth_month, obj.birth_date])\n list.push(template(date))\n return toText(date)\n }\n let date = ymd([obj.death_year, obj.death_month, obj.death_date])\n list.push(template(date))\n return toText(date)\n },\n\n age: tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n return diff.years || 0\n },\n\n 'diff-y': tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n if (diff.years === 1) {\n return diff.years + ' year'\n }\n return (diff.years || 0) + ' years'\n },\n 'diff-ym': tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n let arr = []\n if (diff.years === 1) {\n arr.push(diff.years + ' year')\n } else if (diff.years && diff.years !== 0) {\n arr.push(diff.years + ' years')\n }\n if (diff.months === 1) {\n arr.push('1 month')\n } else if (diff.months && diff.months !== 0) {\n arr.push(diff.months + ' months')\n }\n return arr.join(', ')\n },\n 'diff-ymd': tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n let arr = []\n if (diff.years === 1) {\n arr.push(diff.years + ' year')\n } else if (diff.years && diff.years !== 0) {\n arr.push(diff.years + ' years')\n }\n if (diff.months === 1) {\n arr.push('1 month')\n } else if (diff.months && diff.months !== 0) {\n arr.push(diff.months + ' months')\n }\n if (diff.days === 1) {\n arr.push('1 day')\n } else if (diff.days && diff.days !== 0) {\n arr.push(diff.days + ' days')\n }\n return arr.join(', ')\n },\n 'diff-yd': tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n let arr = []\n if (diff.years === 1) {\n arr.push(diff.years + ' year')\n } else if (diff.years && diff.years !== 0) {\n arr.push(diff.years + ' years')\n }\n //ergh...\n diff.days += (diff.months || 0) * 30\n if (diff.days === 1) {\n arr.push('1 day')\n } else if (diff.days && diff.days !== 0) {\n arr.push(diff.days + ' days')\n }\n return arr.join(', ')\n },\n 'diff-d': tmpl => {\n let d = getBoth(tmpl)\n let diff = delta(d.from, d.to)\n let arr = []\n //ergh...\n diff.days += (diff.years || 0) * 365\n diff.days += (diff.months || 0) * 30\n if (diff.days === 1) {\n arr.push('1 day')\n } else if (diff.days && diff.days !== 0) {\n arr.push(diff.days + ' days')\n }\n return arr.join(', ')\n }\n}\nmodule.exports = parsers\n","//not all too fancy - used in {{timesince}}\nconst timeSince = function(str) {\n let d = new Date(str)\n if (isNaN(d.getTime())) {\n return ''\n }\n let now = new Date()\n let delta = now.getTime() - d.getTime()\n let predicate = 'ago'\n if (delta < 0) {\n predicate = 'from now'\n delta = Math.abs(delta)\n }\n //figure out units\n let hours = delta / 1000 / 60 / 60\n let days = hours / 24\n if (days < 365) {\n return parseInt(days, 10) + ' days ' + predicate\n }\n let years = days / 365\n return parseInt(years, 10) + ' years ' + predicate\n}\nmodule.exports = timeSince\n","const misc = require('./misc')\nconst parsers = require('./parsers')\nconst parse = require('../../_parsers/parse')\nconst timeSince = require('./_timeSince')\nconst format = require('./_format')\nconst date = parsers.date\nconst natural_date = parsers.natural_date\n\nconst months = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n]\nconst days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n\n//date- templates we support\nlet dateTmpl = Object.assign({}, misc, {\n currentday: () => {\n let d = new Date()\n return String(d.getDate())\n },\n currentdayname: () => {\n let d = new Date()\n return days[d.getDay()]\n },\n currentmonth: () => {\n let d = new Date()\n return months[d.getMonth()]\n },\n currentyear: () => {\n let d = new Date()\n return String(d.getFullYear())\n },\n monthyear: () => {\n let d = new Date()\n return months[d.getMonth()] + ' ' + d.getFullYear()\n },\n 'monthyear-1': () => {\n let d = new Date()\n d.setMonth(d.getMonth() - 1)\n return months[d.getMonth()] + ' ' + d.getFullYear()\n },\n 'monthyear+1': () => {\n let d = new Date()\n d.setMonth(d.getMonth() + 1)\n return months[d.getMonth()] + ' ' + d.getFullYear()\n },\n //Explictly-set dates - https://en.wikipedia.org/wiki/Template:Date\n date: 0,\n 'time ago': tmpl => {\n let order = ['date', 'fmt']\n let time = parse(tmpl, order).date\n return timeSince(time)\n },\n //https://en.wikipedia.org/wiki/Template:Birth_date_and_age\n 'birth date and age': (tmpl, list) => {\n let order = ['year', 'month', 'day']\n let obj = parse(tmpl, order)\n //support 'one property' version\n if (obj.year && /[a-z]/i.test(obj.year)) {\n return natural_date(tmpl, list)\n }\n list.push(obj)\n obj = format.ymd([obj.year, obj.month, obj.day])\n return format.toText(obj)\n },\n 'birth year and age': (tmpl, list) => {\n let order = ['birth_year', 'birth_month']\n let obj = parse(tmpl, order)\n //support 'one property' version\n if (obj.death_year && /[a-z]/i.test(obj.death_year)) {\n return natural_date(tmpl, list)\n }\n list.push(obj)\n let age = new Date().getFullYear() - parseInt(obj.birth_year, 10)\n obj = format.ymd([obj.birth_year, obj.birth_month])\n let str = format.toText(obj)\n if (age) {\n str += ` (age ${age})`\n }\n return str\n },\n 'death year and age': (tmpl, list) => {\n let order = ['death_year', 'birth_year', 'death_month']\n let obj = parse(tmpl, order)\n //support 'one property' version\n if (obj.death_year && /[a-z]/i.test(obj.death_year)) {\n return natural_date(tmpl, list)\n }\n list.push(obj)\n obj = format.ymd([obj.death_year, obj.death_month])\n return format.toText(obj)\n },\n //https://en.wikipedia.org/wiki/Template:Birth_date_and_age2\n 'birth date and age2': (tmpl, list) => {\n let order = ['at_year', 'at_month', 'at_day', 'birth_year', 'birth_month', 'birth_day']\n let obj = parse(tmpl, order)\n list.push(obj)\n obj = format.ymd([obj.birth_year, obj.birth_month, obj.birth_day])\n return format.toText(obj)\n },\n //https://en.wikipedia.org/wiki/Template:Birth_based_on_age_as_of_date\n 'birth based on age as of date': (tmpl, list) => {\n let order = ['age', 'year', 'month', 'day']\n let obj = parse(tmpl, order)\n list.push(obj)\n let age = parseInt(obj.age, 10)\n let year = parseInt(obj.year, 10)\n let born = year - age\n if (born && age) {\n return `${born} (age ${obj.age})`\n }\n return `(age ${obj.age})`\n },\n //https://en.wikipedia.org/wiki/Template:Death_date_and_given_age\n 'death date and given age': (tmpl, list) => {\n let order = ['year', 'month', 'day', 'age']\n let obj = parse(tmpl, order)\n list.push(obj)\n obj = format.ymd([obj.year, obj.month, obj.day])\n let str = format.toText(obj)\n if (obj.age) {\n str += ` (age ${obj.age})`\n }\n return str\n },\n //sortable dates -\n dts: tmpl => {\n //remove formatting stuff, ewww\n tmpl = tmpl.replace(/\\|format=[ymd]+/i, '')\n tmpl = tmpl.replace(/\\|abbr=(on|off)/i, '')\n let order = ['year', 'month', 'date', 'bc']\n let obj = parse(tmpl, order)\n if (obj.date && obj.month && obj.year) {\n //render 'june 5 2018'\n if (/[a-z]/.test(obj.month) === true) {\n return [obj.month, obj.date, obj.year].join(' ')\n }\n return [obj.year, obj.month, obj.date].join('-')\n }\n if (obj.month && obj.year) {\n return [obj.year, obj.month].join('-')\n }\n if (obj.year) {\n if (obj.year < 0) {\n obj.year = Math.abs(obj.year) + ' BC'\n }\n return obj.year\n }\n return ''\n },\n //date/age/time templates\n start: date,\n end: date,\n birth: date,\n death: date,\n 'start date': date,\n 'end date': date,\n 'birth date': date,\n 'death date': date,\n 'start date and age': date,\n 'end date and age': date,\n //this is insane (hyphen ones are different)\n 'start-date': natural_date,\n 'end-date': natural_date,\n 'birth-date': natural_date,\n 'death-date': natural_date,\n 'birth-date and age': natural_date,\n 'birth-date and given age': natural_date,\n 'death-date and age': natural_date,\n 'death-date and given age': natural_date,\n\n birthdeathage: parsers.two_dates,\n dob: date,\n // 'birth date and age2': date,\n\n age: parsers.age,\n 'age nts': parsers.age,\n 'age in years': parsers['diff-y'],\n 'age in years and months': parsers['diff-ym'],\n 'age in years, months and days': parsers['diff-ymd'],\n 'age in years and days': parsers['diff-yd'],\n 'age in days': parsers['diff-d']\n // 'age in years, months, weeks and days': true,\n // 'age as of date': true,\n})\n//aliases\ndateTmpl.localday = dateTmpl.currentday\ndateTmpl.localdayname = dateTmpl.currentdayname\ndateTmpl.localmonth = dateTmpl.currentmonth\ndateTmpl.localyear = dateTmpl.currentyear\ndateTmpl.currentmonthname = dateTmpl.currentmonth\ndateTmpl.currentmonthabbrev = dateTmpl.currentmonth\ndateTmpl['death date and age'] = dateTmpl['birth date and age']\ndateTmpl.bda = dateTmpl['birth date and age']\ndateTmpl['birth date based on age at death'] = dateTmpl['birth based on age as of date']\nmodule.exports = dateTmpl\n","const parse = require('../../_parsers/parse')\n\nlet templates = {\n //a convulated way to make a xml tag - https://en.wikipedia.org/wiki/Template:Tag\n tag: tmpl => {\n let obj = parse(tmpl, ['tag', 'open'])\n const ignore = {\n span: true,\n div: true,\n p: true\n }\n //pair, empty, close, single\n if (!obj.open || obj.open === 'pair') {\n //just skip generating spans and things..\n if (ignore[obj.tag]) {\n return obj.content || ''\n }\n return `<${obj.tag} ${obj.attribs || ''}>${obj.content || ''}`\n }\n return ''\n },\n //dumb inflector - https://en.wikipedia.org/wiki/Template:Plural\n plural: tmpl => {\n tmpl = tmpl.replace(/plural:/, 'plural|')\n let order = ['num', 'word']\n let obj = parse(tmpl, order)\n let num = Number(obj.num)\n let word = obj.word\n if (num !== 1) {\n if (/.y$/.test(word)) {\n word = word.replace(/y$/, 'ies')\n } else {\n word += 's'\n }\n }\n return num + ' ' + word\n },\n // https://en.wikipedia.org/wiki/Template:First_word\n 'first word': tmpl => {\n let obj = parse(tmpl, ['text'])\n let str = obj.text\n if (obj.sep) {\n return str.split(obj.sep)[0]\n }\n return str.split(' ')[0]\n },\n trunc: tmpl => {\n let order = ['str', 'len']\n let obj = parse(tmpl, order)\n return obj.str.substr(0, obj.len)\n },\n 'str mid': tmpl => {\n let order = ['str', 'start', 'end']\n let obj = parse(tmpl, order)\n let start = parseInt(obj.start, 10) - 1\n let end = parseInt(obj.end, 10)\n return obj.str.substr(start, end)\n },\n //grab the first, second or third pipe\n p1: 0,\n p2: 1,\n p3: 2,\n //formatting things - https://en.wikipedia.org/wiki/Template:Nobold\n braces: tmpl => {\n let obj = parse(tmpl, ['text'])\n let attrs = ''\n if (obj.list) {\n attrs = '|' + obj.list.join('|')\n }\n return '{{' + (obj.text || '') + attrs + '}}'\n },\n nobold: 0,\n noitalic: 0,\n nocaps: 0,\n syntaxhighlight: (tmpl, list) => {\n let obj = parse(tmpl)\n list.push(obj)\n return obj.code || ''\n },\n samp: (tmpl, list) => {\n let obj = parse(tmpl, ['1'])\n list.push(obj)\n return obj['1'] || ''\n },\n //https://en.wikipedia.org/wiki/Template:Visible_anchor\n vanchor: 0,\n //https://en.wikipedia.org/wiki/Template:Resize\n resize: 1,\n //https://en.wikipedia.org/wiki/Template:Ra\n ra: tmpl => {\n let obj = parse(tmpl, ['hours', 'minutes', 'seconds'])\n return [obj.hours || 0, obj.minutes || 0, obj.seconds || 0].join(':')\n },\n //https://en.wikipedia.org/wiki/Template:Deg2HMS\n deg2hms: tmpl => {\n //this template should do the conversion\n let obj = parse(tmpl, ['degrees'])\n return (obj.degrees || '') + '°'\n },\n hms2deg: tmpl => {\n //this template should do the conversion too\n let obj = parse(tmpl, ['hours', 'minutes', 'seconds'])\n return [obj.hours || 0, obj.minutes || 0, obj.seconds || 0].join(':')\n },\n decdeg: tmpl => {\n //this template should do the conversion too\n let obj = parse(tmpl, ['deg', 'min', 'sec', 'hem', 'rnd'])\n return (obj.deg || obj.degrees) + '°'\n },\n rnd: 0,\n //https://en.wikipedia.org/wiki/Template:DEC\n dec: tmpl => {\n let obj = parse(tmpl, ['degrees', 'minutes', 'seconds'])\n let str = (obj.degrees || 0) + '°'\n if (obj.minutes) {\n str += obj.minutes + `′`\n }\n if (obj.seconds) {\n str += obj.seconds + '″'\n }\n return str\n },\n //https://en.wikipedia.org/wiki/Template:Val\n val: tmpl => {\n let obj = parse(tmpl, ['number', 'uncertainty'])\n let num = obj.number\n if (num && Number(num)) {\n num = Number(num).toLocaleString()\n }\n let str = num || ''\n //prefix/suffix\n if (obj.p) {\n str = obj.p + str\n }\n if (obj.s) {\n str = obj.s + str\n }\n //add units, too\n if (obj.u || obj.ul || obj.upl) {\n str = str + ' ' + (obj.u || obj.ul || obj.upl)\n }\n return str\n }\n}\n\n//aliases\ntemplates['rndfrac'] = templates.rnd\ntemplates['rndnear'] = templates.rnd\ntemplates['unité'] = templates.val\n\n//templates that we simply grab their insides as plaintext\nlet inline = [\n 'nowrap',\n 'nobr',\n 'big',\n 'cquote',\n 'pull quote',\n 'small',\n 'smaller',\n 'midsize',\n 'larger',\n 'big',\n 'kbd',\n 'bigger',\n 'large',\n 'mono',\n 'strongbad',\n 'stronggood',\n 'huge',\n 'xt',\n 'xt2',\n '!xt',\n 'xtn',\n 'xtd',\n 'dc',\n 'dcr',\n 'mxt',\n '!mxt',\n 'mxtn',\n 'mxtd',\n 'bxt',\n '!bxt',\n 'bxtn',\n 'bxtd',\n 'delink', //https://en.wikipedia.org/wiki/Template:Delink\n //half-supported\n 'pre',\n 'var',\n 'mvar',\n 'pre2',\n 'code'\n]\ninline.forEach(k => {\n templates[k] = tmpl => {\n return parse(tmpl, ['text']).text || ''\n }\n})\n\nmodule.exports = templates\n","const strip = require('../../_parsers/_strip')\nconst parse = require('../../_parsers/parse')\n\nconst tmpls = {\n //a strange, newline-based list - https://en.wikipedia.org/wiki/Template:Plainlist\n plainlist: tmpl => {\n tmpl = strip(tmpl)\n //remove the title\n let arr = tmpl.split('|')\n arr = arr.slice(1)\n tmpl = arr.join('|')\n //split on newline\n arr = tmpl.split(/\\n ?\\* ?/)\n arr = arr.filter(s => s)\n return arr.join('\\n\\n')\n },\n\n //show/hide: https://en.wikipedia.org/wiki/Template:Collapsible_list\n 'collapsible list': (tmpl, list) => {\n let obj = parse(tmpl)\n list.push(obj)\n let str = ''\n if (obj.title) {\n str += `'''${obj.title}'''` + '\\n\\n'\n }\n if (!obj.list) {\n obj.list = []\n for (let i = 1; i < 10; i += 1) {\n if (obj[i]) {\n obj.list.push(obj[i])\n delete obj[i]\n }\n }\n }\n obj.list = obj.list.filter(s => s)\n str += obj.list.join('\\n\\n')\n return str\n },\n // https://en.wikipedia.org/wiki/Template:Ordered_list\n 'ordered list': (tmpl, list) => {\n let obj = parse(tmpl)\n list.push(obj)\n obj.list = obj.list || []\n let lines = obj.list.map((str, i) => `${i + 1}. ${str}`)\n return lines.join('\\n\\n')\n },\n hlist: tmpl => {\n let obj = parse(tmpl)\n obj.list = obj.list || []\n return obj.list.join(' · ')\n },\n pagelist: tmpl => {\n let arr = parse(tmpl).list || []\n return arr.join(', ')\n },\n //actually rendering these links removes the text.\n //https://en.wikipedia.org/wiki/Template:Catlist\n catlist: tmpl => {\n let arr = parse(tmpl).list || []\n return arr.join(', ')\n },\n //https://en.wikipedia.org/wiki/Template:Br_separated_entries\n 'br separated entries': tmpl => {\n let arr = parse(tmpl).list || []\n return arr.join('\\n\\n')\n },\n 'comma separated entries': tmpl => {\n let arr = parse(tmpl).list || []\n return arr.join(', ')\n },\n //https://en.wikipedia.org/wiki/Template:Bare_anchored_list\n 'anchored list': tmpl => {\n let arr = parse(tmpl).list || []\n arr = arr.map((str, i) => `${i + 1}. ${str}`)\n return arr.join('\\n\\n')\n },\n 'bulleted list': tmpl => {\n let arr = parse(tmpl).list || []\n arr = arr.filter(f => f)\n arr = arr.map(str => '• ' + str)\n return arr.join('\\n\\n')\n },\n //https://en.wikipedia.org/wiki/Template:Columns-list\n 'columns-list': (tmpl, list) => {\n let arr = parse(tmpl).list || []\n let str = arr[0] || ''\n let lines = str.split(/\\n/)\n lines = lines.filter(f => f)\n lines = lines.map(s => s.replace(/\\*/, ''))\n list.push({\n template: 'columns-list',\n list: lines\n })\n lines = lines.map(s => '• ' + s)\n return lines.join('\\n\\n')\n }\n // 'pagelist':(tmpl)=>{},\n}\n//aliases\ntmpls.flatlist = tmpls.plainlist\ntmpls.ublist = tmpls.plainlist\ntmpls['unbulleted list'] = tmpls['collapsible list']\ntmpls['ubl'] = tmpls['collapsible list']\ntmpls['bare anchored list'] = tmpls['anchored list']\ntmpls['plain list'] = tmpls['plainlist']\ntmpls.cmn = tmpls['columns-list']\ntmpls.collist = tmpls['columns-list']\ntmpls['col-list'] = tmpls['columns-list']\ntmpls.columnslist = tmpls['columns-list']\nmodule.exports = tmpls\n","const parse = require('../../_parsers/parse')\n\nconst inline = {\n //https://en.wikipedia.org/wiki/Template:Convert#Ranges_of_values\n convert: tmpl => {\n let order = ['num', 'two', 'three', 'four']\n let obj = parse(tmpl, order)\n //todo: support plural units\n if (obj.two === '-' || obj.two === 'to' || obj.two === 'and') {\n if (obj.four) {\n return `${obj.num} ${obj.two} ${obj.three} ${obj.four}`\n }\n return `${obj.num} ${obj.two} ${obj.three}`\n }\n return `${obj.num} ${obj.two}`\n },\n //https://en.wikipedia.org/wiki/Template:Term\n term: tmpl => {\n let obj = parse(tmpl, ['term'])\n return `${obj.term}:`\n },\n defn: 0,\n //https://en.wikipedia.org/wiki/Template:Linum\n lino: 0,\n linum: tmpl => {\n let obj = parse(tmpl, ['num', 'text'])\n return `${obj.num}. ${obj.text}`\n },\n //https://en.wikipedia.org/wiki/Template:Interlanguage_link\n ill: tmpl => {\n let order = ['text', 'lan1', 'text1', 'lan2', 'text2']\n let obj = parse(tmpl, order)\n return obj.text\n },\n //https://en.wikipedia.org/wiki/Template:Frac\n frac: tmpl => {\n let order = ['a', 'b', 'c']\n let obj = parse(tmpl, order)\n if (obj.c) {\n return `${obj.a} ${obj.b}/${obj.c}`\n }\n if (obj.b) {\n return `${obj.a}/${obj.b}`\n }\n return `1/${obj.b}`\n },\n //https://en.wikipedia.org/wiki/Template:Height - {{height|ft=6|in=1}}\n height: (tmpl, list) => {\n let obj = parse(tmpl)\n list.push(obj)\n let result = []\n let units = ['m', 'cm', 'ft', 'in'] //order matters\n units.forEach(unit => {\n if (obj.hasOwnProperty(unit) === true) {\n result.push(obj[unit] + unit)\n }\n })\n return result.join(' ')\n },\n 'block indent': tmpl => {\n let obj = parse(tmpl)\n if (obj['1']) {\n return '\\n' + obj['1'] + '\\n'\n }\n return ''\n },\n quote: (tmpl, list) => {\n let order = ['text', 'author']\n let obj = parse(tmpl, order)\n list.push(obj)\n //create plaintext version\n if (obj.text) {\n let str = `\"${obj.text}\"`\n if (obj.author) {\n str += '\\n\\n'\n str += ` - ${obj.author}`\n }\n return str + '\\n'\n }\n return ''\n },\n\n //https://en.wikipedia.org/wiki/Template:Lbs\n lbs: tmpl => {\n let obj = parse(tmpl, ['text'])\n return `[[${obj.text} Lifeboat Station|${obj.text}]]`\n },\n //Foo-class\n lbc: tmpl => {\n let obj = parse(tmpl, ['text'])\n return `[[${obj.text}-class lifeboat|${obj.text}-class]]`\n },\n lbb: tmpl => {\n let obj = parse(tmpl, ['text'])\n return `[[${obj.text}-class lifeboat|${obj.text}]]`\n },\n // https://en.wikipedia.org/wiki/Template:Own\n own: tmpl => {\n let obj = parse(tmpl, ['author'])\n let str = 'Own work'\n if (obj.author) {\n str += ' by ' + obj.author\n }\n return str\n },\n //https://en.wikipedia.org/wiki/Template:Sic\n sic: (tmpl, list) => {\n let obj = parse(tmpl, ['one', 'two', 'three'])\n let word = (obj.one || '') + (obj.two || '')\n //support '[sic?]'\n if (obj.one === '?') {\n word = (obj.two || '') + (obj.three || '')\n }\n list.push({\n template: 'sic',\n word: word\n })\n if (obj.nolink === 'y') {\n return word\n }\n return `${word} [sic]`\n },\n //https://www.mediawiki.org/wiki/Help:Magic_words#Formatting\n formatnum: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['number'])\n let str = obj.number || ''\n str = str.replace(/,/g, '')\n let num = Number(str)\n return num.toLocaleString() || ''\n },\n //https://www.mediawiki.org/wiki/Help:Magic_words#Formatting\n '#dateformat': tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['date', 'format'])\n return obj.date\n },\n //https://www.mediawiki.org/wiki/Help:Magic_words#Formatting\n lc: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text'])\n return (obj.text || '').toLowerCase()\n },\n lcfirst: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text'])\n let text = obj.text\n if (!text) {\n return ''\n }\n return text[0].toLowerCase() + text.substr(1)\n },\n //https://www.mediawiki.org/wiki/Help:Magic_words#Formatting\n uc: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text'])\n return (obj.text || '').toUpperCase()\n },\n ucfirst: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text'])\n let text = obj.text\n if (!text) {\n return ''\n }\n return text[0].toUpperCase() + text.substr(1)\n },\n padleft: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text', 'num'])\n let text = obj.text || ''\n return text.padStart(obj.num, obj.str || '0')\n },\n padright: tmpl => {\n tmpl = tmpl.replace(/:/, '|')\n let obj = parse(tmpl, ['text', 'num'])\n let text = obj.text || ''\n return text.padEnd(obj.num, obj.str || '0')\n },\n //abbreviation/meaning\n //https://en.wikipedia.org/wiki/Template:Abbr\n abbr: tmpl => {\n let obj = parse(tmpl, ['abbr', 'meaning', 'ipa'])\n return obj.abbr\n },\n //https://en.wikipedia.org/wiki/Template:Abbrlink\n abbrlink: tmpl => {\n let obj = parse(tmpl, ['abbr', 'page'])\n if (obj.page) {\n return `[[${obj.page}|${obj.abbr}]]`\n }\n return `[[${obj.abbr}]]`\n },\n //https://en.wikipedia.org/wiki/Template:Hover_title\n //technically 'h:title'\n h: 1,\n //https://en.wikipedia.org/wiki/Template:Finedetail\n finedetail: 0,\n //https://en.wikipedia.org/wiki/Template:Sort\n sort: 1\n}\n\n//aliases\ninline['str left'] = inline.trunc\ninline['str crop'] = inline.trunc\ninline['tooltip'] = inline.abbr\ninline['abbrv'] = inline.abbr\ninline['define'] = inline.abbr\ninline['cvt'] = inline.convert\n\nmodule.exports = inline\n","module.exports = Object.assign({}, require('./format'), require('./lists'), require('./misc'))\n","//converts DMS (decimal-minute-second) geo format to lat/lng format.\n//major thank you to https://github.com/gmaclennan/parse-dms\n//and https://github.com/WSDOT-GIS/dms-js 👏\n\n//accepts an array of descending Degree, Minute, Second values, with a hemisphere at the end\n//must have N/S/E/W as last thing\nfunction parseDms(arr) {\n let hemisphere = arr.pop()\n let degrees = Number(arr[0] || 0)\n let minutes = Number(arr[1] || 0)\n let seconds = Number(arr[2] || 0)\n if (typeof hemisphere !== 'string' || isNaN(degrees)) {\n return null\n }\n let sign = 1\n if (/[SW]/i.test(hemisphere)) {\n sign = -1\n }\n let decDeg = sign * (degrees + minutes / 60 + seconds / 3600)\n return decDeg\n}\nmodule.exports = parseDms\n// console.log(parseDms([57, 18, 22, 'N']));\n// console.log(parseDms([4, 27, 32, 'W']));\n","const convertDMS = require('./dms-format')\nconst parse = require('../../_parsers/parse')\n\nconst round = function(num) {\n if (typeof num !== 'number') {\n return num\n }\n let places = 100000\n return Math.round(num * places) / places\n}\n\n//these hemispheres mean negative decimals\nconst negative = {\n s: true,\n w: true\n}\n\nconst findLatLng = function(arr) {\n const types = arr.map(s => typeof s).join('|')\n //support {{lat|lng}}\n if (arr.length === 2 && types === 'number|number') {\n return {\n lat: arr[0],\n lon: arr[1]\n }\n }\n //support {{dd|N/S|dd|E/W}}\n if (arr.length === 4 && types === 'number|string|number|string') {\n if (negative[arr[1].toLowerCase()]) {\n arr[0] *= -1\n }\n if (arr[3].toLowerCase() === 'w') {\n arr[2] *= -1\n }\n return {\n lat: arr[0],\n lon: arr[2]\n }\n }\n //support {{dd|mm|N/S|dd|mm|E/W}}\n if (arr.length === 6) {\n return {\n lat: convertDMS(arr.slice(0, 3)),\n lon: convertDMS(arr.slice(3))\n }\n }\n //support {{dd|mm|ss|N/S|dd|mm|ss|E/W}}\n if (arr.length === 8) {\n return {\n lat: convertDMS(arr.slice(0, 4)),\n lon: convertDMS(arr.slice(4))\n }\n }\n return {}\n}\n\nconst parseParams = function(obj) {\n obj.list = obj.list || []\n obj.list = obj.list.map(str => {\n let num = Number(str)\n if (!isNaN(num)) {\n return num\n }\n //these are weird\n let split = str.split(/:/)\n if (split.length > 1) {\n obj.props = obj.props || {}\n obj.props[split[0]] = split.slice(1).join(':')\n return null\n }\n return str\n })\n obj.list = obj.list.filter(s => s !== null)\n return obj\n}\n\nconst parseCoor = function(tmpl) {\n let obj = parse(tmpl)\n obj = parseParams(obj)\n let tmp = findLatLng(obj.list)\n obj.lat = round(tmp.lat)\n obj.lon = round(tmp.lon)\n obj.template = 'coord'\n delete obj.list\n return obj\n}\n\nmodule.exports = parseCoor\n// {{Coor title dms|dd|mm|ss|N/S|dd|mm|ss|E/W|template parameters}}\n// {{Coor title dec|latitude|longitude|template parameters}}\n// {{Coor dms|dd|mm|ss|N/S|dd|mm|ss|E/W|template parameters}}\n// {{Coor dm|dd|mm|N/S|dd|mm|E/W|template parameters}}\n// {{Coor dec|latitude|longitude|template parameters}}\n\n// {{coord|latitude|longitude|coordinate parameters|template parameters}}\n// {{coord|dd|N/S|dd|E/W|coordinate parameters|template parameters}}\n// {{coord|dd|mm|N/S|dd|mm|E/W|coordinate parameters|template parameters}}\n// {{coord|dd|mm|ss|N/S|dd|mm|ss|E/W|coordinate parameters|template parameters}}\n","const parseCoor = require('./coor')\n\nconst templates = {\n coord: (tmpl, list) => {\n let obj = parseCoor(tmpl)\n list.push(obj)\n //display inline, by default\n if (!obj.display || obj.display.indexOf('inline') !== -1) {\n return `${obj.lat || ''}°N, ${obj.lon || ''}°W`\n }\n return ''\n },\n //https://en.wikivoyage.org/wiki/Template:Geo\n geo: ['lat', 'lon', 'zoom']\n}\n// {{coord|latitude|longitude|coordinate parameters|template parameters}}\n// {{coord|dd|N/S|dd|E/W|coordinate parameters|template parameters}}\n// {{coord|dd|mm|N/S|dd|mm|E/W|coordinate parameters|template parameters}}\n// {{coord|dd|mm|ss|N/S|dd|mm|ss|E/W|coordinate parameters|template parameters}}\ntemplates['coor'] = templates.coord\n// these are from the nl wiki\ntemplates['coor title dms'] = templates.coord\ntemplates['coor title dec'] = templates.coord\ntemplates['coor dms'] = templates.coord\ntemplates['coor dm'] = templates.coord\ntemplates['coor dec'] = templates.coord\nmodule.exports = templates\n","const parse = require('../../_parsers/parse')\n\nlet templates = {\n /* mostly wiktionary*/\n etyl: 1,\n mention: 1,\n link: 1,\n 'la-verb-form': 0,\n 'la-ipa': 0,\n //https://en.wikipedia.org/wiki/Template:Sortname\n sortname: tmpl => {\n let order = ['first', 'last', 'target', 'sort']\n let obj = parse(tmpl, order)\n let name = `${obj.first || ''} ${obj.last || ''}`\n name = name.trim()\n if (obj.nolink) {\n return obj.target || name\n }\n if (obj.dab) {\n name += ` (${obj.dab})`\n if (obj.target) {\n obj.target += ` (${obj.dab})`\n }\n }\n if (obj.target) {\n return `[[${obj.target}|${name}]]`\n }\n return `[[${name}]]`\n }\n}\n\n//these are insane\n// https://en.wikipedia.org/wiki/Template:Tl\nconst links = [\n 'lts',\n 't',\n 'tfd links',\n 'tiw',\n 'tltt',\n 'tetl',\n 'tsetl',\n 'ti',\n 'tic',\n 'tiw',\n 'tlt',\n 'ttl',\n 'twlh',\n 'tl2',\n 'tlu',\n 'demo',\n 'hatnote',\n 'xpd',\n 'para',\n 'elc',\n 'xtag',\n 'mli',\n 'mlix',\n '#invoke',\n 'url' //https://en.wikipedia.org/wiki/Template:URL\n]\n\n//keyValues\nlinks.forEach(k => {\n templates[k] = tmpl => {\n let order = ['first', 'second']\n let obj = parse(tmpl, order)\n return obj.second || obj.first\n }\n})\n//aliases\ntemplates.m = templates.mention\ntemplates['m-self'] = templates.mention\ntemplates.l = templates.link\ntemplates.ll = templates.link\ntemplates['l-self'] = templates.link\nmodule.exports = templates\n","const parse = require('../../_parsers/parse')\nconst Image = require('../../../image/Image')\n\nconst sisterProjects = {\n wikt: 'wiktionary',\n commons: 'commons',\n c: 'commons',\n commonscat: 'commonscat',\n n: 'wikinews',\n q: 'wikiquote',\n s: 'wikisource',\n a: 'wikiauthor',\n b: 'wikibooks',\n voy: 'wikivoyage',\n v: 'wikiversity',\n d: 'wikidata',\n species: 'wikispecies',\n m: 'meta',\n mw: 'mediawiki'\n}\n\nconst parsers = {\n //https://en.wikipedia.org/wiki/Template:About\n about: (tmpl, list) => {\n let obj = parse(tmpl)\n // obj.pos = r.title //not working\n list.push(obj)\n return ''\n },\n //https://en.wikipedia.org/wiki/Template:Main\n main: (tmpl, list) => {\n let obj = parse(tmpl)\n // obj.pos = r.title //not working\n list.push(obj)\n return ''\n },\n 'wide image': ['file', 'width', 'caption'],\n\n //https://en.wikipedia.org/wiki/Template:Redirect\n redirect: (tmpl, list) => {\n let data = parse(tmpl, ['redirect'])\n let lines = data.list || []\n let links = []\n for (let i = 0; i < lines.length; i += 2) {\n links.push({\n page: lines[i + 1],\n desc: lines[i]\n })\n }\n let obj = {\n template: 'redirect',\n redirect: data.redirect,\n links: links\n }\n list.push(obj)\n return ''\n },\n\n //this one sucks - https://en.wikipedia.org/wiki/Template:GNIS\n 'cite gnis': (tmpl, list) => {\n let order = ['id', 'name', 'type']\n let obj = parse(tmpl, order)\n obj.type = 'gnis'\n obj.template = 'citation'\n list.push(obj)\n return ''\n },\n\n //https://en.wikipedia.org/wiki/Template:Sfn\n sfn: (tmpl, list, alias) => {\n let order = ['author', 'year', 'location']\n let obj = parse(tmpl, order)\n if (alias) {\n obj.name = obj.template\n obj.teplate = alias\n }\n list.push(obj)\n return ''\n },\n\n audio: ['file', 'text', 'type'],\n rp: ['page'],\n\n 'spoken wikipedia': (tmpl, list) => {\n let order = ['file', 'date']\n let obj = parse(tmpl, order)\n obj.template = 'audio'\n list.push(obj)\n return ''\n },\n\n //https://en.wikipedia.org/wiki/Template:Sister_project_links\n 'sister project links': (tmpl, list) => {\n let data = parse(tmpl)\n //rename 'wd' to 'wikidata'\n let links = {}\n Object.keys(sisterProjects).forEach(k => {\n if (data.hasOwnProperty(k) === true) {\n links[sisterProjects[k]] = data[k] //.text();\n }\n })\n let obj = {\n template: 'sister project links',\n links: links\n }\n list.push(obj)\n return ''\n },\n\n //https://en.wikipedia.org/wiki/Template:Subject_bar\n 'subject bar': (tmpl, list) => {\n let data = parse(tmpl)\n Object.keys(data).forEach(k => {\n //rename 'voy' to 'wikivoyage'\n if (sisterProjects.hasOwnProperty(k)) {\n data[sisterProjects[k]] = data[k]\n delete data[k]\n }\n })\n let obj = {\n template: 'subject bar',\n links: data\n }\n list.push(obj)\n return ''\n },\n\n 'short description': ['description'],\n 'coord missing': ['region'],\n //amazingly, this one does not obey any known patterns\n //https://en.wikipedia.org/wiki/Template:Gallery\n gallery: (tmpl, list) => {\n let obj = parse(tmpl)\n let images = (obj.list || []).filter(line => /^ *File ?:/.test(line))\n images = images.map(file => {\n let img = {\n file: file\n }\n return new Image(img).json()\n })\n obj = {\n template: 'gallery',\n images: images\n }\n list.push(obj)\n return ''\n },\n //https://en.wikipedia.org/wiki/Template:See_also\n 'see also': (tmpl, list) => {\n let data = parse(tmpl)\n // data.pos = r.title //not working\n list.push(data)\n return ''\n },\n unreferenced: ['date']\n}\n//aliases\nparsers['cite'] = parsers.citation\nparsers['sfnref'] = parsers.sfn\nparsers['harvid'] = parsers.sfn\nparsers['harvnb'] = parsers.sfn\nparsers['unreferenced section'] = parsers.unreferenced\nparsers['redir'] = parsers.redirect\nparsers['sisterlinks'] = parsers['sister project links']\nparsers['main article'] = parsers['main']\n\nmodule.exports = parsers\n","//random misc for inline wikipedia templates\nconst parse = require('../../_parsers/parse')\n\nconst titlecase = str => {\n return str.charAt(0).toUpperCase() + str.substring(1)\n}\n\n//https://en.wikipedia.org/wiki/Template:Yes\nlet templates = {}\nlet cells = [\n 'rh',\n 'rh2',\n 'yes',\n 'no',\n 'maybe',\n 'eliminated',\n 'lost',\n 'safe',\n 'active',\n 'site active',\n 'coming soon',\n 'good',\n 'won',\n 'nom',\n 'sho',\n 'longlisted',\n 'tba',\n 'success',\n 'operational',\n 'failure',\n 'partial',\n 'regional',\n 'maybecheck',\n 'partial success',\n 'partial failure',\n 'okay',\n 'yes-no',\n 'some',\n 'nonpartisan',\n 'pending',\n 'unofficial',\n 'unofficial2',\n 'usually',\n 'rarely',\n 'sometimes',\n 'any',\n 'varies',\n 'black',\n 'non-album single',\n 'unreleased',\n 'unknown',\n 'perhaps',\n 'depends',\n 'included',\n 'dropped',\n 'terminated',\n 'beta',\n 'table-experimental',\n 'free',\n 'proprietary',\n 'nonfree',\n 'needs',\n 'nightly',\n 'release-candidate',\n 'planned',\n 'scheduled',\n 'incorrect',\n 'no result',\n 'cmain',\n 'calso starring',\n 'crecurring',\n 'cguest',\n 'not yet',\n 'optional'\n]\ncells.forEach(str => {\n templates[str] = tmpl => {\n let data = parse(tmpl, ['text'])\n return data.text || titlecase(data.template)\n }\n})\n\n//these ones have a text result\nlet moreCells = [\n ['active fire', 'Active'],\n ['site active', 'Active'],\n ['site inactive', 'Inactive'],\n ['yes2', ''],\n ['no2', ''],\n ['ya', '✅'],\n ['na', '❌'],\n ['nom', 'Nominated'],\n ['sho', 'Shortlisted'],\n ['tba', 'TBA'],\n ['maybecheck', '✔️'],\n ['okay', 'Neutral'],\n ['n/a', 'N/A'],\n ['sdash', '—'],\n ['dunno', '?'],\n ['draw', ''],\n ['cnone', ''],\n ['nocontest', '']\n]\nmoreCells.forEach(a => {\n templates[a[0]] = tmpl => {\n let data = parse(tmpl, ['text'])\n return data.text || a[1]\n }\n})\n\n//this one's a little different\ntemplates.won = tmpl => {\n let data = parse(tmpl, ['text'])\n return data.place || data.text || titlecase(data.template)\n}\n\nmodule.exports = templates\n","module.exports = Object.assign({}, require('./links'), require('./page'), require('./table-cell'))\n","const parse = require('../_parsers/parse')\n\nconst zeroPad = function(num) {\n num = String(num)\n if (num.length === 1) {\n num = '0' + num\n }\n return num\n}\n\nconst parseTeam = function(obj, round, team) {\n if (obj[`rd${round}-team${zeroPad(team)}`]) {\n team = zeroPad(team)\n }\n let score = obj[`rd${round}-score${team}`]\n let num = Number(score)\n if (isNaN(num) === false) {\n score = num\n }\n return {\n team: obj[`rd${round}-team${team}`],\n score: score,\n seed: obj[`rd${round}-seed${team}`]\n }\n}\n\n//these are weird.\nconst playoffBracket = function(tmpl) {\n let rounds = []\n let obj = parse(tmpl)\n //try some rounds\n for (let i = 1; i < 7; i += 1) {\n let round = []\n for (let t = 1; t < 16; t += 2) {\n let key = `rd${i}-team`\n if (obj[key + t] || obj[key + zeroPad(t)]) {\n let one = parseTeam(obj, i, t)\n let two = parseTeam(obj, i, t + 1)\n round.push([one, two])\n } else {\n break\n }\n }\n if (round.length > 0) {\n rounds.push(round)\n }\n }\n return {\n template: 'playoffbracket',\n rounds: rounds\n }\n}\n\nlet all = {\n //playoff brackets\n '4teambracket': function(tmpl, list) {\n let obj = playoffBracket(tmpl)\n list.push(obj)\n return ''\n }\n}\n\n//a bunch of aliases for these ones:\n// https://en.wikipedia.org/wiki/Category:Tournament_bracket_templates\nconst brackets = [\n '2teambracket',\n '4team2elimbracket',\n '8teambracket',\n '16teambracket',\n '32teambracket',\n\n 'cwsbracket',\n 'nhlbracket',\n 'nhlbracket-reseed',\n '4teambracket-nhl',\n '4teambracket-ncaa',\n '4teambracket-mma',\n '4teambracket-mlb',\n\n '8teambracket-nhl',\n '8teambracket-mlb',\n '8teambracket-ncaa',\n '8teambracket-afc',\n '8teambracket-afl',\n '8teambracket-tennis3',\n '8teambracket-tennis5',\n\n '16teambracket-nhl',\n '16teambracket-nhl divisional',\n '16teambracket-nhl-reseed',\n '16teambracket-nba',\n '16teambracket-swtc',\n '16teambracket-afc',\n '16teambracket-tennis3',\n '16teambracket-tennis5'\n]\nbrackets.forEach(key => {\n all[key] = all['4teambracket']\n})\n\nmodule.exports = all\n","const parse = require('../_parsers/parse')\n\nconst codes = {\n '£': 'GB£', // https://en.wikipedia.org/wiki/Template:GBP\n '¥': '¥', // https://en.wikipedia.org/wiki/Template:JPY\n '৳': '৳', // https://en.wikipedia.org/wiki/Template:BDT\n '₩': '₩', // https://en.wikipedia.org/wiki/Template:SK_won\n '€': '€', // https://en.wikipedia.org/wiki/Template:€\n '₱': '₱', // https://en.wikipedia.org/wiki/Template:Philippine_peso\n '₹': '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n '₽': '₽', // https://en.wikipedia.org/wiki/Template:RUB\n 'cn¥': 'CN¥', // https://en.wikipedia.org/wiki/Template:CNY\n 'gb£': 'GB£', // https://en.wikipedia.org/wiki/Template:GBP\n 'india rs': '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n 'indian rupee symbol': '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n 'indian rupee': '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n 'indian rupees': '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n 'philippine peso': '₱', // https://en.wikipedia.org/wiki/Template:Philippine_peso\n 'russian ruble': '₽', // https://en.wikipedia.org/wiki/Template:Russian_ruble\n 'SK won': '₩', // https://en.wikipedia.org/wiki/Template:SK_won\n 'turkish lira': 'TRY', //https://en.wikipedia.org/wiki/Template:Turkish_lira\n a$: 'A$', // https://en.wikipedia.org/wiki/Template:AUD\n au$: 'A$', //https://en.wikipedia.org/wiki/Template:AUD\n aud: 'A$', //https://en.wikipedia.org/wiki/Template:AUD\n bdt: 'BDT', //https://en.wikipedia.org/wiki/Template:BDT\n brl: 'BRL', //https://en.wikipedia.org/wiki/Template:BRL\n ca$: 'CA$', // https://en.wikipedia.org/wiki/Template:CAD\n cad: 'CA$', // https://en.wikipedia.org/wiki/Template:CAD\n chf: 'CHF', // https://en.wikipedia.org/wiki/Template:CHF\n cny: 'CN¥', // https://en.wikipedia.org/wiki/Template:CNY\n czk: 'czk', // https://en.wikipedia.org/wiki/Template:CZK\n dkk: 'dkk', // https://en.wikipedia.org/wiki/Template:DKK\n dkk2: 'dkk', // https://en.wikipedia.org/wiki/Template:DKK\n euro: '€', // https://en.wikipedia.org/wiki/Template:€\n gbp: 'GB£', // https://en.wikipedia.org/wiki/Template:GBP\n hk$: 'HK$', // https://en.wikipedia.org/wiki/Template:HKD\n hkd: 'HK$', // https://en.wikipedia.org/wiki/Template:HKD\n ils: 'ILS', // https://en.wikipedia.org/wiki/Template:ILS\n inr: '₹', // https://en.wikipedia.org/wiki/Template:Indian_Rupee\n jpy: '¥', // https://en.wikipedia.org/wiki/Template:JPY\n myr: 'MYR', // https://en.wikipedia.org/wiki/Template:MYR\n nis: 'ILS', // https://en.wikipedia.org/wiki/Template:ILS\n nok: 'NOK', //https://en.wikipedia.org/wiki/Template:NOK\n nok2: 'NOK', //https://en.wikipedia.org/wiki/Template:NOK\n nz$: 'NZ$', //https://en.wikipedia.org/wiki/Template:NZD\n nzd: 'NZ$', //https://en.wikipedia.org/wiki/Template:NZD\n peso: 'peso', //https://en.wikipedia.org/wiki/Template:Peso\n pkr: '₨', // https://en.wikipedia.org/wiki/Template:Pakistani_Rupee\n r$: 'BRL', //https://en.wikipedia.org/wiki/Template:BRL\n rmb: 'CN¥', // https://en.wikipedia.org/wiki/Template:CNY\n rub: '₽', // https://en.wikipedia.org/wiki/Template:RUB\n ruble: '₽', // https://en.wikipedia.org/wiki/Template:Ruble\n rupee: '₹', // https://en.wikipedia.org/wiki/Template:Rupee\n s$: 'sgd', // https://en.wikipedia.org/wiki/Template:SGD\n sek: 'SEK', // https://en.wikipedia.org/wiki/Template:SEK\n sek2: 'SEK', // https://en.wikipedia.org/wiki/Template:SEK\n sfr: 'CHF', // https://en.wikipedia.org/wiki/Template:CHF\n sgd: 'sgd', // https://en.wikipedia.org/wiki/Template:SGD\n shekel: 'ILS', // https://en.wikipedia.org/wiki/Template:ILS\n sheqel: 'ILS', // https://en.wikipedia.org/wiki/Template:ILS\n ttd: 'TTD', //https://en.wikipedia.org/wiki/Template:TTD\n us$: 'US$', // https://en.wikipedia.org/wiki/Template:US$\n usd: 'US$', // https://en.wikipedia.org/wiki/Template:US$\n yen: '¥', // https://en.wikipedia.org/wiki/Template:JPY\n zar: 'R' //https://en.wikipedia.org/wiki/Template:ZAR\n}\n\nconst parseCurrency = (tmpl, list) => {\n let o = parse(tmpl, ['amount', 'code'])\n list.push(o)\n let code = o.template || ''\n if (code === 'currency') {\n code = o.code\n if (!code) {\n o.code = code = 'usd' //Special case when currency template has no code argument\n }\n } else if (\n code === '' ||\n code === 'monnaie' ||\n code === 'unité' ||\n code === 'nombre' ||\n code === 'nb'\n ) {\n code = o.code\n }\n code = (code || '').toLowerCase()\n switch (code) {\n case 'us':\n o.code = code = 'usd'\n break\n case 'uk':\n o.code = code = 'gbp'\n break\n }\n let out = codes[code] || ''\n let str = `${out}${o.amount || ''}`\n //support unknown currencies after the number - like '5 BTC'\n if (o.code && !codes[o.code.toLowerCase()]) {\n str += ' ' + o.code\n }\n return str\n}\n\nconst inrConvert = (tmpl, list) => {\n let o = parse(tmpl, ['rupee_value', 'currency_formatting'])\n list.push(o)\n let formatting = o.currency_formatting\n if (formatting) {\n let multiplier = 1\n switch (formatting) {\n case 'k':\n multiplier = 1000\n break\n case 'm':\n multiplier = 1000000\n break\n case 'b':\n multiplier = 1000000000\n break\n case 't':\n multiplier = 1000000000000\n break\n case 'l':\n multiplier = 100000\n break\n case 'c':\n multiplier = 10000000\n break\n case 'lc':\n multiplier = 1000000000000\n break\n }\n o.rupee_value = o.rupee_value * multiplier\n }\n let str = `inr ${o.rupee_value || ''}`\n return str\n}\n\nconst currencies = {\n //this one is generic https://en.wikipedia.org/wiki/Template:Currency\n currency: parseCurrency,\n monnaie: parseCurrency,\n unité: parseCurrency,\n nombre: parseCurrency,\n nb: parseCurrency,\n iso4217: parseCurrency,\n inrconvert: inrConvert\n}\n//the others fit the same pattern..\nObject.keys(codes).forEach(k => {\n currencies[k] = parseCurrency\n})\n\nmodule.exports = currencies\n","const parse = require('../_parsers/parse')\n\nlet templates = {\n //https://en.wikipedia.org/wiki/Template:Election_box\n 'election box begin': (tmpl, list) => {\n let data = parse(tmpl)\n list.push(data)\n return ''\n },\n 'election box candidate': (tmpl, list) => {\n let data = parse(tmpl)\n list.push(data)\n return ''\n },\n 'election box hold with party link': (tmpl, list) => {\n let data = parse(tmpl)\n list.push(data)\n return ''\n },\n 'election box gain with party link': (tmpl, list) => {\n let data = parse(tmpl)\n list.push(data)\n return ''\n }\n}\n//aliases\ntemplates['election box begin no change'] = templates['election box begin']\ntemplates['election box begin no party'] = templates['election box begin']\ntemplates['election box begin no party no change'] = templates['election box begin']\ntemplates['election box inline begin'] = templates['election box begin']\ntemplates['election box inline begin no change'] = templates['election box begin']\n\ntemplates['election box candidate for alliance'] = templates['election box candidate']\ntemplates['election box candidate minor party'] = templates['election box candidate']\ntemplates['election box candidate no party link no change'] = templates['election box candidate']\ntemplates['election box candidate with party link'] = templates['election box candidate']\ntemplates['election box candidate with party link coalition 1918'] =\n templates['election box candidate']\ntemplates['election box candidate with party link no change'] = templates['election box candidate']\ntemplates['election box inline candidate'] = templates['election box candidate']\ntemplates['election box inline candidate no change'] = templates['election box candidate']\ntemplates['election box inline candidate with party link'] = templates['election box candidate']\ntemplates['election box inline candidate with party link no change'] =\n templates['election box candidate']\ntemplates['election box inline incumbent'] = templates['election box candidate']\nmodule.exports = templates\n","module.exports = [\n ['🇦🇩', 'and', 'andorra'],\n ['🇦🇪', 'are', 'united arab emirates'],\n ['🇦🇫', 'afg', 'afghanistan'],\n ['🇦🇬', 'atg', 'antigua and barbuda'],\n ['🇦🇮', 'aia', 'anguilla'],\n ['🇦🇱', 'alb', 'albania'],\n ['🇦🇲', 'arm', 'armenia'],\n ['🇦🇴', 'ago', 'angola'],\n ['🇦🇶', 'ata', 'antarctica'],\n ['🇦🇷', 'arg', 'argentina'],\n ['🇦🇸', 'asm', 'american samoa'],\n ['🇦🇹', 'aut', 'austria'],\n ['🇦🇺', 'aus', 'australia'],\n ['🇦🇼', 'abw', 'aruba'],\n ['🇦🇽', 'ala', 'åland islands'],\n ['🇦🇿', 'aze', 'azerbaijan'],\n ['🇧🇦', 'bih', 'bosnia and herzegovina'],\n ['🇧🇧', 'brb', 'barbados'],\n ['🇧🇩', 'bgd', 'bangladesh'],\n ['🇧🇪', 'bel', 'belgium'],\n ['🇧🇫', 'bfa', 'burkina faso'],\n ['🇧🇬', 'bgr', 'bulgaria'],\n [\n '🇧🇬',\n 'bul', //dupe\n 'bulgaria'\n ],\n ['🇧🇭', 'bhr', 'bahrain'],\n ['🇧🇮', 'bdi', 'burundi'],\n ['🇧🇯', 'ben', 'benin'],\n ['🇧🇱', 'blm', 'saint barthélemy'],\n ['🇧🇲', 'bmu', 'bermuda'],\n ['🇧🇳', 'brn', 'brunei darussalam'],\n ['🇧🇴', 'bol', 'bolivia'],\n ['🇧🇶', 'bes', 'bonaire, sint eustatius and saba'],\n ['🇧🇷', 'bra', 'brazil'],\n ['🇧🇸', 'bhs', 'bahamas'],\n ['🇧🇹', 'btn', 'bhutan'],\n ['🇧🇻', 'bvt', 'bouvet island'],\n ['🇧🇼', 'bwa', 'botswana'],\n ['🇧🇾', 'blr', 'belarus'],\n ['🇧🇿', 'blz', 'belize'],\n ['🇨🇦', 'can', 'canada'],\n ['🇨🇨', 'cck', 'cocos (keeling) islands'],\n ['🇨🇩', 'cod', 'congo'],\n ['🇨🇫', 'caf', 'central african republic'],\n ['🇨🇬', 'cog', 'congo'],\n ['🇨🇭', 'che', 'switzerland'],\n ['🇨🇮', 'civ', \"côte d'ivoire\"],\n ['🇨🇰', 'cok', 'cook islands'],\n ['🇨🇱', 'chl', 'chile'],\n ['🇨🇲', 'cmr', 'cameroon'],\n ['🇨🇳', 'chn', 'china'],\n ['🇨🇴', 'col', 'colombia'],\n ['🇨🇷', 'cri', 'costa rica'],\n ['🇨🇺', 'cub', 'cuba'],\n ['🇨🇻', 'cpv', 'cape verde'],\n ['🇨🇼', 'cuw', 'curaçao'],\n ['🇨🇽', 'cxr', 'christmas island'],\n ['🇨🇾', 'cyp', 'cyprus'],\n ['🇨🇿', 'cze', 'czech republic'],\n ['🇩🇪', 'deu', 'germany'],\n [\n '🇩🇪',\n 'ger', //alias\n 'germany'\n ],\n ['🇩🇯', 'dji', 'djibouti'],\n ['🇩🇰', 'dnk', 'denmark'],\n ['🇩🇲', 'dma', 'dominica'],\n ['🇩🇴', 'dom', 'dominican republic'],\n ['🇩🇿', 'dza', 'algeria'],\n ['🇪🇨', 'ecu', 'ecuador'],\n ['🇪🇪', 'est', 'estonia'],\n ['🇪🇬', 'egy', 'egypt'],\n ['🇪🇭', 'esh', 'western sahara'],\n ['🇪🇷', 'eri', 'eritrea'],\n ['🇪🇸', 'esp', 'spain'],\n ['🇪🇹', 'eth', 'ethiopia'],\n ['🇫🇮', 'fin', 'finland'],\n ['🇫🇯', 'fji', 'fiji'],\n ['🇫🇰', 'flk', 'falkland islands (malvinas)'],\n ['🇫🇲', 'fsm', 'micronesia'],\n ['🇫🇴', 'fro', 'faroe islands'],\n ['🇫🇷', 'fra', 'france'],\n ['🇬🇦', 'gab', 'gabon'],\n ['🇬🇧', 'gbr', 'united kingdom'],\n ['🇬🇩', 'grd', 'grenada'],\n // ['🇬🇪', 'geo', 'georgia'],\n ['🇬🇫', 'guf', 'french guiana'],\n ['🇬🇬', 'ggy', 'guernsey'],\n ['🇬🇭', 'gha', 'ghana'],\n ['🇬🇮', 'gib', 'gibraltar'],\n ['🇬🇱', 'grl', 'greenland'],\n ['🇬🇲', 'gmb', 'gambia'],\n ['🇬🇳', 'gin', 'guinea'],\n ['🇬🇵', 'glp', 'guadeloupe'],\n ['🇬🇶', 'gnq', 'equatorial guinea'],\n ['🇬🇷', 'grc', 'greece'],\n ['🇬🇸', 'sgs', 'south georgia'],\n ['🇬🇹', 'gtm', 'guatemala'],\n ['🇬🇺', 'gum', 'guam'],\n ['🇬🇼', 'gnb', 'guinea-bissau'],\n ['🇬🇾', 'guy', 'guyana'],\n ['🇭🇰', 'hkg', 'hong kong'],\n ['🇭🇲', 'hmd', 'heard island and mcdonald islands'],\n ['🇭🇳', 'hnd', 'honduras'],\n ['🇭🇷', 'hrv', 'croatia'],\n ['🇭🇹', 'hti', 'haiti'],\n ['🇭🇺', 'hun', 'hungary'],\n ['🇮🇩', 'idn', 'indonesia'],\n ['🇮🇪', 'irl', 'ireland'],\n ['🇮🇱', 'isr', 'israel'],\n ['🇮🇲', 'imn', 'isle of man'],\n ['🇮🇳', 'ind', 'india'],\n ['🇮🇴', 'iot', 'british indian ocean territory'],\n ['🇮🇶', 'irq', 'iraq'],\n ['🇮🇷', 'irn', 'iran'],\n ['🇮🇸', 'isl', 'iceland'],\n ['🇮🇹', 'ita', 'italy'],\n ['🇯🇪', 'jey', 'jersey'],\n ['🇯🇲', 'jam', 'jamaica'],\n ['🇯🇴', 'jor', 'jordan'],\n ['🇯🇵', 'jpn', 'japan'],\n ['🇰🇪', 'ken', 'kenya'],\n ['🇰🇬', 'kgz', 'kyrgyzstan'],\n ['🇰🇭', 'khm', 'cambodia'],\n ['🇰🇮', 'kir', 'kiribati'],\n ['🇰🇲', 'com', 'comoros'],\n ['🇰🇳', 'kna', 'saint kitts and nevis'],\n ['🇰🇵', 'prk', 'north korea'],\n ['🇰🇷', 'kor', 'south korea'],\n ['🇰🇼', 'kwt', 'kuwait'],\n ['🇰🇾', 'cym', 'cayman islands'],\n ['🇰🇿', 'kaz', 'kazakhstan'],\n ['🇱🇦', 'lao', \"lao people's democratic republic\"],\n ['🇱🇧', 'lbn', 'lebanon'],\n ['🇱🇨', 'lca', 'saint lucia'],\n ['🇱🇮', 'lie', 'liechtenstein'],\n ['🇱🇰', 'lka', 'sri lanka'],\n ['🇱🇷', 'lbr', 'liberia'],\n ['🇱🇸', 'lso', 'lesotho'],\n ['🇱🇹', 'ltu', 'lithuania'],\n ['🇱🇺', 'lux', 'luxembourg'],\n ['🇱🇻', 'lva', 'latvia'],\n ['🇱🇾', 'lby', 'libya'],\n ['🇲🇦', 'mar', 'morocco'],\n ['🇲🇨', 'mco', 'monaco'],\n ['🇲🇩', 'mda', 'moldova'],\n ['🇲🇪', 'mne', 'montenegro'],\n ['🇲🇫', 'maf', 'saint martin (french part)'],\n ['🇲🇬', 'mdg', 'madagascar'],\n ['🇲🇭', 'mhl', 'marshall islands'],\n ['🇲🇰', 'mkd', 'macedonia'],\n ['🇲🇱', 'mli', 'mali'],\n ['🇲🇲', 'mmr', 'myanmar'],\n ['🇲🇳', 'mng', 'mongolia'],\n ['🇲🇴', 'mac', 'macao'],\n ['🇲🇵', 'mnp', 'northern mariana islands'],\n ['🇲🇶', 'mtq', 'martinique'],\n ['🇲🇷', 'mrt', 'mauritania'],\n ['🇲🇸', 'msr', 'montserrat'],\n ['🇲🇹', 'mlt', 'malta'],\n ['🇲🇺', 'mus', 'mauritius'],\n ['🇲🇻', 'mdv', 'maldives'],\n ['🇲🇼', 'mwi', 'malawi'],\n ['🇲🇽', 'mex', 'mexico'],\n ['🇲🇾', 'mys', 'malaysia'],\n ['🇲🇿', 'moz', 'mozambique'],\n ['🇳🇦', 'nam', 'namibia'],\n ['🇳🇨', 'ncl', 'new caledonia'],\n ['🇳🇪', 'ner', 'niger'],\n ['🇳🇫', 'nfk', 'norfolk island'],\n ['🇳🇬', 'nga', 'nigeria'],\n ['🇳🇮', 'nic', 'nicaragua'],\n ['🇳🇱', 'nld', 'netherlands'],\n ['🇳🇴', 'nor', 'norway'],\n ['🇳🇵', 'npl', 'nepal'],\n ['🇳🇷', 'nru', 'nauru'],\n ['🇳🇺', 'niu', 'niue'],\n ['🇳🇿', 'nzl', 'new zealand'],\n ['🇴🇲', 'omn', 'oman'],\n ['🇵🇦', 'pan', 'panama'],\n ['🇵🇪', 'per', 'peru'],\n ['🇵🇫', 'pyf', 'french polynesia'],\n ['🇵🇬', 'png', 'papua new guinea'],\n ['🇵🇭', 'phl', 'philippines'],\n ['🇵🇰', 'pak', 'pakistan'],\n ['🇵🇱', 'pol', 'poland'],\n ['🇵🇲', 'spm', 'saint pierre and miquelon'],\n ['🇵🇳', 'pcn', 'pitcairn'],\n ['🇵🇷', 'pri', 'puerto rico'],\n ['🇵🇸', 'pse', 'palestinian territory'],\n ['🇵🇹', 'prt', 'portugal'],\n ['🇵🇼', 'plw', 'palau'],\n ['🇵🇾', 'pry', 'paraguay'],\n ['🇶🇦', 'qat', 'qatar'],\n ['🇷🇪', 'reu', 'réunion'],\n ['🇷🇴', 'rou', 'romania'],\n ['🇷🇸', 'srb', 'serbia'],\n ['🇷🇺', 'rus', 'russia'],\n ['🇷🇼', 'rwa', 'rwanda'],\n ['🇸🇦', 'sau', 'saudi arabia'],\n ['🇸🇧', 'slb', 'solomon islands'],\n ['🇸🇨', 'syc', 'seychelles'],\n ['🇸🇩', 'sdn', 'sudan'],\n ['🇸🇪', 'swe', 'sweden'],\n ['🇸🇬', 'sgp', 'singapore'],\n ['🇸🇭', 'shn', 'saint helena, ascension and tristan da cunha'],\n ['🇸🇮', 'svn', 'slovenia'],\n ['🇸🇯', 'sjm', 'svalbard and jan mayen'],\n ['🇸🇰', 'svk', 'slovakia'],\n ['🇸🇱', 'sle', 'sierra leone'],\n ['🇸🇲', 'smr', 'san marino'],\n ['🇸🇳', 'sen', 'senegal'],\n ['🇸🇴', 'som', 'somalia'],\n ['🇸🇷', 'sur', 'suriname'],\n ['🇸🇸', 'ssd', 'south sudan'],\n ['🇸🇹', 'stp', 'sao tome and principe'],\n ['🇸🇻', 'slv', 'el salvador'],\n ['🇸🇽', 'sxm', 'sint maarten (dutch part)'],\n ['🇸🇾', 'syr', 'syrian arab republic'],\n ['🇸🇿', 'swz', 'swaziland'],\n ['🇹🇨', 'tca', 'turks and caicos islands'],\n ['🇹🇩', 'tcd', 'chad'],\n ['🇹🇫', 'atf', 'french southern territories'],\n ['🇹🇬', 'tgo', 'togo'],\n ['🇹🇭', 'tha', 'thailand'],\n ['🇹🇯', 'tjk', 'tajikistan'],\n ['🇹🇰', 'tkl', 'tokelau'],\n ['🇹🇱', 'tls', 'timor-leste'],\n ['🇹🇲', 'tkm', 'turkmenistan'],\n ['🇹🇳', 'tun', 'tunisia'],\n ['🇹🇴', 'ton', 'tonga'],\n ['🇹🇷', 'tur', 'turkey'],\n ['🇹🇹', 'tto', 'trinidad and tobago'],\n ['🇹🇻', 'tuv', 'tuvalu'],\n ['🇹🇼', 'twn', 'taiwan'],\n ['🇹🇿', 'tza', 'tanzania'],\n ['🇺🇦', 'ukr', 'ukraine'],\n ['🇺🇬', 'uga', 'uganda'],\n ['🇺🇲', 'umi', 'united states minor outlying islands'],\n ['🇺🇸', 'usa', 'united states'],\n [\n '🇺🇸',\n 'us', //alias\n 'united states'\n ],\n ['🇺🇾', 'ury', 'uruguay'],\n ['🇺🇿', 'uzb', 'uzbekistan'],\n ['🇻🇦', 'vat', 'vatican city'],\n ['🇻🇨', 'vct', 'saint vincent and the grenadines'],\n ['🇻🇪', 'ven', 'venezuela'],\n ['🇻🇬', 'vgb', 'virgin islands, british'],\n ['🇻🇮', 'vir', 'virgin islands, u.s.'],\n ['🇻🇳', 'vnm', 'viet nam'],\n ['🇻🇺', 'vut', 'vanuatu'],\n ['', 'win', 'west indies'],\n ['🇼🇫', 'wlf', 'wallis and futuna'],\n ['🇼🇸', 'wsm', 'samoa'],\n ['🇾🇪', 'yem', 'yemen'],\n ['🇾🇹', 'myt', 'mayotte'],\n ['🇿🇦', 'zaf', 'south africa'],\n ['🇿🇲', 'zmb', 'zambia'],\n ['🇿🇼 ', 'zwe', 'zimbabwe'],\n //others (later unicode versions)\n ['🇺🇳', 'un', 'united nations'],\n ['🏴󠁧󠁢󠁥󠁮󠁧󠁿󠁧󠁢󠁥󠁮󠁧󠁿', 'eng', 'england'],\n ['🏴󠁧󠁢󠁳󠁣󠁴󠁿', 'sct', 'scotland'],\n ['🏴󠁧󠁢󠁷󠁬󠁳󠁿', 'wal', 'wales'],\n ['🇪🇺', 'eu', 'european union']\n]\n","const parse = require('../_parsers/parse')\nconst flags = require('../../_data/flags')\n\nlet templates = {\n //https://en.wikipedia.org/wiki/Template:Flag\n // {{flag|USA}} → USA\n flag: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n let name = obj.flag || ''\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2]) || []\n let flag = found[0] || ''\n return `${flag} [[${found[2]}|${name}]]`\n },\n // {{flagcountry|USA}} → United States\n flagcountry: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2]) || []\n let flag = found[0] || ''\n return `${flag} [[${found[2]}]]`\n },\n // (unlinked flag-country)\n flagcu: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2]) || []\n let flag = found[0] || ''\n return `${flag} ${found[2]}`\n },\n //https://en.wikipedia.org/wiki/Template:Flagicon\n // {{flagicon|USA}} → United States\n flagicon: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2])\n if (!found) {\n return ''\n }\n return `[[${found[2]}|${found[0]}]]`\n },\n //unlinked flagicon\n flagdeco: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2]) || []\n return found[0] || ''\n },\n //same, but a soccer team\n fb: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2])\n if (!found) {\n return ''\n }\n return `${found[0]} [[${found[2]} national football team|${found[2]}]]`\n },\n fbicon: tmpl => {\n let order = ['flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2])\n if (!found) {\n return ''\n }\n return ` [[${found[2]} national football team|${found[0]}]]`\n },\n flagathlete: tmpl => {\n let order = ['name', 'flag', 'variant']\n let obj = parse(tmpl, order)\n obj.flag = (obj.flag || '').toLowerCase()\n let found = flags.find(a => obj.flag === a[1] || obj.flag === a[2])\n if (!found) {\n return `[[${obj.name || ''}]]`\n }\n return `${found[0]} [[${obj.name || ''}]] (${found[1].toUpperCase()})`\n }\n}\n//support {{can}}\nflags.forEach(a => {\n templates[a[1]] = () => {\n return a[0]\n }\n})\n//cricket\ntemplates['cr'] = templates.flagcountry\ntemplates['cr-rt'] = templates.flagcountry\ntemplates['cricon'] = templates.flagicon\n\nmodule.exports = templates\n","const parse = require('../_parsers/parse')\nconst languages = require('../../_data/languages')\n\nconst getLang = function(name) {\n //grab the language from the template name - 'ipa-de'\n let lang = name.match(/ipac?-(.+)/)\n if (lang !== null) {\n if (languages.hasOwnProperty(lang[1]) === true) {\n return languages[lang[1]].english_title\n }\n return lang[1]\n }\n return null\n}\n\n// pronounciation info\nconst templates = {\n // https://en.wikipedia.org/wiki/Template:IPA\n ipa: (tmpl, list) => {\n let obj = parse(tmpl, ['transcription', 'lang', 'audio'])\n obj.lang = getLang(obj.template)\n obj.template = 'ipa'\n list.push(obj)\n return ''\n },\n //https://en.wikipedia.org/wiki/Template:IPAc-en\n ipac: (tmpl, list) => {\n let obj = parse(tmpl)\n obj.transcription = (obj.list || []).join(',')\n delete obj.list\n obj.lang = getLang(obj.template)\n obj.template = 'ipac'\n list.push(obj)\n return ''\n },\n transl: (tmpl, list) => {\n let obj = parse(tmpl, ['lang', 'text', 'text2'])\n // support 3-param\n if (obj.text2) {\n obj.iso = obj.text\n obj.text = obj.text2\n delete obj.text2\n }\n list.push(obj)\n return obj.text || ''\n }\n}\n// - other languages -\n// Polish, {{IPAc-pl}}\t{{IPAc-pl|'|sz|cz|e|ć|i|n}} → [ˈʂt͡ʂɛt͡ɕin]\n// Portuguese, {{IPAc-pt}}\t{{IPAc-pt|p|o|<|r|t|u|'|g|a|l|lang=pt}} and {{IPAc-pt|b|r|a|'|s|i|l|lang=br}} → [puɾtuˈɣaɫ] and [bɾaˈsiw]\nObject.keys(languages).forEach(lang => {\n templates['ipa-' + lang] = templates.ipa\n templates['ipac-' + lang] = templates.ipac\n})\n\nmodule.exports = templates\n","const languages = require('../../_data/languages')\nconst parse = require('../_parsers/parse')\n\nconst templates = {\n lang: 1,\n //this one has a million variants\n 'lang-de': 0,\n 'rtl-lang': 1,\n //german keyboard letterscn\n taste: 0,\n //https://en.wikipedia.org/wiki/Template:Nihongo\n nihongo: (tmpl, list) => {\n let obj = parse(tmpl, ['english', 'kanji', 'romaji', 'extra'])\n list.push(obj)\n let str = obj.english || obj.romaji || ''\n if (obj.kanji) {\n str += ` (${obj.kanji})`\n }\n return str\n }\n}\n//https://en.wikipedia.org/wiki/Category:Lang-x_templates\nObject.keys(languages).forEach(k => {\n templates['lang-' + k] = templates['lang-de']\n})\ntemplates['nihongo2'] = templates.nihongo\ntemplates['nihongo3'] = templates.nihongo\ntemplates['nihongo-s'] = templates.nihongo\ntemplates['nihongo foot'] = templates.nihongo\nmodule.exports = templates\n","const parse = require('../_parsers/parse')\n// const parseSentence = require('../../04-sentence').fromText;\n\n//simply num/denom * 100\nconst percentage = function(obj) {\n if (!obj.numerator && !obj.denominator) {\n return null\n }\n let perc = Number(obj.numerator) / Number(obj.denominator)\n perc *= 100\n let dec = Number(obj.decimals)\n if (isNaN(dec)) {\n dec = 1\n }\n perc = perc.toFixed(dec)\n return Number(perc)\n}\n\nlet templates = {\n // https://en.wikipedia.org/wiki/Template:Math\n math: (tmpl, list) => {\n let obj = parse(tmpl, ['formula'])\n list.push(obj)\n return '\\n\\n' + (obj.formula || '') + '\\n\\n'\n },\n\n //fraction - https://en.wikipedia.org/wiki/Template:Sfrac\n frac: (tmpl, list) => {\n let order = ['a', 'b', 'c']\n let obj = parse(tmpl, order)\n let data = {\n template: 'sfrac'\n }\n if (obj.c) {\n data.integer = obj.a\n data.numerator = obj.b\n data.denominator = obj.c\n } else if (obj.b) {\n data.numerator = obj.a\n data.denominator = obj.b\n } else {\n data.numerator = 1\n data.denominator = obj.a\n }\n list.push(data)\n if (data.integer) {\n return `${data.integer} ${data.numerator}⁄${data.denominator}`\n }\n return `${data.numerator}⁄${data.denominator}`\n },\n //https://en.wikipedia.org/wiki/Template:Radic\n radic: tmpl => {\n let order = ['after', 'before']\n let obj = parse(tmpl, order)\n return `${obj.before || ''}√${obj.after || ''}`\n },\n //{{percentage | numerator | denominator | decimals to round to (zero or greater) }}\n percentage: tmpl => {\n let obj = parse(tmpl, ['numerator', 'denominator', 'decimals'])\n let num = percentage(obj)\n if (num === null) {\n return ''\n }\n return num + '%'\n },\n // {{Percent-done|done=N|total=N|digits=N}}\n 'percent-done': tmpl => {\n let obj = parse(tmpl, ['done', 'total', 'digits'])\n let num = percentage({\n numerator: obj.done,\n denominator: obj.total,\n decimals: obj.digits\n })\n if (num === null) {\n return ''\n }\n return `${obj.done} (${num}%) done`\n },\n 'winning percentage': (tmpl, list) => {\n let obj = parse(tmpl, ['wins', 'losses', 'ties'])\n list.push(obj)\n let wins = Number(obj.wins)\n let losses = Number(obj.losses)\n let ties = Number(obj.ties) || 0\n let games = wins + losses + ties\n if (obj.ignore_ties === 'y') {\n ties = 0\n }\n if (ties) {\n wins += ties / 2\n }\n let num = percentage({\n numerator: wins,\n denominator: games,\n decimals: 1\n })\n if (num === null) {\n return ''\n }\n return `.${num * 10}`\n },\n winlosspct: (tmpl, list) => {\n let obj = parse(tmpl, ['wins', 'losses'])\n list.push(obj)\n let wins = Number(obj.wins)\n let losses = Number(obj.losses)\n let num = percentage({\n numerator: wins,\n denominator: wins + losses,\n decimals: 1\n })\n if (num === null) {\n return ''\n }\n num = `.${num * 10}`\n return `${wins || 0} || ${losses || 0} || ${num || '-'}`\n }\n}\n//aliases\ntemplates['sfrac'] = templates.frac\ntemplates['sqrt'] = templates.radic\ntemplates['pct'] = templates.percentage\ntemplates['percent'] = templates.percentage\ntemplates['winpct'] = templates['winning percentage']\ntemplates['winperc'] = templates['winning percentage']\n\nmodule.exports = templates\n","const parse = require('../_parsers/parse')\n\nconst generic = function(tmpl, list, alias) {\n let obj = parse(tmpl)\n if (alias) {\n obj.name = obj.template\n obj.template = alias\n }\n list.push(obj)\n return ''\n}\n\nconst misc = {\n //i18n templates\n persondata: generic,\n taxobox: generic,\n citation: generic,\n portal: generic,\n reflist: generic,\n 'cite book': generic,\n 'cite journal': generic,\n 'cite web': generic,\n 'commons cat': generic,\n\n // https://en.wikipedia.org/wiki/Template:Portuguese_name\n 'portuguese name': ['first', 'second', 'suffix'],\n uss: ['ship', 'id'],\n isbn: (tmpl, list) => {\n let order = ['id', 'id2', 'id3']\n let obj = parse(tmpl, order)\n list.push(obj)\n return 'ISBN: ' + (obj.id || '')\n },\n //https://en.wikipedia.org/wiki/Template:Marriage\n //this one creates a template, and an inline response\n marriage: (tmpl, list) => {\n let data = parse(tmpl, ['spouse', 'from', 'to', 'end'])\n list.push(data)\n let str = `${data.spouse || ''}`\n if (data.from) {\n if (data.to) {\n str += ` (m. ${data.from}-${data.to})`\n } else {\n str += ` (m. ${data.from})`\n }\n }\n return str\n },\n //https://en.wikipedia.org/wiki/Template:Based_on\n 'based on': (tmpl, list) => {\n let obj = parse(tmpl, ['title', 'author'])\n list.push(obj)\n return `${obj.title} by ${obj.author || ''}`\n },\n //https://en.wikipedia.org/wiki/Template:Video_game_release\n 'video game release': (tmpl, list) => {\n let order = ['region', 'date', 'region2', 'date2', 'region3', 'date3', 'region4', 'date4']\n let obj = parse(tmpl, order)\n let template = {\n template: 'video game release',\n releases: []\n }\n for (let i = 0; i < order.length; i += 2) {\n if (obj[order[i]]) {\n template.releases.push({\n region: obj[order[i]],\n date: obj[order[i + 1]]\n })\n }\n }\n list.push(template)\n let str = template.releases.map(o => `${o.region}: ${o.date || ''}`).join('\\n\\n')\n return '\\n' + str + '\\n'\n },\n //barrels of oil https://en.wikipedia.org/wiki/Template:Bbl_to_t\n 'bbl to t': (tmpl, list) => {\n let obj = parse(tmpl, ['barrels'])\n list.push(obj)\n if (obj.barrels === '0') {\n return obj.barrels + ' barrel'\n }\n return obj.barrels + ' barrels'\n },\n //https://en.wikipedia.org/wiki/Template:Historical_populations\n 'historical populations': (tmpl, list) => {\n let data = parse(tmpl)\n data.list = data.list || []\n let years = []\n for (let i = 0; i < data.list.length; i += 2) {\n let num = data.list[i + 1]\n years.push({\n year: data.list[i],\n val: Number(num) || num\n })\n }\n data.data = years\n delete data.list\n list.push(data)\n return ''\n }\n}\nmodule.exports = misc\n","// okay, these just hurts my feelings\n// https://www.mediawiki.org/wiki/Help:Magic_words#Other\nlet punctuation = [\n // https://en.wikipedia.org/wiki/Template:%C2%B7\n ['·', '·'],\n ['·', '·'],\n ['dot', '·'],\n ['middot', '·'],\n ['•', ' • '],\n //yup, oxford comma template\n [',', ','],\n ['1/2', '1⁄2'],\n ['1/3', '1⁄3'],\n ['2/3', '2⁄3'],\n ['1/4', '1⁄4'],\n ['3/4', '3⁄4'],\n ['–', '–'],\n ['ndash', '–'],\n ['en dash', '–'],\n ['spaced ndash', ' – '],\n\n ['—', '—'],\n ['mdash', '—'],\n ['em dash', '—'],\n\n ['number sign', '#'],\n ['ibeam', 'I'],\n ['&', '&'],\n [';', ';'],\n ['ampersand', '&'],\n ['snds', ' – '],\n ['snd', ' – '],\n // these '{{^}}' things are nuts, and used as some ilicit spacing thing.\n ['^', ' '],\n ['!', '|'],\n ['\\\\', ' /'],\n ['`', '`'],\n ['=', '='],\n ['bracket', '['],\n ['[', '['],\n ['*', '*'],\n ['asterisk', '*'],\n ['long dash', '———'],\n ['clear', '\\n\\n'],\n ['h.', 'ḥ']\n]\nconst templates = {}\npunctuation.forEach(a => {\n templates[a[0]] = a[1]\n})\nmodule.exports = templates\n","const parse = require('../_parsers/parse')\n\nlet templates = {\n //https://en.wikipedia.org/wiki/Template:Taxon_info\n 'taxon info': ['taxon', 'item'],\n\n //minor planet - https://en.wikipedia.org/wiki/Template:MPC\n mpc: (tmpl, list) => {\n let obj = parse(tmpl, ['number', 'text'])\n list.push(obj)\n return `[https://minorplanetcenter.net/db_search/show_object?object_id=P/2011+NO1 ${obj.text || obj.number}]`\n },\n //https://en.wikipedia.org/wiki/Template:Chem2\n chem2: (tmpl, list) => {\n let obj = parse(tmpl, ['equation'])\n list.push(obj)\n return obj.equation\n },\n //https://en.wikipedia.org/wiki/Template:Sky\n sky: (tmpl, list) => {\n let obj = parse(tmpl, [\n 'asc_hours',\n 'asc_minutes',\n 'asc_seconds',\n 'dec_sign',\n 'dec_degrees',\n 'dec_minutes',\n 'dec_seconds',\n 'distance'\n ])\n let template = {\n template: 'sky',\n ascension: {\n hours: obj.asc_hours,\n minutes: obj.asc_minutes,\n seconds: obj.asc_seconds\n },\n declination: {\n sign: obj.dec_sign,\n degrees: obj.dec_degrees,\n minutes: obj.dec_minutes,\n seconds: obj.dec_seconds\n },\n distance: obj.distance\n }\n list.push(template)\n return ''\n },\n\n /*\n{{Medical cases chart/Row\n|1 = valid date\n|2 = expression for deaths\n|3 = expression for recoveries\n|4 = expression for total cases (3rd classification)\n|alttot1 = alternate expression for active cases (3rd classification)\n|5 = expression for number in 4th classification\n|6 = expression for total in 5th classification\n|alttot2 = alternate expression for number in 5th classification\n|7 = number in the first column\n|8 = change in the first column\n|firstright1= whether a change in the first column is not applicable (n.a.) (yes|y|1)\n|9 = number in the second column\n|10 = change in the second column\n|firstright2= whether a change in the second column is not applicable (n.a.) (yes|y|1)\n|divisor = scaling divisor of the bars (bigger value = narrower bars) [defaults to: 1]\n|numwidth = max width of the numbers in the right columns (xx or xxxx)<-(n|t|m|w|d) [defaults to: mm]\n|collapsible= whether the row is collapsible (yes|y|1) {WIP}\n|collapsed = manual override of the initial row state (yes|y|1) {WIP}\n|id = manual override of the row id {WIP}\n}}\n*/\n\n // this is a weird one\n //https://en.wikipedia.org/wiki/Template:Medical_cases_chart\n 'medical cases chart': (tmpl, list) => {\n let order = [\n 'date',\n 'deaths_expr',\n 'recovery_expr',\n 'cases_expr',\n 'alt_expr_1',\n '4th_expr',\n '5th_expr',\n 'alt_expr_2',\n 'col_1',\n 'col_1_change',\n 'show_col_1',\n 'col_2',\n 'col_2_change',\n 'show_col_2',\n 'divisor',\n 'numwidth',\n 'collabsible',\n 'collapsed',\n 'id'\n ]\n let obj = parse(tmpl)\n // parse each row template\n let rows = obj.rows.match(/\\{\\{Medical cases chart\\/Row.*\\}\\}/gi)\n obj.rows = rows.map(row => {\n return parse(row, order)\n })\n list.push(obj)\n return ''\n },\n 'medical cases chart/row': tmpl => {\n // actually keep this template\n return tmpl\n }\n}\nmodule.exports = templates\n","const parse = require('../_parsers/parse')\nconst flags = require('../../_data/flags')\n\nlet sports = {\n player: (tmpl, list) => {\n let res = parse(tmpl, ['number', 'country', 'name', 'dl'])\n list.push(res)\n let str = `[[${res.name}]]`\n if (res.country) {\n let country = (res.country || '').toLowerCase()\n let flag = flags.find(a => country === a[1] || country === a[2]) || []\n if (flag && flag[0]) {\n str = flag[0] + ' ' + str\n }\n }\n if (res.number) {\n str = res.number + ' ' + str\n }\n return str\n },\n\n //https://en.wikipedia.org/wiki/Template:Goal\n goal: (tmpl, list) => {\n let res = parse(tmpl)\n let obj = {\n template: 'goal',\n data: []\n }\n let arr = res.list || []\n for (let i = 0; i < arr.length; i += 2) {\n obj.data.push({\n min: arr[i],\n note: arr[i + 1] || ''\n })\n }\n list.push(obj)\n //generate a little text summary\n let summary = '⚽ '\n summary += obj.data\n .map(o => {\n let note = o.note\n if (note) {\n note = ` (${note})`\n }\n return o.min + \"'\" + note\n })\n .join(', ')\n return summary\n },\n //yellow card\n yel: (tmpl, list) => {\n let obj = parse(tmpl, ['min'])\n list.push(obj)\n if (obj.min) {\n return `yellow: ${obj.min || ''}'` //no yellow-card emoji\n }\n return ''\n },\n subon: (tmpl, list) => {\n let obj = parse(tmpl, ['min'])\n list.push(obj)\n if (obj.min) {\n return `sub on: ${obj.min || ''}'` //no yellow-card emoji\n }\n return ''\n },\n suboff: (tmpl, list) => {\n let obj = parse(tmpl, ['min'])\n list.push(obj)\n if (obj.min) {\n return `sub off: ${obj.min || ''}'` //no yellow-card emoji\n }\n return ''\n },\n pengoal: (tmpl, list) => {\n list.push({\n template: 'pengoal'\n })\n return '✅'\n },\n penmiss: (tmpl, list) => {\n list.push({\n template: 'penmiss'\n })\n return '❌'\n },\n //'red' card - {{sent off|cards|min1|min2}}\n 'sent off': (tmpl, list) => {\n let obj = parse(tmpl, ['cards'])\n let result = {\n template: 'sent off',\n cards: obj.cards,\n minutes: obj.list || []\n }\n list.push(result)\n let mins = result.minutes.map(m => m + \"'\").join(', ')\n return 'sent off: ' + mins\n }\n}\nmodule.exports = sports\n","const parse = require('../_parsers/parse')\n\nconst misc = {\n 'baseball secondary style': 0,\n mlbplayer: function(tmpl, list) {\n let obj = parse(tmpl, ['number', 'name', 'dl'])\n list.push(obj)\n return obj.name\n }\n}\n\nmodule.exports = Object.assign({}, misc, require('./brackets'), require('./soccer'))\n","const parse = require('../_parsers/parse')\n\nconst codes = {\n adx: 'adx', //https://en.wikipedia.org/wiki/Template:Abu_Dhabi_Securities_Exchange\n aim: 'aim', //https://en.wikipedia.org/wiki/Template:Alternative_Investment_Market\n bvpasa: 'bvpasa', //https://en.wikipedia.org/wiki/Template:BVPASA\n asx: 'asx', //https://en.wikipedia.org/wiki/Template:Australian_Securities_Exchange\n athex: 'athex', //https://en.wikipedia.org/wiki/Template:Athens_Exchange\n bhse: 'bhse', //https://en.wikipedia.org/wiki/Template:Bahrain_Bourse\n bvb: 'bvb', //https://en.wikipedia.org/wiki/Template:Bucharest_Stock_Exchange\n bbv: 'bbv', //https://en.wikipedia.org/wiki/Template:BBV\n bsx: 'bsx', //https://en.wikipedia.org/wiki/Template:Bermuda_Stock_Exchange\n b3: 'b3', //https://en.wikipedia.org/wiki/Template:BM%26F_Bovespa\n 'bm&f': 'b3', //https://en.wikipedia.org/wiki/Template:BM%26F_Bovespa\n 'bm&f bovespa': 'b3', //https://en.wikipedia.org/wiki/Template:BM%26F_Bovespa\n bwse: 'bwse', //https://en.wikipedia.org/wiki/Template:Botswana_Stock_Exchange\n 'botswana stock exchange': 'botswana stock exchange', //https://en.wikipedia.org/wiki/Template:BM%26F_Bovespa\n bse: 'bse', //https://en.wikipedia.org/wiki/Template:Bombay_Stock_Exchange\n 'bombay stock exchange': 'bombay stock exchange', //https://en.wikipedia.org/wiki/Template:Bombay_Stock_Exchange\n bpse: 'bpse', //https://en.wikipedia.org/wiki/Template:Budapest_Stock_Exchange\n bcba: 'bcba', //https://en.wikipedia.org/wiki/Template:Buenos_Aires_Stock_Exchange\n 'canadian securities exchange': 'canadian securities exchange', //https://en.wikipedia.org/wiki/Template:Canadian_Securities_Exchange\n bvc: 'bvc', //https://en.wikipedia.org/wiki/Template:Colombian_Securities_Exchange\n cse: 'cse', //https://en.wikipedia.org/wiki/Template:Chittagong_Stock_Exchange\n darse: 'darse', //https://en.wikipedia.org/wiki/Template:Dar_es_Salaam_Stock_Exchange\n dse: 'dse', //https://en.wikipedia.org/wiki/Template:Dhaka_Stock_Exchange\n dfm: 'dfm', //https://en.wikipedia.org/wiki/Template:Dubai_Financial_Market\n euronext: 'euronext', //https://en.wikipedia.org/wiki/Template:Euronext\n fwb: 'fwb', //https://en.wikipedia.org/wiki/Template:Frankfurt_Stock_Exchange\n fse: 'fse', //https://en.wikipedia.org/wiki/Template:Fukuoka_Stock_Exchange\n gse: 'gse', //https://en.wikipedia.org/wiki/Template:Ghana_Stock_Exchange\n gtsm: 'gtsm', //https://en.wikipedia.org/wiki/Template:Gre_Tai_Securities_Market\n sehk: 'sehk', //https://en.wikipedia.org/wiki/Template:Hong_Kong_Stock_Exchange\n idx: 'idx', //https://en.wikipedia.org/wiki/Template:Indonesia_Stock_Exchange\n nse: 'nse', //https://en.wikipedia.org/wiki/Template:National_Stock_Exchange_of_India\n ise: 'ise', //https://en.wikipedia.org/wiki/Template:Irish_Stock_Exchange\n isin: 'isin', //https://en.wikipedia.org/wiki/Template:ISIN\n bist: 'bist', //https://en.wikipedia.org/wiki/Template:Borsa_Istanbul\n bit: 'bit', //https://en.wikipedia.org/wiki/Template:Borsa_Italiana\n jasdaq: 'jasdaq', //https://en.wikipedia.org/wiki/Template:JASDAQ\n jse: 'jse', //https://en.wikipedia.org/wiki/Template:Johannesburg_Stock_Exchange\n kase: 'kase', //https://en.wikipedia.org/wiki/Template:Kazakhstan_Stock_Exchange\n krx: 'krx', //https://en.wikipedia.org/wiki/Template:Korea_Exchange\n bvl: 'bvl', //https://en.wikipedia.org/wiki/Template:Lima_Stock_Exchange\n lse: 'lse', //https://en.wikipedia.org/wiki/Template:London_Stock_Exchange\n luxse: 'luxse', //https://en.wikipedia.org/wiki/Template:Luxembourg_Stock_Exchange\n bmad: 'bmad', //https://en.wikipedia.org/wiki/Template:Bolsa_de_Madrid\n myx: 'myx', //https://en.wikipedia.org/wiki/Template:Bursa_Malaysia\n bmv: 'bmv', //https://en.wikipedia.org/wiki/Template:Mexican_Stock_Exchange\n mcx: 'mcx', //https://en.wikipedia.org/wiki/Template:Moscow_Exchange\n mutf: 'mutf', //https://en.wikipedia.org/wiki/Template:Mutual_fund\n nag: 'nag', //https://en.wikipedia.org/wiki/Template:Nagoya_Stock_Exchange\n kn: 'kn', //https://en.wikipedia.org/wiki/Template:Nairobi_Securities_Exchange\n 'nasdaq dubai': 'nasdaq dubai', //https://en.wikipedia.org/wiki/Template:NASDAQ_Dubai\n nasdaq: 'nasdaq', //https://en.wikipedia.org/wiki/Template:NASDAQ\n neeq: 'neeq', //https://en.wikipedia.org/wiki/Template:NEEQ\n nepse: 'nepse', //https://en.wikipedia.org/wiki/Template:Nepal_Stock_Exchange\n nyse: 'nyse', //https://en.wikipedia.org/wiki/Template:New_York_Stock_Exchange\n nzx: 'nzx', //https://en.wikipedia.org/wiki/Template:New_Zealand_Exchange\n amex: 'amex', //https://en.wikipedia.org/wiki/Template:NYSE_American\n 'nyse arca': 'nyse arca', //https://en.wikipedia.org/wiki/Template:NYSE_Arca\n omx: 'omx', //https://en.wikipedia.org/wiki/Template:OMX\n 'omx baltic': 'omx baltic', //https://en.wikipedia.org/wiki/Template:OMX_Baltic\n ose: 'ose', //https://en.wikipedia.org/wiki/Template:Oslo_Stock_Exchange\n 'otc pink': 'otc pink', //https://en.wikipedia.org/wiki/Template:OTC_Pink\n otcqb: 'otcqb', //https://en.wikipedia.org/wiki/Template:OTCQB\n otcqx: 'otcqx', //https://en.wikipedia.org/wiki/Template:OTCQX\n 'philippine stock exchange': 'philippine stock exchange', //https://en.wikipedia.org/wiki/Template:Philippine_Stock_Exchange\n prse: 'prse', //https://en.wikipedia.org/wiki/Template:Prague_Stock_Exchange\n qe: 'qe', //https://en.wikipedia.org/wiki/Template:Qatar_Stock_Exchange\n bcs: 'bcs', //https://en.wikipedia.org/wiki/Template:Santiago_Stock_Exchange\n 'saudi stock exchange': 'saudi stock exchange', //https://en.wikipedia.org/wiki/Template:Saudi_Stock_Exchange\n sgx: 'sgx', //https://en.wikipedia.org/wiki/Template:Singapore_Exchange\n sse: 'sse', //https://en.wikipedia.org/wiki/Template:Shanghai_Stock_Exchange\n szse: 'szse', //https://en.wikipedia.org/wiki/Template:Shenzhen_Stock_Exchange\n swx: 'swx', //https://en.wikipedia.org/wiki/Template:SIX_Swiss_Exchange\n set: 'set', //https://en.wikipedia.org/wiki/Template:Stock_Exchange_of_Thailand\n tase: 'tase', //https://en.wikipedia.org/wiki/Template:Tel_Aviv_Stock_Exchange\n tyo: 'tyo', //https://en.wikipedia.org/wiki/Template:Tokyo_Stock_Exchange\n tsx: 'tsx', //https://en.wikipedia.org/wiki/Template:Toronto_Stock_Exchange\n twse: 'twse', //https://en.wikipedia.org/wiki/Template:Taiwan_Stock_Exchange\n 'tsx-v': 'tsx-v', //https://en.wikipedia.org/wiki/Template:TSX_Venture_Exchange\n tsxv: 'tsxv', //https://en.wikipedia.org/wiki/Template:TSX_Venture_Exchange\n nex: 'nex', //https://en.wikipedia.org/wiki/Template:TSXV_NEX\n ttse: 'ttse', //https://en.wikipedia.org/wiki/Template:Trinidad_and_Tobago_Stock_Exchange\n 'pfts ukraine stock exchange': 'pfts ukraine stock exchange', //https://en.wikipedia.org/wiki/Template:PFTS_Ukraine_Stock_Exchange\n wse: 'wse', //https://en.wikipedia.org/wiki/Template:Warsaw_Stock_Exchange\n wbag: 'wbag', //https://en.wikipedia.org/wiki/Template:Wiener_B%C3%B6rse\n zse: 'zse', //https://en.wikipedia.org/wiki/Template:Zagreb_Stock_Exchange\n 'zagreb stock exchange': 'zagreb stock exchange', //https://en.wikipedia.org/wiki/Template:Zagreb_Stock_Exchange\n 'zimbabwe stock exchange': 'zimbabwe stock exchange' //https://en.wikipedia.org/wiki/Template:Zimbabwe_Stock_Exchange\n}\n\nconst parseStockExchange = (tmpl, list) => {\n let o = parse(tmpl, ['ticketnumber', 'code'])\n list.push(o)\n let code = o.template || ''\n if (code === '') {\n code = o.code\n }\n code = (code || '').toLowerCase()\n let out = codes[code] || ''\n let str = out\n if (o.ticketnumber) {\n str = `${str}: ${o.ticketnumber}`\n }\n if (o.code && !codes[o.code.toLowerCase()]) {\n str += ' ' + o.code\n }\n return str\n}\n\nconst currencies = {}\n//the others fit the same pattern..\nObject.keys(codes).forEach(k => {\n currencies[k] = parseStockExchange\n})\n\nmodule.exports = currencies\n","const parse = require('../_parsers/parse')\nconst hasMonth = /^jan /i\nconst isYear = /^year /i\n\nconst monthList = [\n 'jan',\n 'feb',\n 'mar',\n 'apr',\n 'may',\n 'jun',\n 'jul',\n 'aug',\n 'sep',\n 'oct',\n 'nov',\n 'dec'\n]\n\nconst toNumber = function(str) {\n str = str.replace(/,/g, '')\n str = str.replace(/−/g, '-')\n let num = Number(str)\n if (isNaN(num)) {\n return str\n }\n return num\n}\n\nlet templates = {\n // this one is a handful!\n //https://en.wikipedia.org/wiki/Template:Weather_box\n 'weather box': (tmpl, list) => {\n let obj = parse(tmpl)\n //collect all month-based data\n let byMonth = {}\n let properties = Object.keys(obj).filter(k => hasMonth.test(k))\n properties = properties.map(k => k.replace(hasMonth, ''))\n properties.forEach(prop => {\n byMonth[prop] = []\n monthList.forEach(m => {\n let key = `${m} ${prop}`\n if (obj.hasOwnProperty(key)) {\n let num = toNumber(obj[key])\n delete obj[key]\n byMonth[prop].push(num)\n }\n })\n })\n //add these to original\n obj.byMonth = byMonth\n\n //collect year-based data\n let byYear = {}\n Object.keys(obj).forEach(k => {\n if (isYear.test(k)) {\n let prop = k.replace(isYear, '')\n byYear[prop] = obj[k]\n delete obj[k]\n }\n })\n obj.byYear = byYear\n\n list.push(obj)\n return ''\n },\n\n //The 36 parameters are: 12 monthly highs (C), 12 lows (total 24) plus an optional 12 monthly rain/precipitation\n //https://en.wikipedia.org/wiki/Template:Weather_box/concise_C\n 'weather box/concise c': (tmpl, list) => {\n let obj = parse(tmpl)\n obj.list = obj.list.map(s => toNumber(s))\n obj.byMonth = {\n 'high c': obj.list.slice(0, 12),\n 'low c': obj.list.slice(12, 24),\n 'rain mm': obj.list.slice(24, 36)\n }\n delete obj.list\n obj.template = 'weather box'\n list.push(obj)\n return ''\n },\n 'weather box/concise f': (tmpl, list) => {\n let obj = parse(tmpl)\n obj.list = obj.list.map(s => toNumber(s))\n obj.byMonth = {\n 'high f': obj.list.slice(0, 12),\n 'low f': obj.list.slice(12, 24),\n 'rain inch': obj.list.slice(24, 36)\n }\n delete obj.list\n obj.template = 'weather box'\n list.push(obj)\n return ''\n },\n\n //https://en.wikipedia.org/wiki/Template:Climate_chart\n 'climate chart': (tmpl, list) => {\n let lines = parse(tmpl).list || []\n let title = lines[0]\n let source = lines[38]\n lines = lines.slice(1)\n //amazingly, they use '−' symbol here instead of negatives...\n lines = lines.map(str => {\n if (str && str[0] === '−') {\n str = str.replace(/−/, '-')\n }\n return str\n })\n let months = []\n //groups of three, for 12 months\n for (let i = 0; i < 36; i += 3) {\n months.push({\n low: toNumber(lines[i]),\n high: toNumber(lines[i + 1]),\n precip: toNumber(lines[i + 2])\n })\n }\n let obj = {\n template: 'climate chart',\n data: {\n title: title,\n source: source,\n months: months\n }\n }\n list.push(obj)\n return ''\n }\n}\n\nmodule.exports = templates\n","//this format seems to be a pattern for these\nconst generic = ['id', 'title', 'description', 'section']\nconst idName = ['id', 'name']\n\n//https://en.wikipedia.org/wiki/Category:External_link_templates\nconst externals = {\n //https://en.wikipedia.org/wiki/Template:IMDb_title\n 'imdb title': generic,\n 'imdb name': generic,\n 'imdb episode': generic,\n 'imdb event': generic,\n 'afi film': generic,\n 'allmovie title': generic,\n allgame: generic,\n 'tcmdb title': generic,\n 'discogs artist': generic,\n 'discogs label': generic,\n 'discogs release': generic,\n 'discogs master': generic,\n 'librivox author': generic,\n 'musicbrainz artist': generic,\n 'musicbrainz label': generic,\n 'musicbrainz recording': generic,\n 'musicbrainz release': generic,\n 'musicbrainz work': generic,\n youtube: generic,\n 'goodreads author': idName,\n 'goodreads book': generic,\n twitter: idName,\n facebook: idName,\n instagram: idName,\n tumblr: idName,\n pinterest: idName,\n 'espn nfl': idName,\n 'espn nhl': idName,\n 'espn fc': idName,\n hockeydb: idName,\n 'fifa player': idName,\n worldcat: idName,\n 'worldcat id': idName,\n 'nfl player': idName,\n 'ted speaker': idName,\n playmate: idName,\n //https://en.wikipedia.org/wiki/Template:DMOZ\n dmoz: generic,\n\n 'find a grave': ['id', 'name', 'work', 'last', 'first', 'date', 'accessdate'],\n\n congbio: ['id', 'name', 'date'],\n\n 'hollywood walk of fame': ['name']\n}\n//alias\nexternals.imdb = externals['imdb name']\nexternals['imdb episodess'] = externals['imdb episode']\nmodule.exports = externals\n","const parse = require('../_parsers/parse')\n// const strip = require('./_parsers/_strip');\n\n//wiktionary... who knows. we should atleast try.\nconst templates = {\n //{{inflection of|avoir||3|p|pres|ind|lang=fr}}\n //https://en.wiktionary.org/wiki/Template:inflection_of\n inflection: (tmpl, list) => {\n let obj = parse(tmpl, ['lemma'])\n obj.tags = obj.list\n delete obj.list\n obj.type = 'form-of'\n list.push(obj)\n return obj.lemma || ''\n },\n\n //latin verbs\n 'la-verb-form': (tmpl, list) => {\n let obj = parse(tmpl, ['word'])\n list.push(obj)\n return obj.word || ''\n },\n 'feminine plural': (tmpl, list) => {\n let obj = parse(tmpl, ['word'])\n list.push(obj)\n return obj.word || ''\n },\n 'male plural': (tmpl, list) => {\n let obj = parse(tmpl, ['word'])\n list.push(obj)\n return obj.word || ''\n },\n rhymes: (tmpl, list) => {\n let obj = parse(tmpl, ['word'])\n list.push(obj)\n return 'Rhymes: -' + (obj.word || '')\n }\n}\n\n//https://en.wiktionary.org/wiki/Category:Form-of_templates\nlet conjugations = [\n 'abbreviation',\n 'abessive plural',\n 'abessive singular',\n 'accusative plural',\n 'accusative singular',\n 'accusative',\n 'acronym',\n 'active participle',\n 'agent noun',\n 'alternative case form',\n 'alternative form',\n 'alternative plural',\n 'alternative reconstruction',\n 'alternative spelling',\n 'alternative typography',\n 'aphetic form',\n 'apocopic form',\n 'archaic form',\n 'archaic spelling',\n 'aspirate mutation',\n 'associative plural',\n 'associative singular',\n 'attributive form',\n 'attributive form',\n 'augmentative',\n 'benefactive plural',\n 'benefactive singular',\n 'causative plural',\n 'causative singular',\n 'causative',\n 'clipping',\n 'combining form',\n 'comitative plural',\n 'comitative singular',\n 'comparative plural',\n 'comparative singular',\n 'comparative',\n 'contraction',\n 'dated form',\n 'dated spelling',\n 'dative plural definite',\n 'dative plural indefinite',\n 'dative plural',\n 'dative singular',\n 'dative',\n 'definite',\n 'deliberate misspelling',\n 'diminutive',\n 'distributive plural',\n 'distributive singular',\n 'dual',\n 'early form',\n 'eclipsis',\n 'elative',\n 'ellipsis',\n 'equative',\n 'euphemistic form',\n 'euphemistic spelling',\n 'exclusive plural',\n 'exclusive singular',\n 'eye dialect',\n 'feminine noun',\n 'feminine plural past participle',\n 'feminine plural',\n 'feminine singular past participle',\n 'feminine singular',\n 'feminine',\n 'form',\n 'former name',\n 'frequentative',\n 'future participle',\n 'genitive plural definite',\n 'genitive plural indefinite',\n 'genitive plural',\n 'genitive singular definite',\n 'genitive singular indefinite',\n 'genitive singular',\n 'genitive',\n 'gerund',\n 'h-prothesis',\n 'hard mutation',\n 'harmonic variant',\n 'imperative',\n 'imperfective form',\n 'inflected form',\n 'inflection',\n 'informal form',\n 'informal spelling',\n 'initialism',\n 'ja-form',\n 'jyutping reading',\n 'late form',\n 'lenition',\n 'masculine plural past participle',\n 'masculine plural',\n 'medieval spelling',\n 'misconstruction',\n 'misromanization',\n 'misspelling',\n 'mixed mutation',\n 'monotonic form',\n 'mutation',\n 'nasal mutation',\n 'negative',\n 'neuter plural past participle',\n 'neuter plural',\n 'neuter singular past participle',\n 'neuter singular',\n 'nominalization',\n 'nominative plural',\n 'nominative singular',\n 'nonstandard form',\n 'nonstandard spelling',\n 'oblique plural',\n 'oblique singular',\n 'obsolete form',\n 'obsolete spelling',\n 'obsolete typography',\n 'official form',\n 'participle',\n 'passive participle',\n 'passive',\n 'past active participle',\n 'past participle',\n 'past passive participle',\n 'past tense',\n 'perfective form',\n 'plural definite',\n 'plural indefinite',\n 'plural',\n 'polytonic form',\n 'present active participle',\n 'present participle',\n 'present tense',\n 'pronunciation spelling',\n 'rare form',\n 'rare spelling',\n 'reflexive',\n 'second-person singular past',\n 'short for',\n 'singular definite',\n 'singular',\n 'singulative',\n 'soft mutation',\n 'spelling',\n 'standard form',\n 'standard spelling',\n 'substantivisation',\n 'superlative',\n 'superseded spelling',\n 'supine',\n 'syncopic form',\n 'synonym',\n 'terminative plural',\n 'terminative singular',\n 'uncommon form',\n 'uncommon spelling',\n 'verbal noun',\n 'vocative plural',\n 'vocative singular'\n]\nconjugations.forEach(name => {\n templates[name + ' of'] = (tmpl, list) => {\n let obj = parse(tmpl, ['lemma'])\n obj.tags = obj.list\n delete obj.list\n obj.type = 'form-of'\n list.push(obj)\n return obj.lemma || ''\n }\n})\nmodule.exports = templates\n","module.exports = Object.assign(\n {},\n require('./dates'),\n require('./formatting'),\n require('./geo'),\n require('./wikipedia'),\n\n require('./brackets'),\n require('./currency'),\n require('./elections'),\n require('./flags'),\n require('./ipa'),\n require('./languages'),\n require('./math'),\n require('./misc'),\n require('./punctuation'),\n require('./science'),\n require('./soccer'),\n require('./sports'),\n require('./stock-exchanges'),\n require('./weather'),\n require('./websites'),\n require('./wiktionary')\n)\n","const ignore = require('./_ignore')\nconst parse = require('./_parsers/parse')\nconst inf = require('./_infobox')\nconst templates = require('./templates')\nconst generic = require('./_parsers/parse')\nconst nums = ['0', '1', '2', '3', '4', '5', '6', '7', '8']\n\nconst isArray = function(arr) {\n return Object.prototype.toString.call(arr) === '[object Array]'\n}\n\n//this gets all the {{template}} strings and decides how to parse them\nconst parseTemplate = function(tmpl, list) {\n let name = tmpl.name\n\n if (ignore.hasOwnProperty(name) === true) {\n return ''\n }\n\n // {{infobox settlement...}}\n if (inf.isInfobox(name) === true) {\n let obj = parse(tmpl.body, list, 'raw')\n let infobox = inf.format(obj)\n list.push(infobox)\n return ''\n }\n // //cite book, cite arxiv...\n if (/^cite [a-z]/.test(name) === true) {\n let obj = parse(tmpl.body, list)\n obj.type = obj.template\n obj.template = 'citation'\n list.push(obj)\n return ''\n }\n\n // known template\n if (templates.hasOwnProperty(name) === true) {\n // handle number-syntax\n if (typeof templates[name] === 'number') {\n let obj = generic(tmpl.body, nums)\n let key = String(templates[name])\n return obj[key] || ''\n }\n // handle string-syntax\n if (typeof templates[name] === 'string') {\n return templates[name]\n }\n // handle array sytax\n if (isArray(templates[name]) === true) {\n let obj = generic(tmpl.body, templates[name])\n list.push(obj)\n return ''\n }\n // handle function syntax\n if (typeof templates[name] === 'function') {\n return templates[name](tmpl.body, list)\n }\n }\n\n // unknown template, try to parse it\n let parsed = parse(tmpl.body)\n if (list && Object.keys(parsed).length > 0) {\n list.push(parsed)\n }\n // ..then remove it\n return ''\n}\nmodule.exports = parseTemplate\n","const Template = function(data) {\n Object.defineProperty(this, 'data', {\n enumerable: false,\n value: data\n })\n}\nconst methods = {\n text: function() {\n return ''\n },\n json: function() {\n return this.data\n }\n}\nObject.keys(methods).forEach(k => {\n Template.prototype[k] = methods[k]\n})\nmodule.exports = Template\n","const Infobox = require('../infobox/Infobox')\nconst Reference = require('../reference/Reference')\nconst findTemplates = require('./find')\nconst parse = require('./parse')\nconst Template = require('./Template')\nconst isCitation = new RegExp('^(cite |citation)', 'i')\n\nconst references = {\n citation: true,\n refn: true,\n harvnb: true\n}\n\nconst isReference = function(obj) {\n return references[obj.template] === true || isCitation.test(obj.template) === true\n}\n\nconst isObject = function(obj) {\n return obj && Object.prototype.toString.call(obj) === '[object Object]'\n}\n\nconst isInfobox = function(obj) {\n return obj.template === 'infobox' && obj.data && isObject(obj.data)\n}\n\n//reduce the scary recursive situations\nconst allTemplates = function(section) {\n let wiki = section.wiki\n // nested data-structure of templates\n let list = findTemplates(wiki)\n let keep = []\n\n // recursive template-parser\n const parseThem = function(obj, parent) {\n obj.parent = parent\n // do tail-first recurion\n if (obj.children && obj.children.length > 0) {\n obj.children.forEach(ch => parseThem(ch, obj))\n }\n obj.out = parse(obj, keep)\n // remove the text from every parent\n const removeIt = function(node, body, out) {\n if (node.parent) {\n node.parent.body = node.parent.body.replace(body, out)\n removeIt(node.parent, body, out)\n }\n }\n removeIt(obj, obj.body, obj.out)\n wiki = wiki.replace(obj.body, obj.out)\n }\n\n //kick it off\n list.forEach(node => parseThem(node, null))\n\n // sort-out the templates we decide to keep\n section.infoboxes = section.infoboxes || []\n section.references = section.references || []\n section.templates = section.templates || []\n section.templates = section.templates.concat(keep)\n // remove references and infoboxes from our list\n section.templates = section.templates.filter(obj => {\n if (isReference(obj) === true) {\n section.references.push(new Reference(obj))\n return false\n }\n if (isInfobox(obj) === true) {\n section.infoboxes.push(new Infobox(obj))\n return false\n }\n return true\n })\n section.templates = section.templates.map(obj => new Template(obj))\n\n // remove the templates from our wiki text\n list.forEach(node => {\n wiki = wiki.replace(node.body, node.out)\n })\n section.wiki = wiki\n}\n\nmodule.exports = allTemplates\n","const parseSentence = require('../../04-sentence/').fromText\nconst Image = require('../../image/Image')\n//okay, is a xml-tag, with newline-seperated data, somehow pivoted by '|'...\n//all deities help us. truly -> https://en.wikipedia.org/wiki/Help:Gallery_tag\n// - not to be confused with https://en.wikipedia.org/wiki/Template:Gallery...\nconst parseGallery = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/]*?)>([\\s\\S]+?)<\\/gallery>/g, (_, attrs, inside) => {\n let images = inside.split(/\\n/g)\n images = images.filter(str => str && str.trim() !== '')\n //parse the line, which has an image and sometimes a caption\n images = images.map(str => {\n let arr = str.split(/\\|/)\n let obj = {\n file: arr[0].trim()\n }\n let img = new Image(obj).json()\n let caption = arr.slice(1).join('|')\n if (caption !== '') {\n img.caption = parseSentence(caption)\n }\n return img\n })\n //add it to our templates list\n if (images.length > 0) {\n section.templates.push({\n template: 'gallery',\n images: images,\n pos: section.title\n })\n }\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseGallery\n","const parseTemplates = require('../../template')\n//this is a non-traditional template, for some reason\n//https://en.wikipedia.org/wiki/Template:Election_box\nconst parseElection = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/\\{\\{election box begin([\\s\\S]+?)\\{\\{election box end\\}\\}/gi, tmpl => {\n let data = {\n wiki: tmpl,\n templates: []\n }\n //put it through our full template parser..\n parseTemplates(data)\n //okay, pull it apart into something sensible..\n let templates = data.templates.map(t => t.json())\n let start = templates.find(t => t.template === 'election box') || {}\n let candidates = templates.filter(t => t.template === 'election box candidate')\n let summary = templates.find(t => t.template === 'election box gain' || t.template === 'election box hold') || {}\n if (candidates.length > 0 || summary) {\n section.templates.push({\n template: 'election box',\n title: start.title,\n candidates: candidates,\n summary: summary.data\n })\n }\n //remove it all\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseElection\n","const tableParser = require('../../table/parse')\nconst keys = {\n coach: ['team', 'year', 'g', 'w', 'l', 'w-l%', 'finish', 'pg', 'pw', 'pl', 'pw-l%'],\n player: ['year', 'team', 'gp', 'gs', 'mpg', 'fg%', '3p%', 'ft%', 'rpg', 'apg', 'spg', 'bpg', 'ppg'],\n roster: ['player', 'gp', 'gs', 'mpg', 'fg%', '3fg%', 'ft%', 'rpg', 'apg', 'spg', 'bpg', 'ppg']\n}\n\n//https://en.wikipedia.org/wiki/Template:NBA_player_statistics_start\nconst parseNBA = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/\\{\\{nba (coach|player|roster) statistics start([\\s\\S]+?)\\{\\{s-end\\}\\}/gi, (tmpl, name) => {\n tmpl = tmpl.replace(/^\\{\\{.*?\\}\\}/, '')\n tmpl = tmpl.replace(/\\{\\{s-end\\}\\}/, '')\n name = name.toLowerCase().trim()\n let headers = '! ' + keys[name].join(' !! ')\n let table = '{|\\n' + headers + '\\n' + tmpl + '\\n|}'\n let rows = tableParser(table)\n\n rows = rows.map(row => {\n Object.keys(row).forEach(k => {\n row[k] = row[k].text()\n })\n return row\n })\n section.templates.push({\n template: 'NBA ' + name + ' statistics',\n data: rows\n })\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseNBA\n","const tableParser = require('../../table/parse')\n//https://en.wikipedia.org/wiki/Template:MLB_game_log_section\n\n//this is pretty nuts\nconst whichHeadings = function(tmpl) {\n let headings = ['#', 'date', 'opponent', 'score', 'win', 'loss', 'save', 'attendance', 'record']\n if (/\\|stadium=y/i.test(tmpl) === true) {\n headings.splice(7, 0, 'stadium') //save, stadium, attendance\n }\n if (/\\|time=y/i.test(tmpl) === true) {\n headings.splice(7, 0, 'time') //save, time, stadium, attendance\n }\n if (/\\|box=y/i.test(tmpl) === true) {\n headings.push('box') //record, box\n }\n return headings\n}\n\nconst parseMlb = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/\\{\\{mlb game log (section|month)[\\s\\S]+?\\{\\{mlb game log (section|month) end\\}\\}/gi, tmpl => {\n let headings = whichHeadings(tmpl)\n tmpl = tmpl.replace(/^\\{\\{.*?\\}\\}/, '')\n tmpl = tmpl.replace(/\\{\\{mlb game log (section|month) end\\}\\}/i, '')\n let headers = '! ' + headings.join(' !! ')\n let table = '{|\\n' + headers + '\\n' + tmpl + '\\n|}'\n let rows = tableParser(table)\n rows = rows.map(row => {\n Object.keys(row).forEach(k => {\n row[k] = row[k].text()\n })\n return row\n })\n section.templates.push({\n template: 'mlb game log section',\n data: rows\n })\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseMlb\n","const tableParser = require('../../table/parse')\nlet headings = ['res', 'record', 'opponent', 'method', 'event', 'date', 'round', 'time', 'location', 'notes']\n\n//https://en.wikipedia.org/wiki/Template:MMA_record_start\nconst parseMMA = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/\\{\\{mma record start[\\s\\S]+?\\{\\{end\\}\\}/gi, tmpl => {\n tmpl = tmpl.replace(/^\\{\\{.*?\\}\\}/, '')\n tmpl = tmpl.replace(/\\{\\{end\\}\\}/i, '')\n let headers = '! ' + headings.join(' !! ')\n let table = '{|\\n' + headers + '\\n' + tmpl + '\\n|}'\n let rows = tableParser(table)\n rows = rows.map(row => {\n Object.keys(row).forEach(k => {\n row[k] = row[k].text()\n })\n return row\n })\n section.templates.push({\n template: 'mma record start',\n data: rows\n })\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseMMA\n","const parseSentence = require('../../04-sentence/').fromText\n//xml y=mx+b support\n//https://en.wikipedia.org/wiki/Help:Displaying_a_formula\nconst parseMath = function(section) {\n let wiki = section.wiki\n wiki = wiki.replace(/]*?)>([\\s\\S]+?)<\\/math>/g, (_, attrs, inside) => {\n //clean it up a little?\n let formula = parseSentence(inside).text()\n section.templates.push({\n template: 'math',\n formula: formula,\n raw: inside\n })\n //should we atleast try to render it in plaintext? :/\n if (formula && formula.length < 12) {\n return formula\n }\n return ''\n })\n //try chemistry version too\n wiki = wiki.replace(/]*?)>([\\s\\S]+?)<\\/chem>/g, (_, attrs, inside) => {\n section.templates.push({\n template: 'chem',\n data: inside\n })\n return ''\n })\n section.wiki = wiki\n}\nmodule.exports = parseMath\n","const parseGallery = require('./gallery')\nconst parseElection = require('./election')\nconst parseNBA = require('./nba')\nconst parseMlb = require('./mlb')\nconst parseMMA = require('./mma')\nconst parseMath = require('./math')\n// Most templates are '{{template}}', but then, some are ''.\n// ... others are {{start}}...{{end}}\n// -> these are those ones.\nconst xmlTemplates = function(section) {\n parseElection(section)\n parseGallery(section)\n parseMath(section)\n parseMlb(section)\n parseMMA(section)\n parseNBA(section)\n}\n\nmodule.exports = xmlTemplates\n","const Section = require('./Section')\nconst i18n = require('../_data/i18n')\nconst isReference = new RegExp('^(' + i18n.references.join('|') + '):?', 'i')\nconst section_reg = /(?:\\n|^)(={2,5}.{1,200}?={2,5})/g\n\n//interpret ==heading== lines\nconst parse = {\n heading: require('./heading'),\n table: require('../table'),\n paragraphs: require('../03-paragraph'),\n templates: require('../template'),\n references: require('../reference'),\n startEndTemplates: require('./start-to-end')\n}\n\nconst oneSection = function(section, doc) {\n parse.startEndTemplates(section)\n //parse-out the tags\n parse.references(section)\n //parse-out all {{templates}}\n parse.templates(section)\n // //parse the tables\n parse.table(section)\n //now parse all double-newlines\n parse.paragraphs(section, doc)\n section = new Section(section)\n return section\n}\n\nconst removeReferenceSection = function(sections) {\n return sections.filter((s, i) => {\n if (isReference.test(s.title()) === true) {\n if (s.paragraphs().length > 0) {\n return true\n }\n //does it have some wacky templates?\n if (s.templates().length > 0) {\n return true\n }\n //what it has children? awkward\n if (sections[i + 1] && sections[i + 1].depth > s.depth) {\n sections[i + 1].depth -= 1 //move it up a level?...\n }\n return false\n }\n return true\n })\n}\n\nconst parseSections = function(doc) {\n let sections = []\n let split = doc.wiki.split(section_reg)\n for (let i = 0; i < split.length; i += 2) {\n let heading = split[i - 1] || ''\n let wiki = split[i] || ''\n if (wiki === '' && heading === '') {\n //usually an empty 'intro' section\n continue\n }\n let section = {\n title: '',\n depth: null,\n wiki: wiki,\n templates: [],\n tables: [],\n infoboxes: [],\n references: []\n }\n //figure-out title/depth\n parse.heading(section, heading)\n //parse it up\n let s = oneSection(section, doc)\n sections.push(s)\n }\n //remove empty references section\n doc.sections = removeReferenceSection(sections)\n}\n\nmodule.exports = parseSections\n","const i18n = require('../_data/i18n')\nconst cat_reg = new RegExp('\\\\[\\\\[:?(' + i18n.categories.join('|') + '):(.{2,178}?)]](w{0,10})', 'ig')\nconst cat_remove_reg = new RegExp('^\\\\[\\\\[:?(' + i18n.categories.join('|') + '):', 'ig')\n\nconst parse_categories = function(doc) {\n let wiki = doc.wiki\n let tmp = wiki.match(cat_reg) //regular links\n if (tmp) {\n tmp.forEach(function(c) {\n c = c.replace(cat_remove_reg, '')\n c = c.replace(/\\|?[ \\*]?\\]\\]$/i, '') //parse fancy onces..\n c = c.replace(/\\|.*/, '') //everything after the '|' is metadata\n if (c && !c.match(/[\\[\\]]/)) {\n doc.categories.push(c.trim())\n }\n })\n }\n wiki = wiki.replace(cat_reg, '')\n doc.wiki = wiki\n}\nmodule.exports = parse_categories\n","const Document = require('./Document')\nconst redirects = require('./redirects')\nconst preProcess = require('./preProcess')\nconst parse = {\n section: require('../02-section'),\n categories: require('./categories')\n}\n\n//convert wikiscript markup lang to json\nconst main = function(wiki, options) {\n options = options || {}\n let data = Object.assign(options, {\n title: options.title || null,\n pageID: options.pageID || options.id || null,\n namespace: options.namespace || options.ns || null,\n type: 'page',\n wiki: wiki || '',\n categories: [],\n sections: [],\n coordinates: []\n })\n //detect if page is just redirect, and return it\n if (redirects.isRedirect(wiki) === true) {\n data.type = 'redirect'\n data.redirectTo = redirects.parse(wiki)\n parse.categories(data)\n return new Document(data)\n }\n //give ourselves a little head-start\n preProcess(data)\n //pull-out [[category:whatevers]]\n parse.categories(data)\n //parse all the headings, and their texts/sentences\n parse.section(data)\n //all together now\n return new Document(data)\n}\n\nmodule.exports = main\n","const wtf = require('../01-document')\n\n// flip response object into proper Doc objs\nconst parseDoc = function(res) {\n res = res.filter(o => o)\n let docs = res.map(o => {\n return wtf(o.wiki, o.meta)\n })\n if (docs.length === 0) {\n return null\n }\n if (docs.length === 1) {\n return docs[0]\n }\n return docs\n}\nmodule.exports = parseDoc\n","// use the native client-side fetch function\nconst request = function(url, opts) {\n //eslint-disable-next-line\n return fetch(url, opts).then(function(res) {\n return res.json()\n })\n}\nmodule.exports = request\n","const makeHeaders = function(options) {\n let agent =\n options.userAgent ||\n options['User-Agent'] ||\n options['Api-User-Agent'] ||\n 'User of the wtf_wikipedia library'\n\n const opts = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'Api-User-Agent': agent,\n 'User-Agent': agent,\n Origin: '*'\n },\n redirect: 'follow'\n }\n return opts\n}\nmodule.exports = makeHeaders\n","const parseUrl = require('./00-parseUrl')\nconst makeUrl = require('./01-makeUrl')\nconst getResult = require('./02-getResult')\nconst parseDoc = require('./03-parseDoc')\nconst http = require('./http/server')\nconst makeHeaders = require('./_headers')\nconst isUrl = /^https?:\\/\\//\n\nconst defaults = {\n lang: 'en',\n wiki: 'wikipedia',\n domain: null,\n follow_redirects: true,\n path: 'api.php' //some 3rd party sites use a weird path\n}\n\nconst fetch = function(title, options, c) {\n let callback = null\n if (typeof options === 'function') {\n callback = options\n options = {}\n }\n if (typeof c === 'function') {\n callback = c\n c = {}\n }\n //support lang 2nd param\n if (typeof options === 'string') {\n c = c || {}\n options = Object.assign({}, { lang: options }, c)\n }\n options = options || {}\n options = Object.assign({}, defaults, options)\n options.title = title\n // parse url input\n if (isUrl.test(title)) {\n options = Object.assign(options, parseUrl(title))\n }\n\n const url = makeUrl(options)\n const headers = makeHeaders(options)\n return http(url, headers)\n .then(res => {\n try {\n let data = getResult(res, options)\n data = parseDoc(data)\n if (callback) {\n callback(null, data)\n }\n return data\n } catch (e) {\n throw e\n }\n })\n .catch(e => {\n console.error(e)\n if (callback) {\n callback(e, null)\n }\n return null\n })\n}\nmodule.exports = fetch\n","const http = require('./http/server')\nconst makeHeaders = require('./_headers')\nconst getResult = require('./02-getResult')\nconst parseDoc = require('./03-parseDoc')\n\nconst defaults = {\n lang: 'en',\n wiki: 'wikipedia',\n domain: null,\n path: 'w/api.php' //some 3rd party sites use a weird path\n}\nconst isObject = function(obj) {\n return obj && Object.prototype.toString.call(obj) === '[object Object]'\n}\n\nconst fetchRandom = function(lang, options) {\n options = options || {}\n options = Object.assign({}, defaults, options)\n //support lang 2nd param\n if (typeof lang === 'string') {\n options.lang = lang\n } else if (isObject(lang)) {\n options = Object.assign(options, lang)\n }\n\n let url = `https://${options.lang}.wikipedia.org/${options.path}?`\n if (options.domain) {\n url = `https://${options.domain}/${options.path}?`\n }\n url += `format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*`\n\n const headers = makeHeaders(options)\n return http(url, headers)\n .then(res => {\n try {\n let data = getResult(res)\n return parseDoc(data)\n } catch (e) {\n throw e\n }\n })\n .catch(e => {\n console.error(e)\n return null\n })\n}\nmodule.exports = fetchRandom\n","const http = require('./http/server')\nconst makeHeaders = require('./_headers')\n\nconst defaults = {\n lang: 'en',\n wiki: 'wikipedia',\n domain: null,\n path: 'w/api.php' //some 3rd party sites use a weird path\n}\n\nconst normalizeCategory = function(cat = '') {\n if (/^Category/i.test(cat) === false) {\n cat = 'Category:' + cat\n }\n cat = cat.replace(/ /g, '_')\n return cat\n}\n\nconst isObject = function(obj) {\n return obj && Object.prototype.toString.call(obj) === '[object Object]'\n}\n\nconst getResult = function(body) {\n let list = body.query.categorymembers || []\n let res = {\n pages: [],\n categories: []\n }\n list.forEach(p => {\n if (p.ns === 14) {\n delete p.ns\n res.categories.push(p)\n } else {\n delete p.ns\n res.pages.push(p)\n }\n })\n return res\n}\n\nconst makeUrl = function(category, options, cm) {\n category = normalizeCategory(category)\n category = encodeURIComponent(category)\n let url = `https://${options.lang}.wikipedia.org/${options.path}?`\n if (options.domain) {\n url = `https://${options.domain}/${options.path}?`\n }\n url += `action=query&list=categorymembers&cmtitle=${category}&cmlimit=500&format=json&origin=*&redirects=true&cmtype=page|subcat`\n if (cm) {\n url += '&cmcontinue=' + cm\n }\n return url\n}\n\nconst fetchCategory = function(category, lang, options) {\n options = options || {}\n options = Object.assign({}, defaults, options)\n //support lang 2nd param\n if (typeof lang === 'string') {\n options.lang = lang\n } else if (isObject(lang)) {\n options = Object.assign(options, lang)\n }\n let res = {\n pages: [],\n categories: []\n }\n // wrap a promise around potentially-many requests\n return new Promise((resolve, reject) => {\n const doit = function(cm) {\n let url = makeUrl(category, options, cm)\n const headers = makeHeaders(options)\n return http(url, headers)\n .then(body => {\n res = getResult(body, res)\n if (body.continue && body.continue.cmcontinue) {\n doit(body.continue.cmcontinue)\n } else {\n resolve(res)\n }\n })\n .catch(e => {\n console.error(e)\n reject(e)\n })\n }\n doit(null)\n })\n}\n\nmodule.exports = fetchCategory\n","module.exports = '8.1.1'","const fetch = require('./_fetch')\nconst random = require('./_fetch/random')\nconst category = require('./_fetch/category')\nconst version = require('./_version')\nconst parseDocument = require('./01-document/index.js')\n\n//the main 'factory' exported method\nconst wtf = function(wiki, options) {\n return parseDocument(wiki, options)\n}\n\n// export classes for plugin development\nconst models = {\n Doc: require('./01-document/Document'),\n Section: require('./02-section/Section'),\n Paragraph: require('./03-paragraph/Paragraph'),\n Sentence: require('./04-sentence/Sentence'),\n Image: require('./image/Image'),\n Infobox: require('./infobox/Infobox'),\n Link: require('./link/Link'),\n List: require('./list/List'),\n Reference: require('./reference/Reference'),\n Table: require('./table/Table'),\n Template: require('./template/Template'),\n wtf: wtf\n}\nlet templates = require('./template/templates')\n\nwtf.fetch = function(title, lang, options, cb) {\n return fetch(title, lang, options, cb)\n}\nwtf.random = function(lang, options, cb) {\n return random(lang, options, cb)\n}\nwtf.category = function(cat, lang, options, cb) {\n return category(cat, lang, options, cb)\n}\nwtf.extend = function(fn) {\n fn(models, templates, this)\n return this\n}\nwtf.version = version\n\nmodule.exports = wtf\n"],"names":["parseUrl","url","parsed","URL","title","pathname","replace","decodeURIComponent","domain","host","isInterWiki","defaults","action","prop","rvprop","maxlag","rvslots","origin","format","redirects","toQueryString","obj","Object","entries","map","key","value","encodeURIComponent","join","isArray","arr","prototype","toString","call","cleanTitle","page","trim","makeUrl","options","params","assign","lang","wiki","wikiUrl","path","test","follow_redirects","pageids","titles","getResult","data","pages","keys","query","docs","id","hasOwnProperty","text","revisions","slots","main","meta","pageID","pageid","namespace","ns","e","console","error","sectionMap","doc","fn","clue","sections","forEach","sec","list","t","push","setDefaults","categories","toJSON","i","json","isRedirect","redirectTo","coordinates","infoboxes","images","plaintext","citations","references","i18n","require$$0","reduce","h","str","d","english","isDisambig","templates","found","find","template","firstLine","sentences","caption","alt","links","thumb","toJson","img","file","thumbnail","server","encodeTitle","charAt","toUpperCase","substring","makeSrc","Image","defineProperty","enumerable","methods","size","split","length","toLowerCase","k","src","tables","lists","paragraphs","Document","undefined","guess","sen","bolds","language","type","isDisambiguation","disambig","s","n","concat","paragraph","sentence","info","image","unshift","interwiki","sort","a","b","debug","log","indent","depth","plurals","sing","res","redirectsTo","redirect","require$$1","require$$2","require$$3","require$$4","require$$5","aa","ab","af","ak","als","am","an","ang","ar","arc","as","ast","av","ay","az","ba","bar","bcl","be","bg","bh","bi","bm","bn","bo","bpy","br","bs","bug","bxr","ca","cdo","ce","ceb","ch","cho","chr","chy","co","cr","cs","csb","cu","cv","cy","da","de","diq","dsb","dv","dz","ee","far","el","en","eo","es","et","eu","ext","ff","fi","fj","fo","fr","frp","fur","fy","ga","gan","gd","gil","gl","gn","got","gu","gv","ha","hak","haw","he","hi","ho","hr","ht","hu","hy","hz","ia","ie","ig","ii","ik","ilo","io","is","it","iu","ja","jbo","jv","ka","kg","ki","kj","kk","kl","km","kn","khw","ko","kr","ks","ksh","ku","kv","kw","ky","la","lad","lan","lb","lg","li","lij","lmo","ln","lo","lt","lv","mg","man","mh","mi","min","mk","ml","mn","mo","mr","ms","mt","mus","my","na","nah","nap","nd","nds","ne","ng","nl","nn","no","nr","nso","nrm","nv","ny","oc","oj","om","or","os","pa","pag","pam","pap","pdc","pi","pih","pl","pms","ps","pt","qu","rm","rmy","rn","ro","ru","rw","sa","sc","scn","sco","sd","se","sg","sh","si","simple","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tet","tg","th","ti","tk","tl","tlh","tn","to","tpi","tr","ts","tt","tum","tw","ty","udm","ug","uk","ur","uz","ve","vi","vec","vls","vo","wa","war","wo","xal","xh","yi","yo","za","zh","zu","wp","wm","w","acronym","advisory","advogato","aew","appropedia","aquariumwiki","arborwiki","arxiv","atmwiki","baden","battlestarwiki","bcnbio","beacha","betawiki","bibcode","bibliowiki","bluwiki","blw","botwiki","boxrec","brickwiki","bugzilla","bulba","c","c2","c2find","cache","ĉej","cellwiki","centralwikia","chej","choralwiki","citizendium","ckwiss","comixpedia","commons","communityscheme","communitywiki","comune","creativecommons","creativecommonswiki","cxej","dcc","dcdatabase","dcma","debian","delicious","devmo","dictionary","dict","disinfopedia","distributedproofreaders","distributedproofreadersca","dmoz","dmozs","doi","donate","doom_wiki","download","dbdump","dpd","drae","dreamhost","drumcorpswiki","dwjwiki","eĉei","ecoreality","ecxei","elibre","emacswiki","encyc","energiewiki","englyphwiki","enkol","eokulturcentro","esolang","etherpad","ethnologue","ethnologuefamily","evowiki","exotica","fanimutationwiki","fedora","finalfantasy","finnix","flickruser","flickrphoto","floralwiki","foldoc","foundation","foundationsite","foxwiki","freebio","freebsdman","freeculturewiki","freedomdefined","freefeel","freekiwiki","freesoft","ganfyd","gardenology","gausswiki","gentoo","genwiki","gerrit","git","google","googledefine","googlegroups","guildwarswiki","guildwiki","guc","gucprefix","gutenberg","gutenbergwiki","hackerspaces","h2wiki","hammondwiki","hdl","heraldik","heroeswiki","horizonlabs","hrwiki","hrfwiki","hupwiki","iarchive","imdbname","imdbtitle","imdbcompany","imdbcharacter","incubator","infosecpedia","infosphere","issn","iuridictum","jaglyphwiki","jefo","jerseydatabase","jira","jspwiki","jstor","kamelo","karlsruhe","kinowiki","komicawiki","kontuwiki","wikitech","libreplanet","linguistlist","linuxwiki","linuxwikide","liswiki","literateprograms","livepedia","localwiki","lojban","lostpedia","lqwiki","luxo","mail","mailarchive","mariowiki","marveldatabase","meatball","mw","mediazilla","memoryalpha","metawiki","metawikimedia","metawikipedia","mineralienatlas","moinmoin","monstropedia","mosapedia","mozcom","mozillawiki","mozillazinekb","musicbrainz","mediawikiwiki","mwod","mwot","nkcells","nara","nosmoke","nost","nostalgia","oeis","oldwikisource","olpc","omegawiki","onelook","openlibrary","openstreetmap","openwetware","opera7wiki","organicdesign","orthodoxwiki","osmwiki","otrs","otrswiki","ourmedia","outreach","outreachwiki","owasp","panawiki","patwiki","personaltelco","petscan","phab","phabricator","phwiki","phpwiki","planetmath","pmeg","pmid","pokewiki","pokéwiki","policy","proofwiki","pyrev","pythoninfo","pythonwiki","pywiki","psycle","quality","quarry","regiowiki","rev","revo","rfc","rheinneckar","robowiki","rodovid","reuterswiki","rowiki","rt","s23wiki","scholar","schoolswp","scores","scoutwiki","scramble","seapig","seattlewiki","slwiki","senseislibrary","sharemap","silcode","slashdot","sourceforge","spcom","species","squeak","stats","stewardry","strategy","strategywiki","sulutil","swtrain","svn","swinbrain","tabwiki","tclerswiki","technorati","tenwiki","testwiki","testwikidata","test2wiki","tfwiki","thelemapedia","theopedia","thinkwiki","ticket","tmbw","tmnet","tmwiki","toolforge","toollabs","tools","tswiki","translatewiki","tviv","tvtropes","twiki","tyvawiki","umap","uncyclopedia","unihan","unreal","urbandict","usej","usemod","usability","utrs","vikidia","vlos","vkol","voipinfo","votewiki","werelate","wg","wikia","wikiasite","wikiapiary","wikibooks","wikichristian","wikicities","wikicity","wikiconference","wikidata","wikif1","wikifur","wikihow","wikiindex","wikilemon","wikilivres","wikilivresru","wikimedia","wikinews","wikinfo","wikinvest","wikiotics","wikipapers","wikipedia","wikipediawikipedia","wikiquote","wikisophia","wikisource","wikispecies","wikispot","wikiskripta","labsconsole","wikiti","wikiversity","wikivoyage","betawikiversity","wikiwikiweb","wiktionary","wipipedia","wlug","wmam","wmar","wmat","wmau","wmbd","wmbe","wmbr","wmca","wmch","wmcl","wmcn","wmco","wmcz","wmdc","securewikidc","wmde","wmdk","wmee","wmec","wmes","wmet","wmfdashboard","wmfi","wmfr","wmge","wmhi","wmhk","wmhu","wmid","wmil","wmin","wmit","wmke","wmmk","wmmx","wmnl","wmnyc","wmno","wmph","wmpl","wmpt","wmpunjabi","wmromd","wmrs","wmru","wmse","wmsk","wmtr","wmtw","wmua","wmuk","wmve","wmza","wm2005","wm2006","wm2007","wm2008","wm2009","wm2010","wm2011","wm2012","wm2013","wm2014","wm2015","wm2016","wm2017","wm2018","wmania","wikimania","wmteam","wmf","wmfblog","wmdeblog","wookieepedia","wowwiki","wqy","wurmpedia","viaf","zrhwiki","zum","zwiki","m","sep11","minnan","nb","nan","vro","cmn","lzh","rup","gsw","sgs","egl","wikt","q","chapter","v","voy","languages","interwikis","parseInterwiki","indexOf","match","site","ignore_links","external_link","link_reg","external_links","raw","protocol","link","internal_links","suffix","txt","anchor","parse_interwiki","parse_links","REDIRECT_REGEX","RegExp","parse","parseLink","ignore","openTag","closeTag","anyChar","noThanks","kill_xml","preProcess","specialChar","encodeStr","encodeObj","headers","section","p","encode","ref","Section","_title","index","indentation","templ","o","filter","name","num","remove","bads","children","nextSibling","lastSibling","parent","pList","next","last","previousSibling","previous","capitalise","slice","trim_whitespace","Link","href","wikis","removeLinks","line","getLinks","parseLinks","formatting","italics","fmt","bold","italic","isNumber","dates","numbers","Number","isNaN","number","l","Sentence","abbreviations","literalAbbreviations","abbrev_reg","acronym_reg","elipses_reg","hasWord","flatten","all","naiive_split","splits","isBalanced","open","closed","quotes","sentence_parser","chunks","isSentence","hmm","postprocess","helpers","fromText","parseFmt","byParagraph","sentenceParser","strip","tmpl","fmtName","pipeSplitter","pop","hasKey","reserved","parseKey","parts","val","keyMaker","order","whoCares","classname","style","align","margin","left","boxsize","framestyle","item_style","collapsible","list_style_type","colwidth","cleanup","parseSentence","makeFormat","parser","shift","Reference","encyclopedia","author","hasCitation","parseCitation","parseInline","inline","parseRefs","r","heading_reg","parseHeading","parseReferences","fns","lines","findRows","rows","row","getRowSpan","getColSpan","doColSpan","parseInt","splice","doRowSpan","handleSpans","isHeading","headings","age","born","date","year","city","country","population","count","cleanText","skipSpanRow","len","hasTxt","removeMidSpans","findHeaders","first","Boolean","parseRow","firstRowHeader","parseTable","want","table","Table","keyValue","keyvalue","keyval","openReg","closeReg","findTables","stack","Paragraph","opener","closer","nested_find","out","chars","open_count","close_count","j","isFile","fileNames","file_reg","imgLayouts","border","right","center","top","bottom","none","upright","baseline","middle","sub","oneImage","imgData","parseTemplate","parseImages","matches","toText","List","list_reg","bullet_reg","number_reg","has_word","isList","cleanList","grabList","parseList","theRest","parseSentences","twoNewLines","parseParagraphs","infobox","normalize","Infobox","_type","get","tmp","close","findFlat","carry","getName","hasTemplate","body","doEach","substr","inside","findTemplates","i18nReg","startReg","endReg","yearIn","known","editnotice","geobox","hybridbox","ichnobox","infraspeciesbox","mycomorphbox","oobox","speciesbox","subspeciesbox","taxobox","nhlteamseason","edencharacter","samurai","protein","ordination","mlbbioret","isInfobox","fmtInfobox","monthName","months","ymd","units","month","String","tz","pad","hour","minute","time","second","misc","reign","start","end","circa","Date","getFullYear","getMonth","getDate","monthname","oldstyledate","day","getEpoch","getTime","delta","from","diff","years","Math","floor","days","getBoth","parsers","timezone","natural_date","one_year","two_dates","birth_year","birth_month","birth_date","death_year","death_month","death_date","timeSince","now","predicate","abs","hours","dateTmpl","currentday","currentdayname","getDay","currentmonth","currentyear","monthyear","setMonth","birth_day","dts","birth","death","birthdeathage","dob","localday","localdayname","localmonth","localyear","currentmonthname","currentmonthabbrev","bda","tag","span","div","content","attribs","plural","word","sep","trunc","p1","p2","p3","braces","attrs","nobold","noitalic","nocaps","syntaxhighlight","code","samp","vanchor","resize","ra","minutes","seconds","deg2hms","degrees","hms2deg","decdeg","deg","rnd","dec","toLocaleString","u","ul","upl","tmpls","plainlist","hlist","pagelist","catlist","f","flatlist","ublist","collist","columnslist","convert","two","four","three","term","defn","lino","linum","ill","frac","height","result","unit","quote","lbs","lbc","lbb","own","sic","one","nolink","formatnum","lc","lcfirst","uc","ucfirst","padleft","padStart","padright","padEnd","abbr","abbrlink","finedetail","parseDms","hemisphere","sign","decDeg","round","places","negative","findLatLng","types","lat","lon","convertDMS","parseParams","props","parseCoor","coord","display","geo","etyl","mention","sortname","target","dab","ll","sisterProjects","commonscat","about","desc","sfn","alias","teplate","audio","rp","gallery","unreferenced","citation","titlecase","cells","moreCells","won","place","zeroPad","parseTeam","team","score","seed","playoffBracket","rounds","brackets","codes","a$","au$","aud","bdt","brl","ca$","cad","chf","cny","czk","dkk","dkk2","euro","gbp","hk$","hkd","ils","inr","jpy","myr","nis","nok","nok2","nz$","nzd","peso","pkr","r$","rmb","rub","ruble","rupee","s$","sek","sek2","sfr","sgd","shekel","sheqel","ttd","us$","usd","yen","zar","parseCurrency","amount","inrConvert","currency_formatting","multiplier","rupee_value","currencies","currency","monnaie","unité","nombre","iso4217","inrconvert","flag","flags","flagcountry","flagcu","flagicon","flagdeco","fb","fbicon","flagathlete","getLang","english_title","ipa","ipac","transcription","transl","text2","iso","taste","nihongo","romaji","kanji","percentage","numerator","denominator","perc","decimals","toFixed","math","formula","integer","radic","before","after","done","total","digits","wins","losses","ties","games","ignore_ties","winlosspct","generic","persondata","portal","reflist","uss","isbn","marriage","spouse","releases","region","barrels","punctuation","mpc","chem2","equation","sky","ascension","asc_hours","asc_minutes","asc_seconds","declination","dec_sign","dec_degrees","dec_minutes","dec_seconds","distance","sports","player","goal","note","summary","yel","subon","suboff","pengoal","penmiss","cards","mins","mlbplayer","adx","aim","bvpasa","asx","athex","bhse","bvb","bbv","bsx","b3","bwse","bse","bpse","bcba","bvc","cse","darse","dse","dfm","euronext","fwb","fse","gse","gtsm","sehk","idx","nse","ise","isin","bist","bit","jasdaq","jse","kase","krx","bvl","lse","luxse","bmad","myx","bmv","mcx","mutf","nag","nasdaq","neeq","nepse","nyse","nzx","amex","omx","ose","otcqb","otcqx","prse","qe","bcs","sgx","sse","szse","swx","set","tase","tyo","tsx","twse","tsxv","nex","ttse","wse","wbag","zse","parseStockExchange","ticketnumber","hasMonth","isYear","monthList","toNumber","byMonth","properties","byYear","source","low","high","precip","idName","externals","allgame","youtube","twitter","facebook","instagram","tumblr","pinterest","hockeydb","worldcat","playmate","congbio","imdb","inflection","tags","lemma","rhymes","conjugations","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","nums","inf","Template","isCitation","refn","harvnb","isReference","isObject","allTemplates","keep","parseThem","removeIt","node","parseGallery","_","pos","parseElection","parseTemplates","candidates","coach","roster","parseNBA","tableParser","whichHeadings","parseMlb","parseMMA","parseMath","xmlTemplates","section_reg","heading","startEndTemplates","oneSection","removeReferenceSection","parseSections","cat_reg","cat_remove_reg","parse_categories","parseDoc","wtf","request","opts","fetch","then","makeHeaders","agent","userAgent","method","Origin","isUrl","callback","http","fetchRandom","normalizeCategory","cat","categorymembers","category","cm","fetchCategory","Promise","resolve","reject","doit","cmcontinue","parseDocument","models","Doc","cb","random","extend","version"],"mappings":";;;;;;;EAAA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAASC,GAAT,EAAc;EAC7B,MAAIC,MAAM,GAAG,IAAIC,GAAJ,CAAQF,GAAR,CAAb,CAD6B;;EAE7B,MAAIG,KAAK,GAAGF,MAAM,CAACG,QAAP,CAAgBC,OAAhB,CAAwB,cAAxB,EAAwC,EAAxC,CAAZ;EACAF,EAAAA,KAAK,GAAGG,kBAAkB,CAACH,KAAD,CAA1B;EACA,SAAO;EACLI,IAAAA,MAAM,EAAEN,MAAM,CAACO,IADV;EAELL,IAAAA,KAAK,EAAEA;EAFF,GAAP;EAID,CARD;;EASA,eAAc,GAAGJ,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECTA,IAAMU,WAAW,GAAG,kIA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AA,KAAK,EAAEshB,OAVM;EAWba,EAAAA,QAAQ,EAAEZ,UAXG;EAYbgD,EAAAA,GAAG,EAAEA;EAZQ,CAAf;;EAgBAA,GAAG,CAACG,KAAJ,GAAY,UAAS9kD,KAAT,EAAgBqC,IAAhB,EAAsBH,OAAtB,EAA+BqkD,EAA/B,EAAmC;EAC7C,SAAOzB,MAAK,CAAC9kD,KAAD,EAAQqC,IAAR,EAAcH,OAAd,CAAZ;EACD,CAFD;;EAGAyiD,GAAG,CAAC6B,MAAJ,GAAa,UAASnkD,IAAT,EAAeH,OAAf,EAAwBqkD,EAAxB,EAA4B;EACvC,SAAOC,MAAM,CAACnkD,IAAD,EAAOH,OAAP,CAAb;EACD,CAFD;;EAGAyiD,GAAG,CAACiB,QAAJ,GAAe,UAASF,GAAT,EAAcrjD,IAAd,EAAoBH,OAApB,EAA6BqkD,EAA7B,EAAiC;EAC9C,SAAOX,QAAQ,CAACF,GAAD,EAAMrjD,IAAN,EAAYH,OAAZ,CAAf;EACD,CAFD;;EAGAyiD,GAAG,CAAC8B,MAAJ,GAAa,UAAStiD,EAAT,EAAa;EACxBA,EAAAA,EAAE,CAACkiD,MAAD,EAASrgD,WAAT,EAAoB,IAApB,CAAF;EACA,SAAO,IAAP;EACD,CAHD;;EAIA2+C,GAAG,CAAC+B,OAAJ,GAAcA,QAAd;EAEA,OAAc,GAAG/B,GAAjB;;;;;;;;"} \ No newline at end of file diff --git a/builds/wtf_wikipedia-client.min.js b/builds/wtf_wikipedia-client.min.js index 1b602479..78273183 100644 --- a/builds/wtf_wikipedia-client.min.js +++ b/builds/wtf_wikipedia-client.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).wtf=t()}(this,(function(){"use strict";var e=function(e){var t=new URL(e),i=t.pathname.replace(/^\/(wiki\/)?/,"");return i=decodeURIComponent(i),{domain:t.host,title:i}};function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){a=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);iObject.keys(t.data).length?-1:1})),"number"==typeof e?t[e]:t},text:function(e){return e=p(e,O),!0===this.isRedirect()?"":this.sections().map((function(t){return t.text(e)})).join("\n\n")},json:function(e){return e=p(e,O),d(this,e)},debug:function(){return console.log("\n"),this.sections().forEach((function(e){for(var t=" - ",i=0;i500)&&U.test(e)},K=function(e){var t=e.match(U);return t&&t[2]?(M(t[2])||[])[0]:{}},B=["table","code","score","data","categorytree","charinsert","hiero","imagemap","inputbox","nowiki","poem","references","source","syntaxhighlight","timeline"],W="< ?(".concat(B.join("|"),") ?[^>]{0,200}?>"),Y="< ?/ ?(".concat(B.join("|"),") ?>"),Z=new RegExp("".concat(W,"[").concat("\\s\\S","]+?").concat(Y),"ig"),G=function(e){return(e=(e=(e=(e=(e=(e=(e=e.replace(Z," ")).replace(/ ?< ?(span|div|table|data) [a-zA-Z0-9=%\.#:;'" ]{2,100}\/? ?> ?/g," ")).replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g," ")).replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g," ")).replace(/ ?< ?br ?\/> ?/g,"\n")).trim()};var H=function(e){var t=e.wiki;t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(//g,"")).replace(/__(NOTOC|NOEDITSECTION|FORCETOC|TOC)__/gi,"")).replace(/~~{1,3}/g,"")).replace(/\r/g,"")).replace(/\u3002/g,". ")).replace(/----/g,"")).replace(/\{\{\}\}/g," – ")).replace(/\{\{\\\}\}/g," / ")).replace(/ /g," "),t=(t=(t=G(t)).replace(/\([,;: ]+?\)/g,"")).replace(/{{(baseball|basketball) (primary|secondary) (style|color).*?\}\}/i,""),e.wiki=t},V=/[\\\.$]/,J=function(e){return"string"!=typeof e&&(e=""),e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/^\$/,"\\u0024")).replace(/\./g,"\\u002e")},Q=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.keys(e),i=0;i0&&(i.paragraphs=n)}if(!0===t.images){var a=e.images().map((function(e){return e.json(t)}));a.length>0&&(i.images=a)}if(!0===t.tables){var r=e.tables().map((function(e){return e.json(t)}));r.length>0&&(i.tables=r)}if(!0===t.templates){var o=e.templates();o.length>0&&(i.templates=o,!0===t.encode&&i.templates.forEach((function(e){return Q(e)})))}if(!0===t.infoboxes){var s=e.infoboxes().map((function(e){return e.json(t)}));s.length>0&&(i.infoboxes=s)}if(!0===t.lists){var c=e.lists().map((function(e){return e.json(t)}));c.length>0&&(i.lists=c)}if(!0===t.references||!0===t.citations){var u=e.references().map((function(e){return e.json(t)}));u.length>0&&(i.references=u)}return!0===t.sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},te={tables:!0,references:!0,paragraphs:!0,templates:!0,infoboxes:!0},ie=function(e){this.depth=e.depth,this.doc=null,this._title=e.title||"",Object.defineProperty(this,"doc",{enumerable:!1,value:null}),e.templates=e.templates||[],Object.defineProperty(this,"data",{enumerable:!1,value:e})},ne={title:function(){return this._title||""},index:function(){if(!this.doc)return null;var e=this.doc.sections().indexOf(this);return-1===e?null:e},indentation:function(){return this.depth},sentences:function(e){var t=this.paragraphs().reduce((function(e,t){return e.concat(t.sentences())}),[]);return"number"==typeof e?t[e]:t||[]},paragraphs:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t||[]},paragraph:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t[0]},links:function(e){var t=[];if(this.infoboxes().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.sentences().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.tables().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.lists().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},tables:function(e){var t=this.data.tables||[];return"number"==typeof e?t[e]:t},templates:function(e){var t=this.data.templates||[];return t=t.map((function(e){return e.json()})),"number"==typeof e?t[e]:"string"==typeof e?(e=e.toLowerCase(),t.filter((function(t){return t.template===e||t.name===e}))):t},infoboxes:function(e){var t=this.data.infoboxes||[];return"number"==typeof e?t[e]:t},coordinates:function(e){var t=[].concat(this.templates("coord"),this.templates("coor"));return"number"==typeof e?t[e]?t[e]:[]:t},lists:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.lists())})),"number"==typeof e?t[e]:t},interwiki:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},images:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.images())})),"number"==typeof e?t[e]:t||[]},references:function(e){var t=this.data.references||[];return"number"==typeof e?t[e]:t},remove:function(){if(!this.doc)return null;var e={};e[this.title()]=!0,this.children().forEach((function(t){return e[t.title()]=!0}));var t=this.doc.data.sections;return t=t.filter((function(t){return!0!==e.hasOwnProperty(t.title())})),this.doc.data.sections=t,this.doc},nextSibling:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index()+1;tthis.depth)for(var a=i+1;athis.depth;a+=1)n.push(t[a]);return"string"==typeof e?(e=e.toLowerCase(),n.find((function(t){return t.title().toLowerCase()===e}))):"number"==typeof e?n[e]:n},parent:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index();t>=0;t-=1)if(e[t]&&e[t].depth0&&(e.fmt=e.fmt||{},e.fmt.bold=t),i.length>0&&(e.fmt=e.fmt||{},e.fmt.italic=i),e},me=/^[0-9,.]+$/,de={text:!0,links:!0,formatting:!0,dates:!0,numbers:!0},fe=function(e,t){t=p(t,de);var i={},n=e.text();if(!0===t.text&&(i.text=n),!0===t.numbers&&me.test(n)){var a=Number(n.replace(/,/g,""));!1===isNaN(a)&&(i.number=a)}return t.links&&e.links().length>0&&(i.links=e.links().map((function(e){return e.json()}))),t.formatting&&e.data.fmt&&(i.formatting=e.data.fmt),t.dates&&void 0!==e.data.dates&&(i.dates=e.data.dates),i},ge=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},he={links:function(e){var t=this.data.links||[];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page===e}));return void 0===i?[]:[i]}return t},interwiki:function(e){var t=this.links().filter((function(e){return void 0!==e.wiki}));return"number"==typeof e?t[e]:t},bolds:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.bold&&(t=this.data.fmt.bold||[]),"number"==typeof e?t[e]:t},italics:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.italic&&(t=this.data.fmt.italic||[]),"number"==typeof e?t[e]:t},dates:function(e){var t=[];return this.data&&this.data.dates&&(t=this.data.dates||[]),"number"==typeof e?t[e]:t},text:function(e){return void 0!==e&&"string"==typeof e&&(this.data.text=e),this.data.text||""},json:function(e){return fe(this,e)}};Object.keys(he).forEach((function(e){ge.prototype[e]=he[e]})),ge.prototype.italic=ge.prototype.italics,ge.prototype.bold=ge.prototype.bolds,ge.prototype.plaintext=ge.prototype.text;var be=ge,ke=["ad","adj","adm","adv","al","alta","approx","apr","apt","arc","ariz","assn","asst","atty","aug","ave","ba","bc","bl","bldg","blvd","brig","bros","ca","cal","calif","capt","cca","cg","cl","cm","cmdr","co","col","colo","comdr","conn","corp","cpl","cres","ct","cyn","dak","dec","def","dept","det","dg","dist","dl","dm","dr","ea","eg","eng","esp","esq","est","etc","ex","exp","feb","fem","fig","fl oz","fl","fla","fm","fr","ft","fy","ga","gal","gb","gen","gov","hg","hon","hr","hrs","hwy","hz","ia","ida","ie","inc","inf","jan","jd","jr","jul","jun","kan","kans","kb","kg","km","kmph","lat","lb","lit","llb","lm","lng","lt","ltd","lx","ma","maj","mar","masc","mb","md","messrs","mg","mi","min","minn","misc","mister","ml","mlle","mm","mme","mph","mps","mr","mrs","ms","mstr","mt","neb","nebr","nee","no","nov","oct","okla","ont","op","ord","oz","pa","pd","penn","penna","phd","pl","pp","pref","prob","prof","pron","ps","psa","pseud","pt","pvt","qt","que","rb","rd","rep","reps","res","rev","sask","sec","sen","sens","sep","sept","sfc","sgt","sir","situ","sq ft","sq","sr","ss","st","supt","surg","tb","tbl","tbsp","tce","td","tel","temp","tenn","tex","tsp","univ","usafa","ut","va","vb","ver","vet","vitro","vivo","vol","vs","vt","wis","wisc","wr","wy","wyo","yb","µg"].concat("[^]][^]]"),we=new RegExp("(^| |')("+ke.join("|")+")[.!?] ?$","i"),ve=new RegExp("[ |.|'|[][A-Z].? *?$","i"),ye=new RegExp("\\.\\.\\.* +?$"),xe=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),$e=function(e){var t=[],i=[];if(!e||"string"!=typeof e||0===e.trim().length)return t;for(var n=function(e){var t=e.split(/(\n+)/);return function(e){var t=[];return e.forEach((function(e){t=t.concat(e)})),t}(t=(t=t.filter((function(e){return e.match(/\S/)}))).map((function(e){return e.split(/(\S.+?[.!?]"?)(?=\s+|$)/g)})))}(e),a=0;ai.length)return!1;var n=e.match(/"/g);return!(n&&n.length%2!=0&&e.length<900)}(o))?i[s+1]=i[s]+(i[s+1]||""):i[s]&&i[s].length>0&&(t.push(i[s]),i[s]="");return 0===t.length?[e]:t};function je(e){var t,i={text:e};return le(i),i.text=(t=(t=(t=i.text).replace(/\([,;: ]*\)/g,"")).replace(/\( *(; ?)+/g,"("),t=(t=re(t)).replace(/ +\.$/,".")),i=pe(i),new be(i)}var ze=je,Oe=function(e){var t=$e(e.wiki);(t=t.map(je))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},Ee=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},_e=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},Se=function(e){var t=e.split(/\n?\|/);t.forEach((function(e,i){null!==e&&(/\[\[[^\]]+$/.test(e)||/\{\{[^\}]+$/.test(e)||e.split("{{").length!==e.split("}}").length||e.split("[[").length!==e.split("]]").length)&&(t[i+1]=t[i]+"|"+t[i+1],t[i]=null)}));for(var i=(t=(t=t.filter((function(e){return null!==e}))).map((function(e){return(e||"").trim()}))).length-1;i>=0;i-=1){""===t[i]&&t.pop();break}return t},Ce=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,qe={template:!0,list:!0,prototype:!0},Ne=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===Ce.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return qe.hasOwnProperty(i)&&(i="_"+i),{key:i,val:n.trim()}}(n);if(a.key)return e[a.key]=a.val,e}t&&t[i]?e[t[i]]=n:(e.list=e.list||[],e.list.push(n));return i+=1,e}),{})},Ae={classname:!0,style:!0,align:!0,margin:!0,left:!0,break:!0,boxsize:!0,framestyle:!0,item_style:!0,collapsible:!0,list_style_type:!0,"list-style-type":!0,colwidth:!0},Le=function(e){return Object.keys(e).forEach((function(t){!0===Ae[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},De=ze,Ie=function(e,t){var i=De(e);return"json"===t?i.json():"raw"===t?i:i.text()},Te=function(e,t,i){t=t||[],e=Ee(e||"");var n=Se(e),a=n.shift(),r=Ne(n,t);return(r=Le(r))[1]&&t[0]&&!1===r.hasOwnProperty(t[0])&&(r[t[0]]=r[1],delete r[1]),Object.keys(r).forEach((function(e){r[e]="list"!==e?Ie(r[e],i):r[e].map((function(e){return Ie(e,i)}))})),a&&(r.template=_e(a)),r},Pe=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Re={title:function(){var e=this.data;return e.title||e.encyclopedia||e.author||""},links:function(e){var t=[];if("number"==typeof e)return t[e];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},text:function(){return""},json:function(){return this.data}};Object.keys(Re).forEach((function(e){Pe.prototype[e]=Re[e]}));var Me=Pe,Ue=ze,Fe=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Ke=function(e){var t=Te(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},Be=function(e){return{template:"citation",type:"inline",data:{},inline:Ue(e)||{}}},We=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Fe(n)){var a=Ke(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Be(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Fe(n)){var a=Ke(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Be(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Me(e)})),e.wiki=i},Ye=ze,Ze=/^(={1,5})(.{1,200}?)={1,5}$/,Ge=function(e,t){var i=t.match(Ze);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=Ye(n).text()).replace(/\{\{.+?\}\}/,"")};We(a),n=re(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},He=function(e){var t=[],i=[];e=function(e){return e=e.filter((function(e){return e&&!0!==/^\|\+/.test(e)})),!0===/^{\|/.test(e[0])&&e.shift(),!0===/^\|}/.test(e[e.length-1])&&e.pop(),!0===/^\|-/.test(e[0])&&e.shift(),e}(e);for(var n=0;n0&&(t.push(i),i=[]):(!(a=a.split(/(?:\|\||!!)/))[0]&&a[1]&&a.shift(),a.forEach((function(e){e=(e=e.replace(/^\| */,"")).trim(),i.push(e)})))}return i.length>0&&t.push(i),t},Ve=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Je=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Qe=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(Ve);if(null!==r){var o=parseInt(r[1],10);n=n.replace(Ve,""),t[a]=n;for(var s=i+1;s0}))}(e))},Xe=ze,et=/^!/,tt={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},it=function(e){return(e=Xe(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},nt=function(e){return e.length-e.filter((function(e){return e})).length>3},at=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=Xe(e).text(),e=(e=it(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];nt(e[0])&&e.shift();var i=e[0];return i&&i[0]&&i[1]&&(/^!/.test(i[0])||/^!/.test(i[1]))&&(t=i.map((function(e){return e=e.replace(/^\! */,""),e=it(e)})),e.shift()),(i=e[0])&&i[0]&&i[1]&&/^!/.test(i[0])&&/^!/.test(i[1])&&(i.forEach((function(e,i){e=e.replace(/^\! */,""),e=it(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Qe(i));if(!n||n.length<=1){n=at(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=at(i.slice(1))).length>0&&(i=i.slice(2))}return i.map((function(e){return function(e,t){var i={};return e.forEach((function(e,n){var a=t[n]||"col"+(n+1),r=Xe(e);r.text(it(r.text())),i[a]=r})),i}(e,n)}))},ot=function(e,t){return e.map((function(e){var i={};return Object.keys(e).forEach((function(t){i[t]=e[t].json()})),!0===t.encode&&(i=Q(i)),i}))},st={},ct=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},ut={links:function(e){var t=[];if(this.data.forEach((function(e){Object.keys(e).forEach((function(i){t=t.concat(e[i].links())}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},keyValue:function(e){var t=this.json(e);return t.forEach((function(e){Object.keys(e).forEach((function(t){e[t]=e[t].text}))})),t},json:function(e){return e=p(e,st),ot(this.data,e)},text:function(){return""}};ut.keyvalue=ut.keyValue,ut.keyval=ut.keyValue,Object.keys(ut).forEach((function(e){ct.prototype[e]=ut[e]}));var lt=ct,pt=/^\s*{\|/,mt=/^\s*\|}/,dt=function(e){for(var t=[],i=e.wiki,n=i.split("\n"),a=[],r=0;r0&&(a[a.length-1]+="\n"+n[r]);else{a[a.length-1]+="\n"+n[r];var o=a.pop();t.push(o)}else a.push(n[r]);var s=[];t.forEach((function(e){if(e){i=(i=i.replace(e+"\n","")).replace(e,"");var t=rt(e);t&&t.length>0&&s.push(new lt(t))}})),s.length>0&&(e.tables=s),e.wiki=i},ft={sentences:!0},gt=function(e,t){var i={};return!0===(t=p(t,ft)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},ht={sentences:!0,lists:!0,images:!0},bt=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},kt={sentences:function(e){return"number"==typeof e?this.data.sentences[e]:this.data.sentences||[]},references:function(e){return"number"==typeof e?this.data.references[e]:this.data.references},lists:function(e){return"number"==typeof e?this.data.lists[e]:this.data.lists},images:function(e){return"number"==typeof e?this.data.images[e]:this.data.images||[]},links:function(e){var t=[];if(this.sentences().forEach((function(i){t=t.concat(i.links(e))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},interwiki:function(e){var t=[];return this.sentences().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},text:function(e){e=p(e,ht);var t=this.sentences().map((function(t){return t.text(e)})).join(" ");return this.lists().forEach((function(e){t+="\n"+e.text()})),t},json:function(e){return e=p(e,ht),gt(this,e)}};kt.citations=kt.references,Object.keys(kt).forEach((function(e){bt.prototype[e]=kt[e]}));var wt=bt;var vt=function(e){for(var t=[],i=[],n=e.split(""),a=0,r=0;r0){for(var s=0,c=0,u=0;uc&&i.push("]"),t.push(i.join("")),i=[]}}return t},yt=ze,xt=new RegExp("("+C.images.join("|")+"):","i"),$t="(".concat(C.images.join("|"),")"),jt=new RegExp($t+":(.+?)[\\||\\]]","iu"),zt={thumb:!0,thumbnail:!0,border:!0,right:!0,left:!0,center:!0,top:!0,bottom:!0,none:!0,upright:!0,baseline:!0,middle:!0,sub:!0,super:!0},Ot=function(e){var t=e.wiki;vt(t).forEach((function(i){if(!0===xt.test(i)){e.images=e.images||[];var n=function(e){var t=e.match(jt);if(null===t||!t[2])return null;var i="".concat(t[1],":").concat(t[2]||""),n=(i=i.trim()).charAt(0).toUpperCase()+i.substring(1);if(n=n.replace(/ /g,"_")){var a={file:i};e=(e=e.replace(/^\[\[/,"")).replace(/\]\]$/,"");var r=Te(e),o=r.list||[];return r.alt&&(a.alt=r.alt),(o=o.filter((function(e){return!1===zt.hasOwnProperty(e)})))[o.length-1]&&(a.caption=yt(o[o.length-1])),new z(a,e)}return null}(i);n&&e.images.push(n),t=t.replace(i,"")}})),e.wiki=t},Et={},_t=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},St={lines:function(){return this.data},links:function(e){var t=[];if(this.lines().forEach((function(e){t=t.concat(e.links())})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},json:function(e){return e=p(e,Et),this.lines().map((function(t){return t.json(e)}))},text:function(){return function(e,t){return e.map((function(e){return" * "+e.text(t)})).join("\n")}(this.data)}};Object.keys(St).forEach((function(e){_t.prototype[e]=St[e]}));var Ct=_t,qt=ze,Nt=/^[#\*:;\|]+/,At=/^\*+[^:,\|]{4}/,Lt=/^ ?\#[^:,\|]{4}/,Dt=/[a-z_0-9\]\}]/i,It=function(e){return Nt.test(e)||At.test(e)||Lt.test(e)},Tt=function(e,t){for(var i=[],n=t;n0&&(i.push(r),a+=r.length-1)}else n.push(t[a]);e.lists=i.map((function(e){return new Ct(e)})),e.wiki=n.join("\n")}},Ut=function(e){var t=e.wiki,i=t.split(Rt);i=(i=i.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var t={wiki:e,lists:[],sentences:[],images:[]};return Mt.list(t),Mt.image(t),Pt(t),new wt(t)})),e.wiki=t,e.paragraphs=i},Ft=function(e,t){var i=Object.keys(e.data).reduce((function(t,i){return e.data[i]&&(t[i]=e.data[i].json()),t}),{});return!0===t.encode&&(i=Q(i)),i},Kt=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Bt=function(e){this._type=e.type,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Wt={type:function(){return this._type},links:function(e){var t=this,i=[];if(Object.keys(this.data).forEach((function(e){t.data[e].links().forEach((function(e){return i.push(e)}))})),"number"==typeof e)return i[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var n=i.find((function(t){return t.page()===e}));return void 0===n?[]:[n]}return i},image:function(){var e=this.get("image")||this.get("image2")||this.get("logo");if(!e)return null;var t=e.json();return t.file=t.text,t.text="",new z(t)},get:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=Kt(e);for(var t=Object.keys(this.data),i=0;i0?a++:a=e.indexOf("{",a+1)){var r=e[a];if("{"===r&&(t+=1),t>0){if("}"===r&&0===(t-=1)){n.push(r);var o=n.join("");n=[],/\{\{/.test(o)&&/\}\}/.test(o)&&i.push(o);continue}if(1===t&&"{"!==r&&"}"!==r){t=0,n=[];continue}n.push(r)}}return i},Gt=function(e){var t=null;return(t=/^\{\{[^\n]+\|/.test(e)?(e.match(/^\{\{(.+?)\|/)||[])[1]:-1!==e.indexOf("\n")?(e.match(/^\{\{(.+?)\n/)||[])[1]:(e.match(/^\{\{(.+?)\}\}$/)||[])[1])&&(t=t.replace(/:.*/,""),t=_e(t)),t||null},Ht=/\{\{/,Vt=function(e){return{body:e,name:Gt(e),children:[]}},Jt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Zt(i),t.children=t.children.map(Vt),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Ht.test(i)?e(t):null})),t},Qt=function(e){var t=Zt(e);return t=(t=t.map(Vt)).map(Jt)},Xt=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","navboxes","reflist","ref-list","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),ei=new RegExp("^(subst.)?("+C.infoboxes.join("|")+")[: \n]","i"),ti=/^infobox /i,ii=/ infobox$/i,ni=/$Year in [A-Z]/i,ai={"gnf protein box":!0,"automatic taxobox":!0,"chembox ":!0,editnotice:!0,geobox:!0,hybridbox:!0,ichnobox:!0,infraspeciesbox:!0,mycomorphbox:!0,oobox:!0,"paraphyletic group":!0,speciesbox:!0,subspeciesbox:!0,"starbox short":!0,taxobox:!0,nhlteamseason:!0,"asian games bid":!0,"canadian federal election results":!0,"dc thomson comic strip":!0,"daytona 24 races":!0,edencharacter:!0,"moldova national football team results":!0,samurai:!0,protein:!0,"sheet authority":!0,"order-of-approx":!0,"bacterial labs":!0,"medical resources":!0,ordination:!0,"hockey team coach":!0,"hockey team gm":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},ri=function(e){return!0===ai.hasOwnProperty(e)||(!!ei.test(e)||(!(!ti.test(e)&&!ii.test(e))||!!ni.test(e)))},oi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(ei),i=e.template;t&&t[0]&&(i=i.replace(t[0],""));var n={template:"infobox",type:i=i.trim(),data:e};return delete n.data.template,delete n.data.list,n},si=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],ci=si.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),ui=function(e){return e<10?"0"+e:String(e)},li=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===si.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(si[e.month]," ").concat(e.year);else{if(t="".concat(si[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(ui(e.hour),":").concat(ui(e.minute));void 0!==e.second&&(i=i+":"+ui(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},pi=function(e){for(var t={},i=["year","month","date","hour","minute","second"],n=0;n0&&(n.years=a,i-=31536e6*n.years);var r=Math.floor(i/2592e6,10);r>0&&(n.months=r,i-=2592e6*n.months);var o=Math.floor(i/864e5,10);return o>0&&(n.days=o),n},gi=pi,hi=li,bi=function(e){return{template:"date",data:e}},ki=function(e){var t=(e=Ee(e)).split("|"),i=gi(t.slice(1,4)),n=t.slice(4,7);if(0===n.length){var a=new Date;n=[a.getFullYear(),a.getMonth(),a.getDate()]}return{from:i,to:n=gi(n)}},wi={date:function(e,t){var i=Te(e,["year","month","date","hour","minute","second","timezone"]),n=gi([i.year,i.month,i.date||i.day]);return i.text=hi(n),i.timezone&&("Z"===i.timezone&&(i.timezone="UTC"),i.text+=" (".concat(i.timezone,")")),i.hour&&i.minute&&(i.second?i.text="".concat(i.hour,":").concat(i.minute,":").concat(i.second,", ")+i.text:i.text="".concat(i.hour,":").concat(i.minute,", ")+i.text),i.text&&t.push(bi(i)),i.text},natural_date:function(e,t){var i=Te(e,["text"]).text||"",n={};if(/^[0-9]{4}$/.test(i))n.year=parseInt(i,10);else{var a=i.replace(/[a-z]+\/[a-z]+/i,"");a=a.replace(/[0-9]+:[0-9]+(am|pm)?/i,"");var r=new Date(a);!1===isNaN(r.getTime())&&(n.year=r.getFullYear(),n.month=r.getMonth()+1,n.date=r.getDate())}return t.push(bi(n)),i.trim()},one_year:function(e,t){var i=Te(e,["year"]),n=Number(i.year);return t.push(bi({year:n})),String(n)},two_dates:function(e,t){var i=Te(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=gi([i.birth_year,i.birth_month,i.birth_date]);return t.push(bi(n)),hi(n)}var a=gi([i.death_year,i.death_month,i.death_date]);return t.push(bi(a)),hi(a)},age:function(e){var t=ki(e);return fi(t.from,t.to).years||0},"diff-y":function(e){var t=ki(e),i=fi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),n.join(", ")},"diff-ymd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-yd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-d":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return i.days+=365*(i.years||0),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")}},vi=function(e){var t=new Date(e);if(isNaN(t.getTime()))return"";var i=(new Date).getTime()-t.getTime(),n="ago";i<0&&(n="from now",i=Math.abs(i));var a=i/1e3/60/60/24;return a<365?parseInt(a,10)+" days "+n:parseInt(a/365,10)+" years "+n},yi=wi.date,xi=wi.natural_date,$i=["January","February","March","April","May","June","July","August","September","October","November","December"],ji=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],zi=Object.assign({},mi,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return ji[e.getDay()]},currentmonth:function(){var e=new Date;return $i[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return $i[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),$i[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),$i[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Te(e,["date","fmt"]).date;return vi(t)},"birth date and age":function(e,t){var i=Te(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?xi(e,t):(t.push(i),i=pi([i.year,i.month,i.day]),li(i))},"birth year and age":function(e,t){var i=Te(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return xi(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=pi([i.birth_year,i.birth_month]);var a=li(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Te(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?xi(e,t):(t.push(i),i=pi([i.death_year,i.death_month]),li(i))},"birth date and age2":function(e,t){var i=Te(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=pi([i.birth_year,i.birth_month,i.birth_day]),li(i)},"birth based on age as of date":function(e,t){var i=Te(e,["age","year","month","day"]);t.push(i);var n=parseInt(i.age,10),a=parseInt(i.year,10)-n;return a&&n?"".concat(a," (age ").concat(i.age,")"):"(age ".concat(i.age,")")},"death date and given age":function(e,t){var i=Te(e,["year","month","day","age"]);t.push(i),i=pi([i.year,i.month,i.day]);var n=li(i);return i.age&&(n+=" (age ".concat(i.age,")")),n},dts:function(e){e=(e=e.replace(/\|format=[ymd]+/i,"")).replace(/\|abbr=(on|off)/i,"");var t=Te(e,["year","month","date","bc"]);return t.date&&t.month&&t.year?!0===/[a-z]/.test(t.month)?[t.month,t.date,t.year].join(" "):[t.year,t.month,t.date].join("-"):t.month&&t.year?[t.year,t.month].join("-"):t.year?(t.year<0&&(t.year=Math.abs(t.year)+" BC"),t.year):""},start:yi,end:yi,birth:yi,death:yi,"start date":yi,"end date":yi,"birth date":yi,"death date":yi,"start date and age":yi,"end date and age":yi,"start-date":xi,"end-date":xi,"birth-date":xi,"death-date":xi,"birth-date and age":xi,"birth-date and given age":xi,"death-date and age":xi,"death-date and given age":xi,birthdeathage:wi.two_dates,dob:yi,age:wi.age,"age nts":wi.age,"age in years":wi["diff-y"],"age in years and months":wi["diff-ym"],"age in years, months and days":wi["diff-ymd"],"age in years and days":wi["diff-yd"],"age in days":wi["diff-d"]});zi.localday=zi.currentday,zi.localdayname=zi.currentdayname,zi.localmonth=zi.currentmonth,zi.localyear=zi.currentyear,zi.currentmonthname=zi.currentmonth,zi.currentmonthabbrev=zi.currentmonth,zi["death date and age"]=zi["birth date and age"],zi.bda=zi["birth date and age"],zi["birth date based on age at death"]=zi["birth based on age as of date"];var Oi=zi,Ei={tag:function(e){var t=Te(e,["tag","open"]);return t.open&&"pair"!==t.open?"":{span:!0,div:!0,p:!0}[t.tag]?t.content||"":"<".concat(t.tag," ").concat(t.attribs||"",">").concat(t.content||"","")},plural:function(e){e=e.replace(/plural:/,"plural|");var t=Te(e,["num","word"]),i=Number(t.num),n=t.word;return 1!==i&&(/.y$/.test(n)?n=n.replace(/y$/,"ies"):n+="s"),i+" "+n},"first word":function(e){var t=Te(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Te(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Te(e,["str","start","end"]),i=parseInt(t.start,10)-1,n=parseInt(t.end,10);return t.str.substr(i,n)},p1:0,p2:1,p3:2,braces:function(e){var t=Te(e,["text"]),i="";return t.list&&(i="|"+t.list.join("|")),"{{"+(t.text||"")+i+"}}"},nobold:0,noitalic:0,nocaps:0,syntaxhighlight:function(e,t){var i=Te(e);return t.push(i),i.code||""},samp:function(e,t){var i=Te(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Te(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Te(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Te(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Te(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Te(e,["degrees","minutes","seconds"]),i=(t.degrees||0)+"°";return t.minutes&&(i+=t.minutes+"′"),t.seconds&&(i+=t.seconds+"″"),i},val:function(e){var t=Te(e,["number","uncertainty"]),i=t.number;i&&Number(i)&&(i=Number(i).toLocaleString());var n=i||"";return t.p&&(n=t.p+n),t.s&&(n=t.s+n),(t.u||t.ul||t.upl)&&(n=n+" "+(t.u||t.ul||t.upl)),n}};Ei.rndfrac=Ei.rnd,Ei.rndnear=Ei.rnd,Ei["unité"]=Ei.val;["nowrap","nobr","big","cquote","pull quote","small","smaller","midsize","larger","big","kbd","bigger","large","mono","strongbad","stronggood","huge","xt","xt2","!xt","xtn","xtd","dc","dcr","mxt","!mxt","mxtn","mxtd","bxt","!bxt","bxtn","bxtd","delink","pre","var","mvar","pre2","code"].forEach((function(e){Ei[e]=function(e){return Te(e,["text"]).text||""}}));var _i=Ei,Si={plainlist:function(e){var t=(e=Ee(e)).split("|");return e=(t=t.slice(1)).join("|"),(t=(t=e.split(/\n ?\* ?/)).filter((function(e){return e}))).join("\n\n")},"collapsible list":function(e,t){var i=Te(e);t.push(i);var n="";if(i.title&&(n+="'''".concat(i.title,"'''")+"\n\n"),!i.list){i.list=[];for(var a=1;a<10;a+=1)i[a]&&(i.list.push(i[a]),delete i[a])}return i.list=i.list.filter((function(e){return e})),n+=i.list.join("\n\n")},"ordered list":function(e,t){var i=Te(e);return t.push(i),i.list=i.list||[],i.list.map((function(e,t){return"".concat(t+1,". ").concat(e)})).join("\n\n")},hlist:function(e){var t=Te(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Te(e).list||[]).join(", ")},catlist:function(e){return(Te(e).list||[]).join(", ")},"br separated entries":function(e){return(Te(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Te(e).list||[]).join(", ")},"anchored list":function(e){var t=Te(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Te(e).list||[];return(t=(t=t.filter((function(e){return e}))).map((function(e){return"• "+e}))).join("\n\n")},"columns-list":function(e,t){var i=((Te(e).list||[])[0]||"").split(/\n/);return i=(i=i.filter((function(e){return e}))).map((function(e){return e.replace(/\*/,"")})),t.push({template:"columns-list",list:i}),(i=i.map((function(e){return"• "+e}))).join("\n\n")}};Si.flatlist=Si.plainlist,Si.ublist=Si.plainlist,Si["unbulleted list"]=Si["collapsible list"],Si.ubl=Si["collapsible list"],Si["bare anchored list"]=Si["anchored list"],Si["plain list"]=Si.plainlist,Si.cmn=Si["columns-list"],Si.collist=Si["columns-list"],Si["col-list"]=Si["columns-list"],Si.columnslist=Si["columns-list"];var Ci=Si,qi={convert:function(e){var t=Te(e,["num","two","three","four"]);return"-"===t.two||"to"===t.two||"and"===t.two?t.four?"".concat(t.num," ").concat(t.two," ").concat(t.three," ").concat(t.four):"".concat(t.num," ").concat(t.two," ").concat(t.three):"".concat(t.num," ").concat(t.two)},term:function(e){var t=Te(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Te(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Te(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Te(e,["a","b","c"]);return t.c?"".concat(t.a," ").concat(t.b,"/").concat(t.c):t.b?"".concat(t.a,"/").concat(t.b):"1/".concat(t.b)},height:function(e,t){var i=Te(e);t.push(i);var n=[];return["m","cm","ft","in"].forEach((function(e){!0===i.hasOwnProperty(e)&&n.push(i[e]+e)})),n.join(" ")},"block indent":function(e){var t=Te(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Te(e,["text","author"]);if(t.push(i),i.text){var n='"'.concat(i.text,'"');return i.author&&(n+="\n\n",n+=" - ".concat(i.author)),n+"\n"}return""},lbs:function(e){var t=Te(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Te(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Te(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Te(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Te(e,["one","two","three"]),n=(i.one||"")+(i.two||"");return"?"===i.one&&(n=(i.two||"")+(i.three||"")),t.push({template:"sic",word:n}),"y"===i.nolink?n:"".concat(n," [sic]")},formatnum:function(e){e=e.replace(/:/,"|");var t=Te(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Te(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Te(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Te(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Te(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Te(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Te(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Te(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Te(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Te(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};qi["str left"]=qi.trunc,qi["str crop"]=qi.trunc,qi.tooltip=qi.abbr,qi.abbrv=qi.abbr,qi.define=qi.abbr,qi.cvt=qi.convert;var Ni=qi,Ai=Object.assign({},_i,Ci,Ni);var Li=function(e){var t=e.pop(),i=Number(e[0]||0),n=Number(e[1]||0),a=Number(e[2]||0);if("string"!=typeof t||isNaN(i))return null;var r=1;return/[SW]/i.test(t)&&(r=-1),r*(i+n/60+a/3600)},Di=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ii={s:!0,w:!0},Ti=function(e){var i=Te(e);i=function(e){return e.list=e.list||[],e.list=e.list.map((function(t){var i=Number(t);if(!isNaN(i))return i;var n=t.split(/:/);return n.length>1?(e.props=e.props||{},e.props[n[0]]=n.slice(1).join(":"),null):t})),e.list=e.list.filter((function(e){return null!==e})),e}(i);var n,a,r=(n=i.list,a=n.map((function(e){return t(e)})).join("|"),2===n.length&&"number|number"===a?{lat:n[0],lon:n[1]}:4===n.length&&"number|string|number|string"===a?(Ii[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Li(n.slice(0,3)),lon:Li(n.slice(3))}:8===n.length?{lat:Li(n.slice(0,4)),lon:Li(n.slice(4))}:{});return i.lat=Di(r.lat),i.lon=Di(r.lon),i.template="coord",delete i.list,i},Pi={coord:function(e,t){var i=Ti(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Pi.coor=Pi.coord,Pi["coor title dms"]=Pi.coord,Pi["coor title dec"]=Pi.coord,Pi["coor dms"]=Pi.coord,Pi["coor dm"]=Pi.coord,Pi["coor dec"]=Pi.coord;var Ri=Pi,Mi={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Te(e,["first","last","target","sort"]),i="".concat(t.first||""," ").concat(t.last||"");return i=i.trim(),t.nolink?t.target||i:(t.dab&&(i+=" (".concat(t.dab,")"),t.target&&(t.target+=" (".concat(t.dab,")"))),t.target?"[[".concat(t.target,"|").concat(i,"]]"):"[[".concat(i,"]]"))}};["lts","t","tfd links","tiw","tltt","tetl","tsetl","ti","tic","tiw","tlt","ttl","twlh","tl2","tlu","demo","hatnote","xpd","para","elc","xtag","mli","mlix","#invoke","url"].forEach((function(e){Mi[e]=function(e){var t=Te(e,["first","second"]);return t.second||t.first}})),Mi.m=Mi.mention,Mi["m-self"]=Mi.mention,Mi.l=Mi.link,Mi.ll=Mi.link,Mi["l-self"]=Mi.link;var Ui=Mi,Fi={wikt:"wiktionary",commons:"commons",c:"commons",commonscat:"commonscat",n:"wikinews",q:"wikiquote",s:"wikisource",a:"wikiauthor",b:"wikibooks",voy:"wikivoyage",v:"wikiversity",d:"wikidata",species:"wikispecies",m:"meta",mw:"mediawiki"},Ki={about:function(e,t){var i=Te(e);return t.push(i),""},main:function(e,t){var i=Te(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Te(e,["redirect"]),n=i.list||[],a=[],r=0;r0&&t.push(a)}return{template:"playoffbracket",rounds:t}}(e);return t.push(i),""}};["2teambracket","4team2elimbracket","8teambracket","16teambracket","32teambracket","cwsbracket","nhlbracket","nhlbracket-reseed","4teambracket-nhl","4teambracket-ncaa","4teambracket-mma","4teambracket-mlb","8teambracket-nhl","8teambracket-mlb","8teambracket-ncaa","8teambracket-afc","8teambracket-afl","8teambracket-tennis3","8teambracket-tennis5","16teambracket-nhl","16teambracket-nhl divisional","16teambracket-nhl-reseed","16teambracket-nba","16teambracket-swtc","16teambracket-afc","16teambracket-tennis3","16teambracket-tennis5"].forEach((function(e){Ji[e]=Ji["4teambracket"]}));var Qi=Ji,Xi={"£":"GB£","¥":"¥","৳":"৳","₩":"₩","€":"€","₱":"₱","₹":"₹","₽":"₽","cn¥":"CN¥","gb£":"GB£","india rs":"₹","indian rupee symbol":"₹","indian rupee":"₹","indian rupees":"₹","philippine peso":"₱","russian ruble":"₽","SK won":"₩","turkish lira":"TRY",a$:"A$",au$:"A$",aud:"A$",bdt:"BDT",brl:"BRL",ca$:"CA$",cad:"CA$",chf:"CHF",cny:"CN¥",czk:"czk",dkk:"dkk",dkk2:"dkk",euro:"€",gbp:"GB£",hk$:"HK$",hkd:"HK$",ils:"ILS",inr:"₹",jpy:"¥",myr:"MYR",nis:"ILS",nok:"NOK",nok2:"NOK",nz$:"NZ$",nzd:"NZ$",peso:"peso",pkr:"₨",r$:"BRL",rmb:"CN¥",rub:"₽",ruble:"₽",rupee:"₹",s$:"sgd",sek:"SEK",sek2:"SEK",sfr:"CHF",sgd:"sgd",shekel:"ILS",sheqel:"ILS",ttd:"TTD",us$:"US$",usd:"US$",yen:"¥",zar:"R"},en=function(e,t){var i=Te(e,["amount","code"]);t.push(i);var n=i.template||"";switch("currency"===n?(n=i.code)||(i.code=n="usd"):""!==n&&"monnaie"!==n&&"unité"!==n&&"nombre"!==n&&"nb"!==n||(n=i.code),n=(n||"").toLowerCase()){case"us":i.code=n="usd";break;case"uk":i.code=n="gbp"}var a="".concat(Xi[n]||"").concat(i.amount||"");return i.code&&!Xi[i.code.toLowerCase()]&&(a+=" "+i.code),a},tn={currency:en,monnaie:en,"unité":en,nombre:en,nb:en,iso4217:en,inrconvert:function(e,t){var i=Te(e,["rupee_value","currency_formatting"]);t.push(i);var n=i.currency_formatting;if(n){var a=1;switch(n){case"k":a=1e3;break;case"m":a=1e6;break;case"b":a=1e9;break;case"t":a=1e12;break;case"l":a=1e5;break;case"c":a=1e7;break;case"lc":a=1e12}i.rupee_value=i.rupee_value*a}return"inr ".concat(i.rupee_value||"")}};Object.keys(Xi).forEach((function(e){tn[e]=en}));var nn=tn,an={"election box begin":function(e,t){var i=Te(e);return t.push(i),""},"election box candidate":function(e,t){var i=Te(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Te(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Te(e);return t.push(i),""}};an["election box begin no change"]=an["election box begin"],an["election box begin no party"]=an["election box begin"],an["election box begin no party no change"]=an["election box begin"],an["election box inline begin"]=an["election box begin"],an["election box inline begin no change"]=an["election box begin"],an["election box candidate for alliance"]=an["election box candidate"],an["election box candidate minor party"]=an["election box candidate"],an["election box candidate no party link no change"]=an["election box candidate"],an["election box candidate with party link"]=an["election box candidate"],an["election box candidate with party link coalition 1918"]=an["election box candidate"],an["election box candidate with party link no change"]=an["election box candidate"],an["election box inline candidate"]=an["election box candidate"],an["election box inline candidate no change"]=an["election box candidate"],an["election box inline candidate with party link"]=an["election box candidate"],an["election box inline candidate with party link no change"]=an["election box candidate"],an["election box inline incumbent"]=an["election box candidate"];var rn=an,on=[["🇦🇩","and","andorra"],["🇦🇪","are","united arab emirates"],["🇦🇫","afg","afghanistan"],["🇦🇬","atg","antigua and barbuda"],["🇦🇮","aia","anguilla"],["🇦🇱","alb","albania"],["🇦🇲","arm","armenia"],["🇦🇴","ago","angola"],["🇦🇶","ata","antarctica"],["🇦🇷","arg","argentina"],["🇦🇸","asm","american samoa"],["🇦🇹","aut","austria"],["🇦🇺","aus","australia"],["🇦🇼","abw","aruba"],["🇦🇽","ala","åland islands"],["🇦🇿","aze","azerbaijan"],["🇧🇦","bih","bosnia and herzegovina"],["🇧🇧","brb","barbados"],["🇧🇩","bgd","bangladesh"],["🇧🇪","bel","belgium"],["🇧🇫","bfa","burkina faso"],["🇧🇬","bgr","bulgaria"],["🇧🇬","bul","bulgaria"],["🇧🇭","bhr","bahrain"],["🇧🇮","bdi","burundi"],["🇧🇯","ben","benin"],["🇧🇱","blm","saint barthélemy"],["🇧🇲","bmu","bermuda"],["🇧🇳","brn","brunei darussalam"],["🇧🇴","bol","bolivia"],["🇧🇶","bes","bonaire, sint eustatius and saba"],["🇧🇷","bra","brazil"],["🇧🇸","bhs","bahamas"],["🇧🇹","btn","bhutan"],["🇧🇻","bvt","bouvet island"],["🇧🇼","bwa","botswana"],["🇧🇾","blr","belarus"],["🇧🇿","blz","belize"],["🇨🇦","can","canada"],["🇨🇨","cck","cocos (keeling) islands"],["🇨🇩","cod","congo"],["🇨🇫","caf","central african republic"],["🇨🇬","cog","congo"],["🇨🇭","che","switzerland"],["🇨🇮","civ","côte d'ivoire"],["🇨🇰","cok","cook islands"],["🇨🇱","chl","chile"],["🇨🇲","cmr","cameroon"],["🇨🇳","chn","china"],["🇨🇴","col","colombia"],["🇨🇷","cri","costa rica"],["🇨🇺","cub","cuba"],["🇨🇻","cpv","cape verde"],["🇨🇼","cuw","curaçao"],["🇨🇽","cxr","christmas island"],["🇨🇾","cyp","cyprus"],["🇨🇿","cze","czech republic"],["🇩🇪","deu","germany"],["🇩🇪","ger","germany"],["🇩🇯","dji","djibouti"],["🇩🇰","dnk","denmark"],["🇩🇲","dma","dominica"],["🇩🇴","dom","dominican republic"],["🇩🇿","dza","algeria"],["🇪🇨","ecu","ecuador"],["🇪🇪","est","estonia"],["🇪🇬","egy","egypt"],["🇪🇭","esh","western sahara"],["🇪🇷","eri","eritrea"],["🇪🇸","esp","spain"],["🇪🇹","eth","ethiopia"],["🇫🇮","fin","finland"],["🇫🇯","fji","fiji"],["🇫🇰","flk","falkland islands (malvinas)"],["🇫🇲","fsm","micronesia"],["🇫🇴","fro","faroe islands"],["🇫🇷","fra","france"],["🇬🇦","gab","gabon"],["🇬🇧","gbr","united kingdom"],["🇬🇩","grd","grenada"],["🇬🇫","guf","french guiana"],["🇬🇬","ggy","guernsey"],["🇬🇭","gha","ghana"],["🇬🇮","gib","gibraltar"],["🇬🇱","grl","greenland"],["🇬🇲","gmb","gambia"],["🇬🇳","gin","guinea"],["🇬🇵","glp","guadeloupe"],["🇬🇶","gnq","equatorial guinea"],["🇬🇷","grc","greece"],["🇬🇸","sgs","south georgia"],["🇬🇹","gtm","guatemala"],["🇬🇺","gum","guam"],["🇬🇼","gnb","guinea-bissau"],["🇬🇾","guy","guyana"],["🇭🇰","hkg","hong kong"],["🇭🇲","hmd","heard island and mcdonald islands"],["🇭🇳","hnd","honduras"],["🇭🇷","hrv","croatia"],["🇭🇹","hti","haiti"],["🇭🇺","hun","hungary"],["🇮🇩","idn","indonesia"],["🇮🇪","irl","ireland"],["🇮🇱","isr","israel"],["🇮🇲","imn","isle of man"],["🇮🇳","ind","india"],["🇮🇴","iot","british indian ocean territory"],["🇮🇶","irq","iraq"],["🇮🇷","irn","iran"],["🇮🇸","isl","iceland"],["🇮🇹","ita","italy"],["🇯🇪","jey","jersey"],["🇯🇲","jam","jamaica"],["🇯🇴","jor","jordan"],["🇯🇵","jpn","japan"],["🇰🇪","ken","kenya"],["🇰🇬","kgz","kyrgyzstan"],["🇰🇭","khm","cambodia"],["🇰🇮","kir","kiribati"],["🇰🇲","com","comoros"],["🇰🇳","kna","saint kitts and nevis"],["🇰🇵","prk","north korea"],["🇰🇷","kor","south korea"],["🇰🇼","kwt","kuwait"],["🇰🇾","cym","cayman islands"],["🇰🇿","kaz","kazakhstan"],["🇱🇦","lao","lao people's democratic republic"],["🇱🇧","lbn","lebanon"],["🇱🇨","lca","saint lucia"],["🇱🇮","lie","liechtenstein"],["🇱🇰","lka","sri lanka"],["🇱🇷","lbr","liberia"],["🇱🇸","lso","lesotho"],["🇱🇹","ltu","lithuania"],["🇱🇺","lux","luxembourg"],["🇱🇻","lva","latvia"],["🇱🇾","lby","libya"],["🇲🇦","mar","morocco"],["🇲🇨","mco","monaco"],["🇲🇩","mda","moldova"],["🇲🇪","mne","montenegro"],["🇲🇫","maf","saint martin (french part)"],["🇲🇬","mdg","madagascar"],["🇲🇭","mhl","marshall islands"],["🇲🇰","mkd","macedonia"],["🇲🇱","mli","mali"],["🇲🇲","mmr","myanmar"],["🇲🇳","mng","mongolia"],["🇲🇴","mac","macao"],["🇲🇵","mnp","northern mariana islands"],["🇲🇶","mtq","martinique"],["🇲🇷","mrt","mauritania"],["🇲🇸","msr","montserrat"],["🇲🇹","mlt","malta"],["🇲🇺","mus","mauritius"],["🇲🇻","mdv","maldives"],["🇲🇼","mwi","malawi"],["🇲🇽","mex","mexico"],["🇲🇾","mys","malaysia"],["🇲🇿","moz","mozambique"],["🇳🇦","nam","namibia"],["🇳🇨","ncl","new caledonia"],["🇳🇪","ner","niger"],["🇳🇫","nfk","norfolk island"],["🇳🇬","nga","nigeria"],["🇳🇮","nic","nicaragua"],["🇳🇱","nld","netherlands"],["🇳🇴","nor","norway"],["🇳🇵","npl","nepal"],["🇳🇷","nru","nauru"],["🇳🇺","niu","niue"],["🇳🇿","nzl","new zealand"],["🇴🇲","omn","oman"],["🇵🇦","pan","panama"],["🇵🇪","per","peru"],["🇵🇫","pyf","french polynesia"],["🇵🇬","png","papua new guinea"],["🇵🇭","phl","philippines"],["🇵🇰","pak","pakistan"],["🇵🇱","pol","poland"],["🇵🇲","spm","saint pierre and miquelon"],["🇵🇳","pcn","pitcairn"],["🇵🇷","pri","puerto rico"],["🇵🇸","pse","palestinian territory"],["🇵🇹","prt","portugal"],["🇵🇼","plw","palau"],["🇵🇾","pry","paraguay"],["🇶🇦","qat","qatar"],["🇷🇪","reu","réunion"],["🇷🇴","rou","romania"],["🇷🇸","srb","serbia"],["🇷🇺","rus","russia"],["🇷🇼","rwa","rwanda"],["🇸🇦","sau","saudi arabia"],["🇸🇧","slb","solomon islands"],["🇸🇨","syc","seychelles"],["🇸🇩","sdn","sudan"],["🇸🇪","swe","sweden"],["🇸🇬","sgp","singapore"],["🇸🇭","shn","saint helena, ascension and tristan da cunha"],["🇸🇮","svn","slovenia"],["🇸🇯","sjm","svalbard and jan mayen"],["🇸🇰","svk","slovakia"],["🇸🇱","sle","sierra leone"],["🇸🇲","smr","san marino"],["🇸🇳","sen","senegal"],["🇸🇴","som","somalia"],["🇸🇷","sur","suriname"],["🇸🇸","ssd","south sudan"],["🇸🇹","stp","sao tome and principe"],["🇸🇻","slv","el salvador"],["🇸🇽","sxm","sint maarten (dutch part)"],["🇸🇾","syr","syrian arab republic"],["🇸🇿","swz","swaziland"],["🇹🇨","tca","turks and caicos islands"],["🇹🇩","tcd","chad"],["🇹🇫","atf","french southern territories"],["🇹🇬","tgo","togo"],["🇹🇭","tha","thailand"],["🇹🇯","tjk","tajikistan"],["🇹🇰","tkl","tokelau"],["🇹🇱","tls","timor-leste"],["🇹🇲","tkm","turkmenistan"],["🇹🇳","tun","tunisia"],["🇹🇴","ton","tonga"],["🇹🇷","tur","turkey"],["🇹🇹","tto","trinidad and tobago"],["🇹🇻","tuv","tuvalu"],["🇹🇼","twn","taiwan"],["🇹🇿","tza","tanzania"],["🇺🇦","ukr","ukraine"],["🇺🇬","uga","uganda"],["🇺🇲","umi","united states minor outlying islands"],["🇺🇸","usa","united states"],["🇺🇸","us","united states"],["🇺🇾","ury","uruguay"],["🇺🇿","uzb","uzbekistan"],["🇻🇦","vat","vatican city"],["🇻🇨","vct","saint vincent and the grenadines"],["🇻🇪","ven","venezuela"],["🇻🇬","vgb","virgin islands, british"],["🇻🇮","vir","virgin islands, u.s."],["🇻🇳","vnm","viet nam"],["🇻🇺","vut","vanuatu"],["","win","west indies"],["🇼🇫","wlf","wallis and futuna"],["🇼🇸","wsm","samoa"],["🇾🇪","yem","yemen"],["🇾🇹","myt","mayotte"],["🇿🇦","zaf","south africa"],["🇿🇲","zmb","zambia"],["🇿🇼 ","zwe","zimbabwe"],["🇺🇳","un","united nations"],["🏴󠁧󠁢󠁥󠁮󠁧󠁿󠁧󠁢󠁥󠁮󠁧󠁿","eng","england"],["🏴󠁧󠁢󠁳󠁣󠁴󠁿","sct","scotland"],["🏴󠁧󠁢󠁷󠁬󠁳󠁿","wal","wales"],["🇪🇺","eu","european union"]],sn={flag:function(e){var t=Te(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],a=n[0]||"";return"".concat(a," [[").concat(n[2],"|").concat(i,"]]")},flagcountry:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," [[").concat(i[2],"]]")},flagcu:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," ").concat(i[2])},flagicon:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"[[".concat(i[2],"|").concat(i[0],"]]"):""},flagdeco:function(e){var t=Te(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(i[2]," national football team|").concat(i[2],"]]"):""},fbicon:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?" [[".concat(i[2]," national football team|").concat(i[0],"]]"):""},flagathlete:function(e){var t=Te(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(t.name||"","]] (").concat(i[1].toUpperCase(),")"):"[[".concat(t.name||"","]]")}};on.forEach((function(e){sn[e[1]]=function(){return e[0]}})),sn.cr=sn.flagcountry,sn["cr-rt"]=sn.flagcountry,sn.cricon=sn.flagicon;var cn=sn,un=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===q.hasOwnProperty(t[1])?q[t[1]].english_title:t[1]:null},ln={ipa:function(e,t){var i=Te(e,["transcription","lang","audio"]);return i.lang=un(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Te(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=un(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Te(e,["lang","text","text2"]);return i.text2&&(i.iso=i.text,i.text=i.text2,delete i.text2),t.push(i),i.text||""}};Object.keys(q).forEach((function(e){ln["ipa-"+e]=ln.ipa,ln["ipac-"+e]=ln.ipac}));var pn=ln,mn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Te(e,["english","kanji","romaji","extra"]);t.push(i);var n=i.english||i.romaji||"";return i.kanji&&(n+=" (".concat(i.kanji,")")),n}};Object.keys(q).forEach((function(e){mn["lang-"+e]=mn["lang-de"]})),mn.nihongo2=mn.nihongo,mn.nihongo3=mn.nihongo,mn["nihongo-s"]=mn.nihongo,mn["nihongo foot"]=mn.nihongo;var dn=mn,fn=function(e){if(!e.numerator&&!e.denominator)return null;var t=Number(e.numerator)/Number(e.denominator);t*=100;var i=Number(e.decimals);return isNaN(i)&&(i=1),t=t.toFixed(i),Number(t)},gn={math:function(e,t){var i=Te(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Te(e,["a","b","c"]),n={template:"sfrac"};return i.c?(n.integer=i.a,n.numerator=i.b,n.denominator=i.c):i.b?(n.numerator=i.a,n.denominator=i.b):(n.numerator=1,n.denominator=i.a),t.push(n),n.integer?"".concat(n.integer," ").concat(n.numerator,"⁄").concat(n.denominator):"".concat(n.numerator,"⁄").concat(n.denominator)},radic:function(e){var t=Te(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Te(e,["numerator","denominator","decimals"]),i=fn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Te(e,["done","total","digits"]),i=fn({numerator:t.done,denominator:t.total,decimals:t.digits});return null===i?"":"".concat(t.done," (").concat(i,"%) done")},"winning percentage":function(e,t){var i=Te(e,["wins","losses","ties"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=Number(i.ties)||0,o=n+a+r;"y"===i.ignore_ties&&(r=0),r&&(n+=r/2);var s=fn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Te(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=fn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};gn.sfrac=gn.frac,gn.sqrt=gn.radic,gn.pct=gn.percentage,gn.percent=gn.percentage,gn.winpct=gn["winning percentage"],gn.winperc=gn["winning percentage"];var hn=gn,bn=function(e,t,i){var n=Te(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},kn={persondata:bn,taxobox:bn,citation:bn,portal:bn,reflist:bn,"cite book":bn,"cite journal":bn,"cite web":bn,"commons cat":bn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Te(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Te(e,["spouse","from","to","end"]);t.push(i);var n="".concat(i.spouse||"");return i.from&&(i.to?n+=" (m. ".concat(i.from,"-").concat(i.to,")"):n+=" (m. ".concat(i.from,")")),n},"based on":function(e,t){var i=Te(e,["title","author"]);return t.push(i),"".concat(i.title," by ").concat(i.author||"")},"video game release":function(e,t){for(var i=["region","date","region2","date2","region3","date3","region4","date4"],n=Te(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Bn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Wn={text:function(){return""},json:function(){return this.data}};Object.keys(Wn).forEach((function(e){Bn.prototype[e]=Wn[e]}));var Yn=Bn,Zn=new RegExp("^(cite |citation)","i"),Gn={citation:!0,refn:!0,harvnb:!0},Hn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Vn=function(e){var t=e.wiki,i=Qt(t),n=[];i.forEach((function(e){return function e(i,a){i.parent=a,i.children&&i.children.length>0&&i.children.forEach((function(t){return e(t,i)})),i.out=Kn(i,n);!function e(t,i,n){t.parent&&(t.parent.body=t.parent.body.replace(i,n),e(t.parent,i,n))}(i,i.body,i.out),t=t.replace(i.body,i.out)}(e,null)})),e.infoboxes=e.infoboxes||[],e.references=e.references||[],e.templates=e.templates||[],e.templates=e.templates.concat(n),e.templates=e.templates.filter((function(t){return!0===function(e){return!0===Gn[e.template]||!0===Zn.test(e.template)}(t)?(e.references.push(new Me(t)),!1):!0!==Hn(t)||(e.infoboxes.push(new Yt(t)),!1)})),e.templates=e.templates.map((function(e){return new Yn(e)})),i.forEach((function(e){t=t.replace(e.body,e.out)})),e.wiki=t},Jn=ze,Qn=function(e){var t=e.wiki;t=t.replace(/]*?)>([\s\S]+?)<\/gallery>/g,(function(t,i,n){var a=n.split(/\n/g);return(a=(a=a.filter((function(e){return e&&""!==e.trim()}))).map((function(e){var t=e.split(/\|/),i={file:t[0].trim()},n=new z(i).json(),a=t.slice(1).join("|");return""!==a&&(n.caption=Jn(a)),n}))).length>0&&e.templates.push({template:"gallery",images:a,pos:e.title}),""})),e.wiki=t},Xn=function(e){var t=e.wiki;t=t.replace(/\{\{election box begin([\s\S]+?)\{\{election box end\}\}/gi,(function(t){var i={wiki:t,templates:[]};Vn(i);var n=i.templates.map((function(e){return e.json()})),a=n.find((function(e){return"election box"===e.template}))||{},r=n.filter((function(e){return"election box candidate"===e.template})),o=n.find((function(e){return"election box gain"===e.template||"election box hold"===e.template}))||{};return(r.length>0||o)&&e.templates.push({template:"election box",title:a.title,candidates:r,summary:o.data}),""})),e.wiki=t},ea={coach:["team","year","g","w","l","w-l%","finish","pg","pw","pl","pw-l%"],player:["year","team","gp","gs","mpg","fg%","3p%","ft%","rpg","apg","spg","bpg","ppg"],roster:["player","gp","gs","mpg","fg%","3fg%","ft%","rpg","apg","spg","bpg","ppg"]},ta=function(e){var t=e.wiki;t=t.replace(/\{\{nba (coach|player|roster) statistics start([\s\S]+?)\{\{s-end\}\}/gi,(function(t,i){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{s-end\}\}/,""),i=i.toLowerCase().trim();var n="! "+ea[i].join(" !! "),a=rt("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"NBA "+i+" statistics",data:a}),""})),e.wiki=t},ia=function(e){var t=e.wiki;t=t.replace(/\{\{mlb game log (section|month)[\s\S]+?\{\{mlb game log (section|month) end\}\}/gi,(function(t){var i=function(e){var t=["#","date","opponent","score","win","loss","save","attendance","record"];return!0===/\|stadium=y/i.test(e)&&t.splice(7,0,"stadium"),!0===/\|time=y/i.test(e)&&t.splice(7,0,"time"),!0===/\|box=y/i.test(e)&&t.push("box"),t}(t);t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{mlb game log (section|month) end\}\}/i,"");var n="! "+i.join(" !! "),a=rt("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mlb game log section",data:a}),""})),e.wiki=t},na=["res","record","opponent","method","event","date","round","time","location","notes"],aa=function(e){var t=e.wiki;t=t.replace(/\{\{mma record start[\s\S]+?\{\{end\}\}/gi,(function(t){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{end\}\}/i,"");var i="! "+na.join(" !! "),n=rt("{|\n"+i+"\n"+t+"\n|}");return n=n.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mma record start",data:n}),""})),e.wiki=t},ra=ze,oa=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=ra(n).text();return e.templates.push({template:"math",formula:a,raw:n}),a&&a.length<12?a:""}))).replace(/]*?)>([\s\S]+?)<\/chem>/g,(function(t,i,n){return e.templates.push({template:"chem",data:n}),""})),e.wiki=t},sa=function(e){Xn(e),Qn(e),oa(e),ia(e),aa(e),ta(e)},ca=new RegExp("^("+C.references.join("|")+"):?","i"),ua=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,la={heading:Ge,table:dt,paragraphs:Ut,templates:Vn,references:We,startEndTemplates:sa},pa=function(e,t){return la.startEndTemplates(e),la.references(e),la.templates(e),la.table(e),la.paragraphs(e,t),e=new ae(e)},ma=function(e){for(var t=[],i=e.wiki.split(ua),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},da=new RegExp("\\[\\[:?("+C.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),fa=new RegExp("^\\[\\[:?("+C.categories.join("|")+"):","ig"),ga={section:ma,categories:function(e){var t=e.wiki,i=t.match(da);i&&i.forEach((function(t){(t=(t=(t=t.replace(fa,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(da,""),e.wiki=t}},ha=function(e,t){t=t||{};var i=Object.assign(t,{title:t.title||null,pageID:t.pageID||t.id||null,namespace:t.namespace||t.ns||null,type:"page",wiki:e||"",categories:[],sections:[],coordinates:[]});return!0===F(e)?(i.type="redirect",i.redirectTo=K(e),ga.categories(i),new S(i)):(H(i),ga.categories(i),ga.section(i),new S(i))},ba=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return ha(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},ka=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},wa=function(e){var t=e.userAgent||e["User-Agent"]||e["Api-User-Agent"]||"User of the wtf_wikipedia library";return{method:"GET",headers:{"Content-Type":"application/json","Api-User-Agent":t,"User-Agent":t,Origin:"*"},redirect:"follow"}},va=/^https?:\/\//,ya={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},xa=function(t,i,n){var a=null;"function"==typeof i&&(a=i,i={}),"function"==typeof n&&(a=n,n={}),"string"==typeof i&&(n=n||{},i=Object.assign({},{lang:i},n)),i=i||{},(i=Object.assign({},ya,i)).title=t,va.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=wa(i);return ka(r,o).then((function(e){try{var t=u(e,i);return t=ba(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},$a={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},ja=function(e,t){var i;t=t||{},t=Object.assign({},$a,t),"string"==typeof e?t.lang=e:(i=e)&&"[object Object]"===Object.prototype.toString.call(i)&&(t=Object.assign(t,e));var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*";var a=wa(t);return ka(n,a).then((function(e){try{var t=u(e);return ba(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},za={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Oa=function(e,t,i){var n;i=i||{},i=Object.assign({},za,i),"string"==typeof t?i.lang=t:(n=t)&&"[object Object]"===Object.prototype.toString.call(n)&&(i=Object.assign(i,t));var a={pages:[],categories:[]};return new Promise((function(t,n){!function r(o){var s=function(e,t,i){e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!1===/^Category/i.test(e)&&(e="Category:"+e),e=e.replace(/ /g,"_")}(e),e=encodeURIComponent(e);var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");return t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="action=query&list=categorymembers&cmtitle=".concat(e,"&cmlimit=500&format=json&origin=*&redirects=true&cmtype=page|subcat"),i&&(n+="&cmcontinue="+i),n}(e,i,o),c=wa(i);return ka(s,c).then((function(e){a=function(e){var t=e.query.categorymembers||[],i={pages:[],categories:[]};return t.forEach((function(e){14===e.ns?(delete e.ns,i.categories.push(e)):(delete e.ns,i.pages.push(e))})),i}(e),e.continue&&e.continue.cmcontinue?r(e.continue.cmcontinue):t(a)})).catch((function(e){console.error(e),n(e)}))}(null)}))},Ea=function(e,t){return ha(e,t)},_a={Doc:S,Section:ae,Paragraph:wt,Sentence:be,Image:z,Infobox:Yt,Link:ue,List:Ct,Reference:Me,Table:lt,Template:Yn,wtf:Ea};return Ea.fetch=function(e,t,i,n){return xa(e,t,i)},Ea.random=function(e,t,i){return ja(e,t)},Ea.category=function(e,t,i,n){return Oa(e,t,i)},Ea.extend=function(e){return e(_a,Mn,this),this},Ea.version="8.1.0",Ea})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).wtf=t()}(this,(function(){"use strict";var e=function(e){var t=new URL(e),i=t.pathname.replace(/^\/(wiki\/)?/,"");return i=decodeURIComponent(i),{domain:t.host,title:i}};function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){a=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);iObject.keys(t.data).length?-1:1})),"number"==typeof e?t[e]:t},text:function(e){return e=p(e,O),!0===this.isRedirect()?"":this.sections().map((function(t){return t.text(e)})).join("\n\n")},json:function(e){return e=p(e,O),d(this,e)},debug:function(){return console.log("\n"),this.sections().forEach((function(e){for(var t=" - ",i=0;i500)&&U.test(e)},K=function(e){var t=e.match(U);return t&&t[2]?(M(t[2])||[])[0]:{}},B=["table","code","score","data","categorytree","charinsert","hiero","imagemap","inputbox","nowiki","poem","references","source","syntaxhighlight","timeline"],W="< ?(".concat(B.join("|"),") ?[^>]{0,200}?>"),Y="< ?/ ?(".concat(B.join("|"),") ?>"),Z=new RegExp("".concat(W,"[").concat("\\s\\S","]+?").concat(Y),"ig"),G=function(e){return(e=(e=(e=(e=(e=(e=(e=e.replace(Z," ")).replace(/ ?< ?(span|div|table|data) [a-zA-Z0-9=%\.#:;'" ]{2,100}\/? ?> ?/g," ")).replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g," ")).replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g," ")).replace(/ ?< ?br ?\/> ?/g,"\n")).trim()};var H=function(e){var t=e.wiki;t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(//g,"")).replace(/__(NOTOC|NOEDITSECTION|FORCETOC|TOC)__/gi,"")).replace(/~~{1,3}/g,"")).replace(/\r/g,"")).replace(/\u3002/g,". ")).replace(/----/g,"")).replace(/\{\{\}\}/g," – ")).replace(/\{\{\\\}\}/g," / ")).replace(/ /g," "),t=(t=(t=G(t)).replace(/\([,;: ]+?\)/g,"")).replace(/{{(baseball|basketball) (primary|secondary) (style|color).*?\}\}/i,""),e.wiki=t},V=/[\\\.$]/,J=function(e){return"string"!=typeof e&&(e=""),e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/^\$/,"\\u0024")).replace(/\./g,"\\u002e")},Q=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.keys(e),i=0;i0&&(i.paragraphs=n)}if(!0===t.images){var a=e.images().map((function(e){return e.json(t)}));a.length>0&&(i.images=a)}if(!0===t.tables){var r=e.tables().map((function(e){return e.json(t)}));r.length>0&&(i.tables=r)}if(!0===t.templates){var o=e.templates();o.length>0&&(i.templates=o,!0===t.encode&&i.templates.forEach((function(e){return Q(e)})))}if(!0===t.infoboxes){var s=e.infoboxes().map((function(e){return e.json(t)}));s.length>0&&(i.infoboxes=s)}if(!0===t.lists){var c=e.lists().map((function(e){return e.json(t)}));c.length>0&&(i.lists=c)}if(!0===t.references||!0===t.citations){var u=e.references().map((function(e){return e.json(t)}));u.length>0&&(i.references=u)}return!0===t.sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},te={tables:!0,references:!0,paragraphs:!0,templates:!0,infoboxes:!0},ie=function(e){this.depth=e.depth,this.doc=null,this._title=e.title||"",Object.defineProperty(this,"doc",{enumerable:!1,value:null}),e.templates=e.templates||[],Object.defineProperty(this,"data",{enumerable:!1,value:e})},ne={title:function(){return this._title||""},index:function(){if(!this.doc)return null;var e=this.doc.sections().indexOf(this);return-1===e?null:e},indentation:function(){return this.depth},sentences:function(e){var t=this.paragraphs().reduce((function(e,t){return e.concat(t.sentences())}),[]);return"number"==typeof e?t[e]:t||[]},paragraphs:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t||[]},paragraph:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t[0]},links:function(e){var t=[];if(this.infoboxes().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.sentences().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.tables().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.lists().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},tables:function(e){var t=this.data.tables||[];return"number"==typeof e?t[e]:t},templates:function(e){var t=this.data.templates||[];return t=t.map((function(e){return e.json()})),"number"==typeof e?t[e]:"string"==typeof e?(e=e.toLowerCase(),t.filter((function(t){return t.template===e||t.name===e}))):t},infoboxes:function(e){var t=this.data.infoboxes||[];return"number"==typeof e?t[e]:t},coordinates:function(e){var t=[].concat(this.templates("coord"),this.templates("coor"));return"number"==typeof e?t[e]?t[e]:[]:t},lists:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.lists())})),"number"==typeof e?t[e]:t},interwiki:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},images:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.images())})),"number"==typeof e?t[e]:t||[]},references:function(e){var t=this.data.references||[];return"number"==typeof e?t[e]:t},remove:function(){if(!this.doc)return null;var e={};e[this.title()]=!0,this.children().forEach((function(t){return e[t.title()]=!0}));var t=this.doc.data.sections;return t=t.filter((function(t){return!0!==e.hasOwnProperty(t.title())})),this.doc.data.sections=t,this.doc},nextSibling:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index()+1;tthis.depth)for(var a=i+1;athis.depth;a+=1)n.push(t[a]);return"string"==typeof e?(e=e.toLowerCase(),n.find((function(t){return t.title().toLowerCase()===e}))):"number"==typeof e?n[e]:n},parent:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index();t>=0;t-=1)if(e[t]&&e[t].depth0&&(e.fmt=e.fmt||{},e.fmt.bold=t),i.length>0&&(e.fmt=e.fmt||{},e.fmt.italic=i),e},me=/^[0-9,.]+$/,de={text:!0,links:!0,formatting:!0,dates:!0,numbers:!0},fe=function(e,t){t=p(t,de);var i={},n=e.text();if(!0===t.text&&(i.text=n),!0===t.numbers&&me.test(n)){var a=Number(n.replace(/,/g,""));!1===isNaN(a)&&(i.number=a)}return t.links&&e.links().length>0&&(i.links=e.links().map((function(e){return e.json()}))),t.formatting&&e.data.fmt&&(i.formatting=e.data.fmt),t.dates&&void 0!==e.data.dates&&(i.dates=e.data.dates),i},ge=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},he={links:function(e){var t=this.data.links||[];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page===e}));return void 0===i?[]:[i]}return t},interwiki:function(e){var t=this.links().filter((function(e){return void 0!==e.wiki}));return"number"==typeof e?t[e]:t},bolds:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.bold&&(t=this.data.fmt.bold||[]),"number"==typeof e?t[e]:t},italics:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.italic&&(t=this.data.fmt.italic||[]),"number"==typeof e?t[e]:t},dates:function(e){var t=[];return this.data&&this.data.dates&&(t=this.data.dates||[]),"number"==typeof e?t[e]:t},text:function(e){return void 0!==e&&"string"==typeof e&&(this.data.text=e),this.data.text||""},json:function(e){return fe(this,e)}};Object.keys(he).forEach((function(e){ge.prototype[e]=he[e]})),ge.prototype.italic=ge.prototype.italics,ge.prototype.bold=ge.prototype.bolds,ge.prototype.plaintext=ge.prototype.text;var be=ge,ke=["ad","adj","adm","adv","al","alta","approx","apr","apt","arc","ariz","assn","asst","atty","aug","ave","ba","bc","bl","bldg","blvd","brig","bros","ca","cal","calif","capt","cca","cg","cl","cm","cmdr","co","col","colo","comdr","conn","corp","cpl","cres","ct","cyn","dak","dec","def","dept","det","dg","dist","dl","dm","dr","ea","eg","eng","esp","esq","est","etc","ex","exp","feb","fem","fig","fl oz","fl","fla","fm","fr","ft","fy","ga","gal","gb","gen","gov","hg","hon","hr","hrs","hwy","hz","ia","ida","ie","inc","inf","jan","jd","jr","jul","jun","kan","kans","kb","kg","km","kmph","lat","lb","lit","llb","lm","lng","lt","ltd","lx","ma","maj","mar","masc","mb","md","messrs","mg","mi","min","minn","misc","mister","ml","mlle","mm","mme","mph","mps","mr","mrs","ms","mstr","mt","neb","nebr","nee","no","nov","oct","okla","ont","op","ord","oz","pa","pd","penn","penna","phd","pl","pp","pref","prob","prof","pron","ps","psa","pseud","pt","pvt","qt","que","rb","rd","rep","reps","res","rev","sask","sec","sen","sens","sep","sept","sfc","sgt","sir","situ","sq ft","sq","sr","ss","st","supt","surg","tb","tbl","tbsp","tce","td","tel","temp","tenn","tex","tsp","univ","usafa","ut","va","vb","ver","vet","vitro","vivo","vol","vs","vt","wis","wisc","wr","wy","wyo","yb","µg"].concat("[^]][^]]"),we=new RegExp("(^| |')("+ke.join("|")+")[.!?] ?$","i"),ve=new RegExp("[ |.|'|[][A-Z].? *?$","i"),ye=new RegExp("\\.\\.\\.* +?$"),xe=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),$e=function(e){var t=[],i=[];if(!e||"string"!=typeof e||0===e.trim().length)return t;for(var n=function(e){var t=e.split(/(\n+)/);return function(e){var t=[];return e.forEach((function(e){t=t.concat(e)})),t}(t=(t=t.filter((function(e){return e.match(/\S/)}))).map((function(e){return e.split(/(\S.+?[.!?]"?)(?=\s+|$)/g)})))}(e),a=0;ai.length)return!1;var n=e.match(/"/g);return!(n&&n.length%2!=0&&e.length<900)}(o))?i[s+1]=i[s]+(i[s+1]||""):i[s]&&i[s].length>0&&(t.push(i[s]),i[s]="");return 0===t.length?[e]:t};function je(e){var t,i={text:e};return le(i),i.text=(t=(t=(t=i.text).replace(/\([,;: ]*\)/g,"")).replace(/\( *(; ?)+/g,"("),t=(t=re(t)).replace(/ +\.$/,".")),i=pe(i),new be(i)}var ze=je,Oe=function(e){var t=$e(e.wiki);(t=t.map(je))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},Ee=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},_e=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},Se=function(e){var t=e.split(/\n?\|/);t.forEach((function(e,i){null!==e&&(/\[\[[^\]]+$/.test(e)||/\{\{[^\}]+$/.test(e)||e.split("{{").length!==e.split("}}").length||e.split("[[").length!==e.split("]]").length)&&(t[i+1]=t[i]+"|"+t[i+1],t[i]=null)}));for(var i=(t=(t=t.filter((function(e){return null!==e}))).map((function(e){return(e||"").trim()}))).length-1;i>=0;i-=1){""===t[i]&&t.pop();break}return t},Ce=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,qe={template:!0,list:!0,prototype:!0},Ne=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===Ce.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return qe.hasOwnProperty(i)&&(i="_"+i),{key:i,val:n.trim()}}(n);if(a.key)return e[a.key]=a.val,e}t&&t[i]?e[t[i]]=n:(e.list=e.list||[],e.list.push(n));return i+=1,e}),{})},Ae={classname:!0,style:!0,align:!0,margin:!0,left:!0,break:!0,boxsize:!0,framestyle:!0,item_style:!0,collapsible:!0,list_style_type:!0,"list-style-type":!0,colwidth:!0},Le=function(e){return Object.keys(e).forEach((function(t){!0===Ae[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},De=ze,Ie=function(e,t){var i=De(e);return"json"===t?i.json():"raw"===t?i:i.text()},Te=function(e,t,i){t=t||[],e=Ee(e||"");var n=Se(e),a=n.shift(),r=Ne(n,t);return(r=Le(r))[1]&&t[0]&&!1===r.hasOwnProperty(t[0])&&(r[t[0]]=r[1],delete r[1]),Object.keys(r).forEach((function(e){r[e]="list"!==e?Ie(r[e],i):r[e].map((function(e){return Ie(e,i)}))})),a&&(r.template=_e(a)),r},Pe=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Re={title:function(){var e=this.data;return e.title||e.encyclopedia||e.author||""},links:function(e){var t=[];if("number"==typeof e)return t[e];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},text:function(){return""},json:function(){return this.data}};Object.keys(Re).forEach((function(e){Pe.prototype[e]=Re[e]}));var Me=Pe,Ue=ze,Fe=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Ke=function(e){var t=Te(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},Be=function(e){return{template:"citation",type:"inline",data:{},inline:Ue(e)||{}}},We=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Fe(n)){var a=Ke(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Be(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Fe(n)){var a=Ke(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Be(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Me(e)})),e.wiki=i},Ye=ze,Ze=/^(={1,5})(.{1,200}?)={1,5}$/,Ge=function(e,t){var i=t.match(Ze);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=Ye(n).text()).replace(/\{\{.+?\}\}/,"")};We(a),n=re(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},He=function(e){var t=[],i=[];e=function(e){return e=e.filter((function(e){return e&&!0!==/^\|\+/.test(e)})),!0===/^{\|/.test(e[0])&&e.shift(),!0===/^\|}/.test(e[e.length-1])&&e.pop(),!0===/^\|-/.test(e[0])&&e.shift(),e}(e);for(var n=0;n0&&(t.push(i),i=[]):(!(a=a.split(/(?:\|\||!!)/))[0]&&a[1]&&a.shift(),a.forEach((function(e){e=(e=e.replace(/^\| */,"")).trim(),i.push(e)})))}return i.length>0&&t.push(i),t},Ve=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Je=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Qe=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(Ve);if(null!==r){var o=parseInt(r[1],10);n=n.replace(Ve,""),t[a]=n;for(var s=i+1;s0}))}(e))},Xe=ze,et=/^!/,tt={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},it=function(e){return(e=Xe(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},nt=function(e){return(e=e||[]).length-e.filter((function(e){return e})).length>3},at=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=Xe(e).text(),e=(e=it(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];nt(e[0])&&e.shift();var i=e[0];return i&&i[0]&&i[1]&&(/^!/.test(i[0])||/^!/.test(i[1]))&&(t=i.map((function(e){return e=e.replace(/^\! */,""),e=it(e)})),e.shift()),(i=e[0])&&i[0]&&i[1]&&/^!/.test(i[0])&&/^!/.test(i[1])&&(i.forEach((function(e,i){e=e.replace(/^\! */,""),e=it(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Qe(i));if(!n||n.length<=1){n=at(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=at(i.slice(1))).length>0&&(i=i.slice(2))}return i.map((function(e){return function(e,t){var i={};return e.forEach((function(e,n){var a=t[n]||"col"+(n+1),r=Xe(e);r.text(it(r.text())),i[a]=r})),i}(e,n)}))},ot=function(e,t){return e.map((function(e){var i={};return Object.keys(e).forEach((function(t){i[t]=e[t].json()})),!0===t.encode&&(i=Q(i)),i}))},st={},ct=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},ut={links:function(e){var t=[];if(this.data.forEach((function(e){Object.keys(e).forEach((function(i){t=t.concat(e[i].links())}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},keyValue:function(e){var t=this.json(e);return t.forEach((function(e){Object.keys(e).forEach((function(t){e[t]=e[t].text}))})),t},json:function(e){return e=p(e,st),ot(this.data,e)},text:function(){return""}};ut.keyvalue=ut.keyValue,ut.keyval=ut.keyValue,Object.keys(ut).forEach((function(e){ct.prototype[e]=ut[e]}));var lt=ct,pt=/^\s*{\|/,mt=/^\s*\|}/,dt=function(e){for(var t=[],i=e.wiki,n=i.split("\n"),a=[],r=0;r0&&(a[a.length-1]+="\n"+n[r]);else{a[a.length-1]+="\n"+n[r];var o=a.pop();t.push(o)}else a.push(n[r]);var s=[];t.forEach((function(e){if(e){i=(i=i.replace(e+"\n","")).replace(e,"");var t=rt(e);t&&t.length>0&&s.push(new lt(t))}})),s.length>0&&(e.tables=s),e.wiki=i},ft={sentences:!0},gt=function(e,t){var i={};return!0===(t=p(t,ft)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},ht={sentences:!0,lists:!0,images:!0},bt=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},kt={sentences:function(e){return"number"==typeof e?this.data.sentences[e]:this.data.sentences||[]},references:function(e){return"number"==typeof e?this.data.references[e]:this.data.references},lists:function(e){return"number"==typeof e?this.data.lists[e]:this.data.lists},images:function(e){return"number"==typeof e?this.data.images[e]:this.data.images||[]},links:function(e){var t=[];if(this.sentences().forEach((function(i){t=t.concat(i.links(e))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},interwiki:function(e){var t=[];return this.sentences().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},text:function(e){e=p(e,ht);var t=this.sentences().map((function(t){return t.text(e)})).join(" ");return this.lists().forEach((function(e){t+="\n"+e.text()})),t},json:function(e){return e=p(e,ht),gt(this,e)}};kt.citations=kt.references,Object.keys(kt).forEach((function(e){bt.prototype[e]=kt[e]}));var wt=bt;var vt=function(e){for(var t=[],i=[],n=e.split(""),a=0,r=0;r0){for(var s=0,c=0,u=0;uc&&i.push("]"),t.push(i.join("")),i=[]}}return t},yt=ze,xt=new RegExp("("+C.images.join("|")+"):","i"),$t="(".concat(C.images.join("|"),")"),jt=new RegExp($t+":(.+?)[\\||\\]]","iu"),zt={thumb:!0,thumbnail:!0,border:!0,right:!0,left:!0,center:!0,top:!0,bottom:!0,none:!0,upright:!0,baseline:!0,middle:!0,sub:!0,super:!0},Ot=function(e){var t=e.wiki;vt(t).forEach((function(i){if(!0===xt.test(i)){e.images=e.images||[];var n=function(e){var t=e.match(jt);if(null===t||!t[2])return null;var i="".concat(t[1],":").concat(t[2]||""),n=(i=i.trim()).charAt(0).toUpperCase()+i.substring(1);if(n=n.replace(/ /g,"_")){var a={file:i};e=(e=e.replace(/^\[\[/,"")).replace(/\]\]$/,"");var r=Te(e),o=r.list||[];return r.alt&&(a.alt=r.alt),(o=o.filter((function(e){return!1===zt.hasOwnProperty(e)})))[o.length-1]&&(a.caption=yt(o[o.length-1])),new z(a,e)}return null}(i);n&&e.images.push(n),t=t.replace(i,"")}})),e.wiki=t},Et={},_t=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},St={lines:function(){return this.data},links:function(e){var t=[];if(this.lines().forEach((function(e){t=t.concat(e.links())})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},json:function(e){return e=p(e,Et),this.lines().map((function(t){return t.json(e)}))},text:function(){return function(e,t){return e.map((function(e){return" * "+e.text(t)})).join("\n")}(this.data)}};Object.keys(St).forEach((function(e){_t.prototype[e]=St[e]}));var Ct=_t,qt=ze,Nt=/^[#\*:;\|]+/,At=/^\*+[^:,\|]{4}/,Lt=/^ ?\#[^:,\|]{4}/,Dt=/[a-z_0-9\]\}]/i,It=function(e){return Nt.test(e)||At.test(e)||Lt.test(e)},Tt=function(e,t){for(var i=[],n=t;n0&&(i.push(r),a+=r.length-1)}else n.push(t[a]);e.lists=i.map((function(e){return new Ct(e)})),e.wiki=n.join("\n")}},Ut=function(e){var t=e.wiki,i=t.split(Rt);i=(i=i.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var t={wiki:e,lists:[],sentences:[],images:[]};return Mt.list(t),Mt.image(t),Pt(t),new wt(t)})),e.wiki=t,e.paragraphs=i},Ft=function(e,t){var i=Object.keys(e.data).reduce((function(t,i){return e.data[i]&&(t[i]=e.data[i].json()),t}),{});return!0===t.encode&&(i=Q(i)),i},Kt=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Bt=function(e){this._type=e.type,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Wt={type:function(){return this._type},links:function(e){var t=this,i=[];if(Object.keys(this.data).forEach((function(e){t.data[e].links().forEach((function(e){return i.push(e)}))})),"number"==typeof e)return i[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var n=i.find((function(t){return t.page()===e}));return void 0===n?[]:[n]}return i},image:function(){var e=this.get("image")||this.get("image2")||this.get("logo");if(!e)return null;var t=e.json();return t.file=t.text,t.text="",new z(t)},get:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=Kt(e);for(var t=Object.keys(this.data),i=0;i0?a++:a=e.indexOf("{",a+1)){var r=e[a];if("{"===r&&(t+=1),t>0){if("}"===r&&0===(t-=1)){n.push(r);var o=n.join("");n=[],/\{\{/.test(o)&&/\}\}/.test(o)&&i.push(o);continue}if(1===t&&"{"!==r&&"}"!==r){t=0,n=[];continue}n.push(r)}}return i},Gt=function(e){var t=null;return(t=/^\{\{[^\n]+\|/.test(e)?(e.match(/^\{\{(.+?)\|/)||[])[1]:-1!==e.indexOf("\n")?(e.match(/^\{\{(.+?)\n/)||[])[1]:(e.match(/^\{\{(.+?)\}\}$/)||[])[1])&&(t=t.replace(/:.*/,""),t=_e(t)),t||null},Ht=/\{\{/,Vt=function(e){return{body:e,name:Gt(e),children:[]}},Jt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Zt(i),t.children=t.children.map(Vt),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Ht.test(i)?e(t):null})),t},Qt=function(e){var t=Zt(e);return t=(t=t.map(Vt)).map(Jt)},Xt=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","navboxes","reflist","ref-list","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),ei=new RegExp("^(subst.)?("+C.infoboxes.join("|")+")[: \n]","i"),ti=/^infobox /i,ii=/ infobox$/i,ni=/$Year in [A-Z]/i,ai={"gnf protein box":!0,"automatic taxobox":!0,"chembox ":!0,editnotice:!0,geobox:!0,hybridbox:!0,ichnobox:!0,infraspeciesbox:!0,mycomorphbox:!0,oobox:!0,"paraphyletic group":!0,speciesbox:!0,subspeciesbox:!0,"starbox short":!0,taxobox:!0,nhlteamseason:!0,"asian games bid":!0,"canadian federal election results":!0,"dc thomson comic strip":!0,"daytona 24 races":!0,edencharacter:!0,"moldova national football team results":!0,samurai:!0,protein:!0,"sheet authority":!0,"order-of-approx":!0,"bacterial labs":!0,"medical resources":!0,ordination:!0,"hockey team coach":!0,"hockey team gm":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},ri=function(e){return!0===ai.hasOwnProperty(e)||(!!ei.test(e)||(!(!ti.test(e)&&!ii.test(e))||!!ni.test(e)))},oi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(ei),i=e.template;t&&t[0]&&(i=i.replace(t[0],""));var n={template:"infobox",type:i=i.trim(),data:e};return delete n.data.template,delete n.data.list,n},si=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],ci=si.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),ui=function(e){return e<10?"0"+e:String(e)},li=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===si.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(si[e.month]," ").concat(e.year);else{if(t="".concat(si[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(ui(e.hour),":").concat(ui(e.minute));void 0!==e.second&&(i=i+":"+ui(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},pi=function(e){for(var t={},i=["year","month","date","hour","minute","second"],n=0;n0&&(n.years=a,i-=31536e6*n.years);var r=Math.floor(i/2592e6,10);r>0&&(n.months=r,i-=2592e6*n.months);var o=Math.floor(i/864e5,10);return o>0&&(n.days=o),n},gi=pi,hi=li,bi=function(e){return{template:"date",data:e}},ki=function(e){var t=(e=Ee(e)).split("|"),i=gi(t.slice(1,4)),n=t.slice(4,7);if(0===n.length){var a=new Date;n=[a.getFullYear(),a.getMonth(),a.getDate()]}return{from:i,to:n=gi(n)}},wi={date:function(e,t){var i=Te(e,["year","month","date","hour","minute","second","timezone"]),n=gi([i.year,i.month,i.date||i.day]);return i.text=hi(n),i.timezone&&("Z"===i.timezone&&(i.timezone="UTC"),i.text+=" (".concat(i.timezone,")")),i.hour&&i.minute&&(i.second?i.text="".concat(i.hour,":").concat(i.minute,":").concat(i.second,", ")+i.text:i.text="".concat(i.hour,":").concat(i.minute,", ")+i.text),i.text&&t.push(bi(i)),i.text},natural_date:function(e,t){var i=Te(e,["text"]).text||"",n={};if(/^[0-9]{4}$/.test(i))n.year=parseInt(i,10);else{var a=i.replace(/[a-z]+\/[a-z]+/i,"");a=a.replace(/[0-9]+:[0-9]+(am|pm)?/i,"");var r=new Date(a);!1===isNaN(r.getTime())&&(n.year=r.getFullYear(),n.month=r.getMonth()+1,n.date=r.getDate())}return t.push(bi(n)),i.trim()},one_year:function(e,t){var i=Te(e,["year"]),n=Number(i.year);return t.push(bi({year:n})),String(n)},two_dates:function(e,t){var i=Te(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=gi([i.birth_year,i.birth_month,i.birth_date]);return t.push(bi(n)),hi(n)}var a=gi([i.death_year,i.death_month,i.death_date]);return t.push(bi(a)),hi(a)},age:function(e){var t=ki(e);return fi(t.from,t.to).years||0},"diff-y":function(e){var t=ki(e),i=fi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),n.join(", ")},"diff-ymd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-yd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-d":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return i.days+=365*(i.years||0),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")}},vi=function(e){var t=new Date(e);if(isNaN(t.getTime()))return"";var i=(new Date).getTime()-t.getTime(),n="ago";i<0&&(n="from now",i=Math.abs(i));var a=i/1e3/60/60/24;return a<365?parseInt(a,10)+" days "+n:parseInt(a/365,10)+" years "+n},yi=wi.date,xi=wi.natural_date,$i=["January","February","March","April","May","June","July","August","September","October","November","December"],ji=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],zi=Object.assign({},mi,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return ji[e.getDay()]},currentmonth:function(){var e=new Date;return $i[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return $i[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),$i[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),$i[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Te(e,["date","fmt"]).date;return vi(t)},"birth date and age":function(e,t){var i=Te(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?xi(e,t):(t.push(i),i=pi([i.year,i.month,i.day]),li(i))},"birth year and age":function(e,t){var i=Te(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return xi(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=pi([i.birth_year,i.birth_month]);var a=li(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Te(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?xi(e,t):(t.push(i),i=pi([i.death_year,i.death_month]),li(i))},"birth date and age2":function(e,t){var i=Te(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=pi([i.birth_year,i.birth_month,i.birth_day]),li(i)},"birth based on age as of date":function(e,t){var i=Te(e,["age","year","month","day"]);t.push(i);var n=parseInt(i.age,10),a=parseInt(i.year,10)-n;return a&&n?"".concat(a," (age ").concat(i.age,")"):"(age ".concat(i.age,")")},"death date and given age":function(e,t){var i=Te(e,["year","month","day","age"]);t.push(i),i=pi([i.year,i.month,i.day]);var n=li(i);return i.age&&(n+=" (age ".concat(i.age,")")),n},dts:function(e){e=(e=e.replace(/\|format=[ymd]+/i,"")).replace(/\|abbr=(on|off)/i,"");var t=Te(e,["year","month","date","bc"]);return t.date&&t.month&&t.year?!0===/[a-z]/.test(t.month)?[t.month,t.date,t.year].join(" "):[t.year,t.month,t.date].join("-"):t.month&&t.year?[t.year,t.month].join("-"):t.year?(t.year<0&&(t.year=Math.abs(t.year)+" BC"),t.year):""},start:yi,end:yi,birth:yi,death:yi,"start date":yi,"end date":yi,"birth date":yi,"death date":yi,"start date and age":yi,"end date and age":yi,"start-date":xi,"end-date":xi,"birth-date":xi,"death-date":xi,"birth-date and age":xi,"birth-date and given age":xi,"death-date and age":xi,"death-date and given age":xi,birthdeathage:wi.two_dates,dob:yi,age:wi.age,"age nts":wi.age,"age in years":wi["diff-y"],"age in years and months":wi["diff-ym"],"age in years, months and days":wi["diff-ymd"],"age in years and days":wi["diff-yd"],"age in days":wi["diff-d"]});zi.localday=zi.currentday,zi.localdayname=zi.currentdayname,zi.localmonth=zi.currentmonth,zi.localyear=zi.currentyear,zi.currentmonthname=zi.currentmonth,zi.currentmonthabbrev=zi.currentmonth,zi["death date and age"]=zi["birth date and age"],zi.bda=zi["birth date and age"],zi["birth date based on age at death"]=zi["birth based on age as of date"];var Oi=zi,Ei={tag:function(e){var t=Te(e,["tag","open"]);return t.open&&"pair"!==t.open?"":{span:!0,div:!0,p:!0}[t.tag]?t.content||"":"<".concat(t.tag," ").concat(t.attribs||"",">").concat(t.content||"","")},plural:function(e){e=e.replace(/plural:/,"plural|");var t=Te(e,["num","word"]),i=Number(t.num),n=t.word;return 1!==i&&(/.y$/.test(n)?n=n.replace(/y$/,"ies"):n+="s"),i+" "+n},"first word":function(e){var t=Te(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Te(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Te(e,["str","start","end"]),i=parseInt(t.start,10)-1,n=parseInt(t.end,10);return t.str.substr(i,n)},p1:0,p2:1,p3:2,braces:function(e){var t=Te(e,["text"]),i="";return t.list&&(i="|"+t.list.join("|")),"{{"+(t.text||"")+i+"}}"},nobold:0,noitalic:0,nocaps:0,syntaxhighlight:function(e,t){var i=Te(e);return t.push(i),i.code||""},samp:function(e,t){var i=Te(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Te(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Te(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Te(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Te(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Te(e,["degrees","minutes","seconds"]),i=(t.degrees||0)+"°";return t.minutes&&(i+=t.minutes+"′"),t.seconds&&(i+=t.seconds+"″"),i},val:function(e){var t=Te(e,["number","uncertainty"]),i=t.number;i&&Number(i)&&(i=Number(i).toLocaleString());var n=i||"";return t.p&&(n=t.p+n),t.s&&(n=t.s+n),(t.u||t.ul||t.upl)&&(n=n+" "+(t.u||t.ul||t.upl)),n}};Ei.rndfrac=Ei.rnd,Ei.rndnear=Ei.rnd,Ei["unité"]=Ei.val;["nowrap","nobr","big","cquote","pull quote","small","smaller","midsize","larger","big","kbd","bigger","large","mono","strongbad","stronggood","huge","xt","xt2","!xt","xtn","xtd","dc","dcr","mxt","!mxt","mxtn","mxtd","bxt","!bxt","bxtn","bxtd","delink","pre","var","mvar","pre2","code"].forEach((function(e){Ei[e]=function(e){return Te(e,["text"]).text||""}}));var _i=Ei,Si={plainlist:function(e){var t=(e=Ee(e)).split("|");return e=(t=t.slice(1)).join("|"),(t=(t=e.split(/\n ?\* ?/)).filter((function(e){return e}))).join("\n\n")},"collapsible list":function(e,t){var i=Te(e);t.push(i);var n="";if(i.title&&(n+="'''".concat(i.title,"'''")+"\n\n"),!i.list){i.list=[];for(var a=1;a<10;a+=1)i[a]&&(i.list.push(i[a]),delete i[a])}return i.list=i.list.filter((function(e){return e})),n+=i.list.join("\n\n")},"ordered list":function(e,t){var i=Te(e);return t.push(i),i.list=i.list||[],i.list.map((function(e,t){return"".concat(t+1,". ").concat(e)})).join("\n\n")},hlist:function(e){var t=Te(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Te(e).list||[]).join(", ")},catlist:function(e){return(Te(e).list||[]).join(", ")},"br separated entries":function(e){return(Te(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Te(e).list||[]).join(", ")},"anchored list":function(e){var t=Te(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Te(e).list||[];return(t=(t=t.filter((function(e){return e}))).map((function(e){return"• "+e}))).join("\n\n")},"columns-list":function(e,t){var i=((Te(e).list||[])[0]||"").split(/\n/);return i=(i=i.filter((function(e){return e}))).map((function(e){return e.replace(/\*/,"")})),t.push({template:"columns-list",list:i}),(i=i.map((function(e){return"• "+e}))).join("\n\n")}};Si.flatlist=Si.plainlist,Si.ublist=Si.plainlist,Si["unbulleted list"]=Si["collapsible list"],Si.ubl=Si["collapsible list"],Si["bare anchored list"]=Si["anchored list"],Si["plain list"]=Si.plainlist,Si.cmn=Si["columns-list"],Si.collist=Si["columns-list"],Si["col-list"]=Si["columns-list"],Si.columnslist=Si["columns-list"];var Ci=Si,qi={convert:function(e){var t=Te(e,["num","two","three","four"]);return"-"===t.two||"to"===t.two||"and"===t.two?t.four?"".concat(t.num," ").concat(t.two," ").concat(t.three," ").concat(t.four):"".concat(t.num," ").concat(t.two," ").concat(t.three):"".concat(t.num," ").concat(t.two)},term:function(e){var t=Te(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Te(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Te(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Te(e,["a","b","c"]);return t.c?"".concat(t.a," ").concat(t.b,"/").concat(t.c):t.b?"".concat(t.a,"/").concat(t.b):"1/".concat(t.b)},height:function(e,t){var i=Te(e);t.push(i);var n=[];return["m","cm","ft","in"].forEach((function(e){!0===i.hasOwnProperty(e)&&n.push(i[e]+e)})),n.join(" ")},"block indent":function(e){var t=Te(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Te(e,["text","author"]);if(t.push(i),i.text){var n='"'.concat(i.text,'"');return i.author&&(n+="\n\n",n+=" - ".concat(i.author)),n+"\n"}return""},lbs:function(e){var t=Te(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Te(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Te(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Te(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Te(e,["one","two","three"]),n=(i.one||"")+(i.two||"");return"?"===i.one&&(n=(i.two||"")+(i.three||"")),t.push({template:"sic",word:n}),"y"===i.nolink?n:"".concat(n," [sic]")},formatnum:function(e){e=e.replace(/:/,"|");var t=Te(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Te(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Te(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Te(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Te(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Te(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Te(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Te(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Te(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Te(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};qi["str left"]=qi.trunc,qi["str crop"]=qi.trunc,qi.tooltip=qi.abbr,qi.abbrv=qi.abbr,qi.define=qi.abbr,qi.cvt=qi.convert;var Ni=qi,Ai=Object.assign({},_i,Ci,Ni);var Li=function(e){var t=e.pop(),i=Number(e[0]||0),n=Number(e[1]||0),a=Number(e[2]||0);if("string"!=typeof t||isNaN(i))return null;var r=1;return/[SW]/i.test(t)&&(r=-1),r*(i+n/60+a/3600)},Di=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ii={s:!0,w:!0},Ti=function(e){var i=Te(e);i=function(e){return e.list=e.list||[],e.list=e.list.map((function(t){var i=Number(t);if(!isNaN(i))return i;var n=t.split(/:/);return n.length>1?(e.props=e.props||{},e.props[n[0]]=n.slice(1).join(":"),null):t})),e.list=e.list.filter((function(e){return null!==e})),e}(i);var n,a,r=(n=i.list,a=n.map((function(e){return t(e)})).join("|"),2===n.length&&"number|number"===a?{lat:n[0],lon:n[1]}:4===n.length&&"number|string|number|string"===a?(Ii[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Li(n.slice(0,3)),lon:Li(n.slice(3))}:8===n.length?{lat:Li(n.slice(0,4)),lon:Li(n.slice(4))}:{});return i.lat=Di(r.lat),i.lon=Di(r.lon),i.template="coord",delete i.list,i},Pi={coord:function(e,t){var i=Ti(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Pi.coor=Pi.coord,Pi["coor title dms"]=Pi.coord,Pi["coor title dec"]=Pi.coord,Pi["coor dms"]=Pi.coord,Pi["coor dm"]=Pi.coord,Pi["coor dec"]=Pi.coord;var Ri=Pi,Mi={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Te(e,["first","last","target","sort"]),i="".concat(t.first||""," ").concat(t.last||"");return i=i.trim(),t.nolink?t.target||i:(t.dab&&(i+=" (".concat(t.dab,")"),t.target&&(t.target+=" (".concat(t.dab,")"))),t.target?"[[".concat(t.target,"|").concat(i,"]]"):"[[".concat(i,"]]"))}};["lts","t","tfd links","tiw","tltt","tetl","tsetl","ti","tic","tiw","tlt","ttl","twlh","tl2","tlu","demo","hatnote","xpd","para","elc","xtag","mli","mlix","#invoke","url"].forEach((function(e){Mi[e]=function(e){var t=Te(e,["first","second"]);return t.second||t.first}})),Mi.m=Mi.mention,Mi["m-self"]=Mi.mention,Mi.l=Mi.link,Mi.ll=Mi.link,Mi["l-self"]=Mi.link;var Ui=Mi,Fi={wikt:"wiktionary",commons:"commons",c:"commons",commonscat:"commonscat",n:"wikinews",q:"wikiquote",s:"wikisource",a:"wikiauthor",b:"wikibooks",voy:"wikivoyage",v:"wikiversity",d:"wikidata",species:"wikispecies",m:"meta",mw:"mediawiki"},Ki={about:function(e,t){var i=Te(e);return t.push(i),""},main:function(e,t){var i=Te(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Te(e,["redirect"]),n=i.list||[],a=[],r=0;r0&&t.push(a)}return{template:"playoffbracket",rounds:t}}(e);return t.push(i),""}};["2teambracket","4team2elimbracket","8teambracket","16teambracket","32teambracket","cwsbracket","nhlbracket","nhlbracket-reseed","4teambracket-nhl","4teambracket-ncaa","4teambracket-mma","4teambracket-mlb","8teambracket-nhl","8teambracket-mlb","8teambracket-ncaa","8teambracket-afc","8teambracket-afl","8teambracket-tennis3","8teambracket-tennis5","16teambracket-nhl","16teambracket-nhl divisional","16teambracket-nhl-reseed","16teambracket-nba","16teambracket-swtc","16teambracket-afc","16teambracket-tennis3","16teambracket-tennis5"].forEach((function(e){Ji[e]=Ji["4teambracket"]}));var Qi=Ji,Xi={"£":"GB£","¥":"¥","৳":"৳","₩":"₩","€":"€","₱":"₱","₹":"₹","₽":"₽","cn¥":"CN¥","gb£":"GB£","india rs":"₹","indian rupee symbol":"₹","indian rupee":"₹","indian rupees":"₹","philippine peso":"₱","russian ruble":"₽","SK won":"₩","turkish lira":"TRY",a$:"A$",au$:"A$",aud:"A$",bdt:"BDT",brl:"BRL",ca$:"CA$",cad:"CA$",chf:"CHF",cny:"CN¥",czk:"czk",dkk:"dkk",dkk2:"dkk",euro:"€",gbp:"GB£",hk$:"HK$",hkd:"HK$",ils:"ILS",inr:"₹",jpy:"¥",myr:"MYR",nis:"ILS",nok:"NOK",nok2:"NOK",nz$:"NZ$",nzd:"NZ$",peso:"peso",pkr:"₨",r$:"BRL",rmb:"CN¥",rub:"₽",ruble:"₽",rupee:"₹",s$:"sgd",sek:"SEK",sek2:"SEK",sfr:"CHF",sgd:"sgd",shekel:"ILS",sheqel:"ILS",ttd:"TTD",us$:"US$",usd:"US$",yen:"¥",zar:"R"},en=function(e,t){var i=Te(e,["amount","code"]);t.push(i);var n=i.template||"";switch("currency"===n?(n=i.code)||(i.code=n="usd"):""!==n&&"monnaie"!==n&&"unité"!==n&&"nombre"!==n&&"nb"!==n||(n=i.code),n=(n||"").toLowerCase()){case"us":i.code=n="usd";break;case"uk":i.code=n="gbp"}var a="".concat(Xi[n]||"").concat(i.amount||"");return i.code&&!Xi[i.code.toLowerCase()]&&(a+=" "+i.code),a},tn={currency:en,monnaie:en,"unité":en,nombre:en,nb:en,iso4217:en,inrconvert:function(e,t){var i=Te(e,["rupee_value","currency_formatting"]);t.push(i);var n=i.currency_formatting;if(n){var a=1;switch(n){case"k":a=1e3;break;case"m":a=1e6;break;case"b":a=1e9;break;case"t":a=1e12;break;case"l":a=1e5;break;case"c":a=1e7;break;case"lc":a=1e12}i.rupee_value=i.rupee_value*a}return"inr ".concat(i.rupee_value||"")}};Object.keys(Xi).forEach((function(e){tn[e]=en}));var nn=tn,an={"election box begin":function(e,t){var i=Te(e);return t.push(i),""},"election box candidate":function(e,t){var i=Te(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Te(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Te(e);return t.push(i),""}};an["election box begin no change"]=an["election box begin"],an["election box begin no party"]=an["election box begin"],an["election box begin no party no change"]=an["election box begin"],an["election box inline begin"]=an["election box begin"],an["election box inline begin no change"]=an["election box begin"],an["election box candidate for alliance"]=an["election box candidate"],an["election box candidate minor party"]=an["election box candidate"],an["election box candidate no party link no change"]=an["election box candidate"],an["election box candidate with party link"]=an["election box candidate"],an["election box candidate with party link coalition 1918"]=an["election box candidate"],an["election box candidate with party link no change"]=an["election box candidate"],an["election box inline candidate"]=an["election box candidate"],an["election box inline candidate no change"]=an["election box candidate"],an["election box inline candidate with party link"]=an["election box candidate"],an["election box inline candidate with party link no change"]=an["election box candidate"],an["election box inline incumbent"]=an["election box candidate"];var rn=an,on=[["🇦🇩","and","andorra"],["🇦🇪","are","united arab emirates"],["🇦🇫","afg","afghanistan"],["🇦🇬","atg","antigua and barbuda"],["🇦🇮","aia","anguilla"],["🇦🇱","alb","albania"],["🇦🇲","arm","armenia"],["🇦🇴","ago","angola"],["🇦🇶","ata","antarctica"],["🇦🇷","arg","argentina"],["🇦🇸","asm","american samoa"],["🇦🇹","aut","austria"],["🇦🇺","aus","australia"],["🇦🇼","abw","aruba"],["🇦🇽","ala","åland islands"],["🇦🇿","aze","azerbaijan"],["🇧🇦","bih","bosnia and herzegovina"],["🇧🇧","brb","barbados"],["🇧🇩","bgd","bangladesh"],["🇧🇪","bel","belgium"],["🇧🇫","bfa","burkina faso"],["🇧🇬","bgr","bulgaria"],["🇧🇬","bul","bulgaria"],["🇧🇭","bhr","bahrain"],["🇧🇮","bdi","burundi"],["🇧🇯","ben","benin"],["🇧🇱","blm","saint barthélemy"],["🇧🇲","bmu","bermuda"],["🇧🇳","brn","brunei darussalam"],["🇧🇴","bol","bolivia"],["🇧🇶","bes","bonaire, sint eustatius and saba"],["🇧🇷","bra","brazil"],["🇧🇸","bhs","bahamas"],["🇧🇹","btn","bhutan"],["🇧🇻","bvt","bouvet island"],["🇧🇼","bwa","botswana"],["🇧🇾","blr","belarus"],["🇧🇿","blz","belize"],["🇨🇦","can","canada"],["🇨🇨","cck","cocos (keeling) islands"],["🇨🇩","cod","congo"],["🇨🇫","caf","central african republic"],["🇨🇬","cog","congo"],["🇨🇭","che","switzerland"],["🇨🇮","civ","côte d'ivoire"],["🇨🇰","cok","cook islands"],["🇨🇱","chl","chile"],["🇨🇲","cmr","cameroon"],["🇨🇳","chn","china"],["🇨🇴","col","colombia"],["🇨🇷","cri","costa rica"],["🇨🇺","cub","cuba"],["🇨🇻","cpv","cape verde"],["🇨🇼","cuw","curaçao"],["🇨🇽","cxr","christmas island"],["🇨🇾","cyp","cyprus"],["🇨🇿","cze","czech republic"],["🇩🇪","deu","germany"],["🇩🇪","ger","germany"],["🇩🇯","dji","djibouti"],["🇩🇰","dnk","denmark"],["🇩🇲","dma","dominica"],["🇩🇴","dom","dominican republic"],["🇩🇿","dza","algeria"],["🇪🇨","ecu","ecuador"],["🇪🇪","est","estonia"],["🇪🇬","egy","egypt"],["🇪🇭","esh","western sahara"],["🇪🇷","eri","eritrea"],["🇪🇸","esp","spain"],["🇪🇹","eth","ethiopia"],["🇫🇮","fin","finland"],["🇫🇯","fji","fiji"],["🇫🇰","flk","falkland islands (malvinas)"],["🇫🇲","fsm","micronesia"],["🇫🇴","fro","faroe islands"],["🇫🇷","fra","france"],["🇬🇦","gab","gabon"],["🇬🇧","gbr","united kingdom"],["🇬🇩","grd","grenada"],["🇬🇫","guf","french guiana"],["🇬🇬","ggy","guernsey"],["🇬🇭","gha","ghana"],["🇬🇮","gib","gibraltar"],["🇬🇱","grl","greenland"],["🇬🇲","gmb","gambia"],["🇬🇳","gin","guinea"],["🇬🇵","glp","guadeloupe"],["🇬🇶","gnq","equatorial guinea"],["🇬🇷","grc","greece"],["🇬🇸","sgs","south georgia"],["🇬🇹","gtm","guatemala"],["🇬🇺","gum","guam"],["🇬🇼","gnb","guinea-bissau"],["🇬🇾","guy","guyana"],["🇭🇰","hkg","hong kong"],["🇭🇲","hmd","heard island and mcdonald islands"],["🇭🇳","hnd","honduras"],["🇭🇷","hrv","croatia"],["🇭🇹","hti","haiti"],["🇭🇺","hun","hungary"],["🇮🇩","idn","indonesia"],["🇮🇪","irl","ireland"],["🇮🇱","isr","israel"],["🇮🇲","imn","isle of man"],["🇮🇳","ind","india"],["🇮🇴","iot","british indian ocean territory"],["🇮🇶","irq","iraq"],["🇮🇷","irn","iran"],["🇮🇸","isl","iceland"],["🇮🇹","ita","italy"],["🇯🇪","jey","jersey"],["🇯🇲","jam","jamaica"],["🇯🇴","jor","jordan"],["🇯🇵","jpn","japan"],["🇰🇪","ken","kenya"],["🇰🇬","kgz","kyrgyzstan"],["🇰🇭","khm","cambodia"],["🇰🇮","kir","kiribati"],["🇰🇲","com","comoros"],["🇰🇳","kna","saint kitts and nevis"],["🇰🇵","prk","north korea"],["🇰🇷","kor","south korea"],["🇰🇼","kwt","kuwait"],["🇰🇾","cym","cayman islands"],["🇰🇿","kaz","kazakhstan"],["🇱🇦","lao","lao people's democratic republic"],["🇱🇧","lbn","lebanon"],["🇱🇨","lca","saint lucia"],["🇱🇮","lie","liechtenstein"],["🇱🇰","lka","sri lanka"],["🇱🇷","lbr","liberia"],["🇱🇸","lso","lesotho"],["🇱🇹","ltu","lithuania"],["🇱🇺","lux","luxembourg"],["🇱🇻","lva","latvia"],["🇱🇾","lby","libya"],["🇲🇦","mar","morocco"],["🇲🇨","mco","monaco"],["🇲🇩","mda","moldova"],["🇲🇪","mne","montenegro"],["🇲🇫","maf","saint martin (french part)"],["🇲🇬","mdg","madagascar"],["🇲🇭","mhl","marshall islands"],["🇲🇰","mkd","macedonia"],["🇲🇱","mli","mali"],["🇲🇲","mmr","myanmar"],["🇲🇳","mng","mongolia"],["🇲🇴","mac","macao"],["🇲🇵","mnp","northern mariana islands"],["🇲🇶","mtq","martinique"],["🇲🇷","mrt","mauritania"],["🇲🇸","msr","montserrat"],["🇲🇹","mlt","malta"],["🇲🇺","mus","mauritius"],["🇲🇻","mdv","maldives"],["🇲🇼","mwi","malawi"],["🇲🇽","mex","mexico"],["🇲🇾","mys","malaysia"],["🇲🇿","moz","mozambique"],["🇳🇦","nam","namibia"],["🇳🇨","ncl","new caledonia"],["🇳🇪","ner","niger"],["🇳🇫","nfk","norfolk island"],["🇳🇬","nga","nigeria"],["🇳🇮","nic","nicaragua"],["🇳🇱","nld","netherlands"],["🇳🇴","nor","norway"],["🇳🇵","npl","nepal"],["🇳🇷","nru","nauru"],["🇳🇺","niu","niue"],["🇳🇿","nzl","new zealand"],["🇴🇲","omn","oman"],["🇵🇦","pan","panama"],["🇵🇪","per","peru"],["🇵🇫","pyf","french polynesia"],["🇵🇬","png","papua new guinea"],["🇵🇭","phl","philippines"],["🇵🇰","pak","pakistan"],["🇵🇱","pol","poland"],["🇵🇲","spm","saint pierre and miquelon"],["🇵🇳","pcn","pitcairn"],["🇵🇷","pri","puerto rico"],["🇵🇸","pse","palestinian territory"],["🇵🇹","prt","portugal"],["🇵🇼","plw","palau"],["🇵🇾","pry","paraguay"],["🇶🇦","qat","qatar"],["🇷🇪","reu","réunion"],["🇷🇴","rou","romania"],["🇷🇸","srb","serbia"],["🇷🇺","rus","russia"],["🇷🇼","rwa","rwanda"],["🇸🇦","sau","saudi arabia"],["🇸🇧","slb","solomon islands"],["🇸🇨","syc","seychelles"],["🇸🇩","sdn","sudan"],["🇸🇪","swe","sweden"],["🇸🇬","sgp","singapore"],["🇸🇭","shn","saint helena, ascension and tristan da cunha"],["🇸🇮","svn","slovenia"],["🇸🇯","sjm","svalbard and jan mayen"],["🇸🇰","svk","slovakia"],["🇸🇱","sle","sierra leone"],["🇸🇲","smr","san marino"],["🇸🇳","sen","senegal"],["🇸🇴","som","somalia"],["🇸🇷","sur","suriname"],["🇸🇸","ssd","south sudan"],["🇸🇹","stp","sao tome and principe"],["🇸🇻","slv","el salvador"],["🇸🇽","sxm","sint maarten (dutch part)"],["🇸🇾","syr","syrian arab republic"],["🇸🇿","swz","swaziland"],["🇹🇨","tca","turks and caicos islands"],["🇹🇩","tcd","chad"],["🇹🇫","atf","french southern territories"],["🇹🇬","tgo","togo"],["🇹🇭","tha","thailand"],["🇹🇯","tjk","tajikistan"],["🇹🇰","tkl","tokelau"],["🇹🇱","tls","timor-leste"],["🇹🇲","tkm","turkmenistan"],["🇹🇳","tun","tunisia"],["🇹🇴","ton","tonga"],["🇹🇷","tur","turkey"],["🇹🇹","tto","trinidad and tobago"],["🇹🇻","tuv","tuvalu"],["🇹🇼","twn","taiwan"],["🇹🇿","tza","tanzania"],["🇺🇦","ukr","ukraine"],["🇺🇬","uga","uganda"],["🇺🇲","umi","united states minor outlying islands"],["🇺🇸","usa","united states"],["🇺🇸","us","united states"],["🇺🇾","ury","uruguay"],["🇺🇿","uzb","uzbekistan"],["🇻🇦","vat","vatican city"],["🇻🇨","vct","saint vincent and the grenadines"],["🇻🇪","ven","venezuela"],["🇻🇬","vgb","virgin islands, british"],["🇻🇮","vir","virgin islands, u.s."],["🇻🇳","vnm","viet nam"],["🇻🇺","vut","vanuatu"],["","win","west indies"],["🇼🇫","wlf","wallis and futuna"],["🇼🇸","wsm","samoa"],["🇾🇪","yem","yemen"],["🇾🇹","myt","mayotte"],["🇿🇦","zaf","south africa"],["🇿🇲","zmb","zambia"],["🇿🇼 ","zwe","zimbabwe"],["🇺🇳","un","united nations"],["🏴󠁧󠁢󠁥󠁮󠁧󠁿󠁧󠁢󠁥󠁮󠁧󠁿","eng","england"],["🏴󠁧󠁢󠁳󠁣󠁴󠁿","sct","scotland"],["🏴󠁧󠁢󠁷󠁬󠁳󠁿","wal","wales"],["🇪🇺","eu","european union"]],sn={flag:function(e){var t=Te(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],a=n[0]||"";return"".concat(a," [[").concat(n[2],"|").concat(i,"]]")},flagcountry:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," [[").concat(i[2],"]]")},flagcu:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," ").concat(i[2])},flagicon:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"[[".concat(i[2],"|").concat(i[0],"]]"):""},flagdeco:function(e){var t=Te(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(i[2]," national football team|").concat(i[2],"]]"):""},fbicon:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?" [[".concat(i[2]," national football team|").concat(i[0],"]]"):""},flagathlete:function(e){var t=Te(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(t.name||"","]] (").concat(i[1].toUpperCase(),")"):"[[".concat(t.name||"","]]")}};on.forEach((function(e){sn[e[1]]=function(){return e[0]}})),sn.cr=sn.flagcountry,sn["cr-rt"]=sn.flagcountry,sn.cricon=sn.flagicon;var cn=sn,un=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===q.hasOwnProperty(t[1])?q[t[1]].english_title:t[1]:null},ln={ipa:function(e,t){var i=Te(e,["transcription","lang","audio"]);return i.lang=un(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Te(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=un(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Te(e,["lang","text","text2"]);return i.text2&&(i.iso=i.text,i.text=i.text2,delete i.text2),t.push(i),i.text||""}};Object.keys(q).forEach((function(e){ln["ipa-"+e]=ln.ipa,ln["ipac-"+e]=ln.ipac}));var pn=ln,mn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Te(e,["english","kanji","romaji","extra"]);t.push(i);var n=i.english||i.romaji||"";return i.kanji&&(n+=" (".concat(i.kanji,")")),n}};Object.keys(q).forEach((function(e){mn["lang-"+e]=mn["lang-de"]})),mn.nihongo2=mn.nihongo,mn.nihongo3=mn.nihongo,mn["nihongo-s"]=mn.nihongo,mn["nihongo foot"]=mn.nihongo;var dn=mn,fn=function(e){if(!e.numerator&&!e.denominator)return null;var t=Number(e.numerator)/Number(e.denominator);t*=100;var i=Number(e.decimals);return isNaN(i)&&(i=1),t=t.toFixed(i),Number(t)},gn={math:function(e,t){var i=Te(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Te(e,["a","b","c"]),n={template:"sfrac"};return i.c?(n.integer=i.a,n.numerator=i.b,n.denominator=i.c):i.b?(n.numerator=i.a,n.denominator=i.b):(n.numerator=1,n.denominator=i.a),t.push(n),n.integer?"".concat(n.integer," ").concat(n.numerator,"⁄").concat(n.denominator):"".concat(n.numerator,"⁄").concat(n.denominator)},radic:function(e){var t=Te(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Te(e,["numerator","denominator","decimals"]),i=fn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Te(e,["done","total","digits"]),i=fn({numerator:t.done,denominator:t.total,decimals:t.digits});return null===i?"":"".concat(t.done," (").concat(i,"%) done")},"winning percentage":function(e,t){var i=Te(e,["wins","losses","ties"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=Number(i.ties)||0,o=n+a+r;"y"===i.ignore_ties&&(r=0),r&&(n+=r/2);var s=fn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Te(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=fn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};gn.sfrac=gn.frac,gn.sqrt=gn.radic,gn.pct=gn.percentage,gn.percent=gn.percentage,gn.winpct=gn["winning percentage"],gn.winperc=gn["winning percentage"];var hn=gn,bn=function(e,t,i){var n=Te(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},kn={persondata:bn,taxobox:bn,citation:bn,portal:bn,reflist:bn,"cite book":bn,"cite journal":bn,"cite web":bn,"commons cat":bn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Te(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Te(e,["spouse","from","to","end"]);t.push(i);var n="".concat(i.spouse||"");return i.from&&(i.to?n+=" (m. ".concat(i.from,"-").concat(i.to,")"):n+=" (m. ".concat(i.from,")")),n},"based on":function(e,t){var i=Te(e,["title","author"]);return t.push(i),"".concat(i.title," by ").concat(i.author||"")},"video game release":function(e,t){for(var i=["region","date","region2","date2","region3","date3","region4","date4"],n=Te(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Bn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Wn={text:function(){return""},json:function(){return this.data}};Object.keys(Wn).forEach((function(e){Bn.prototype[e]=Wn[e]}));var Yn=Bn,Zn=new RegExp("^(cite |citation)","i"),Gn={citation:!0,refn:!0,harvnb:!0},Hn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Vn=function(e){var t=e.wiki,i=Qt(t),n=[];i.forEach((function(e){return function e(i,a){i.parent=a,i.children&&i.children.length>0&&i.children.forEach((function(t){return e(t,i)})),i.out=Kn(i,n);!function e(t,i,n){t.parent&&(t.parent.body=t.parent.body.replace(i,n),e(t.parent,i,n))}(i,i.body,i.out),t=t.replace(i.body,i.out)}(e,null)})),e.infoboxes=e.infoboxes||[],e.references=e.references||[],e.templates=e.templates||[],e.templates=e.templates.concat(n),e.templates=e.templates.filter((function(t){return!0===function(e){return!0===Gn[e.template]||!0===Zn.test(e.template)}(t)?(e.references.push(new Me(t)),!1):!0!==Hn(t)||(e.infoboxes.push(new Yt(t)),!1)})),e.templates=e.templates.map((function(e){return new Yn(e)})),i.forEach((function(e){t=t.replace(e.body,e.out)})),e.wiki=t},Jn=ze,Qn=function(e){var t=e.wiki;t=t.replace(/]*?)>([\s\S]+?)<\/gallery>/g,(function(t,i,n){var a=n.split(/\n/g);return(a=(a=a.filter((function(e){return e&&""!==e.trim()}))).map((function(e){var t=e.split(/\|/),i={file:t[0].trim()},n=new z(i).json(),a=t.slice(1).join("|");return""!==a&&(n.caption=Jn(a)),n}))).length>0&&e.templates.push({template:"gallery",images:a,pos:e.title}),""})),e.wiki=t},Xn=function(e){var t=e.wiki;t=t.replace(/\{\{election box begin([\s\S]+?)\{\{election box end\}\}/gi,(function(t){var i={wiki:t,templates:[]};Vn(i);var n=i.templates.map((function(e){return e.json()})),a=n.find((function(e){return"election box"===e.template}))||{},r=n.filter((function(e){return"election box candidate"===e.template})),o=n.find((function(e){return"election box gain"===e.template||"election box hold"===e.template}))||{};return(r.length>0||o)&&e.templates.push({template:"election box",title:a.title,candidates:r,summary:o.data}),""})),e.wiki=t},ea={coach:["team","year","g","w","l","w-l%","finish","pg","pw","pl","pw-l%"],player:["year","team","gp","gs","mpg","fg%","3p%","ft%","rpg","apg","spg","bpg","ppg"],roster:["player","gp","gs","mpg","fg%","3fg%","ft%","rpg","apg","spg","bpg","ppg"]},ta=function(e){var t=e.wiki;t=t.replace(/\{\{nba (coach|player|roster) statistics start([\s\S]+?)\{\{s-end\}\}/gi,(function(t,i){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{s-end\}\}/,""),i=i.toLowerCase().trim();var n="! "+ea[i].join(" !! "),a=rt("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"NBA "+i+" statistics",data:a}),""})),e.wiki=t},ia=function(e){var t=e.wiki;t=t.replace(/\{\{mlb game log (section|month)[\s\S]+?\{\{mlb game log (section|month) end\}\}/gi,(function(t){var i=function(e){var t=["#","date","opponent","score","win","loss","save","attendance","record"];return!0===/\|stadium=y/i.test(e)&&t.splice(7,0,"stadium"),!0===/\|time=y/i.test(e)&&t.splice(7,0,"time"),!0===/\|box=y/i.test(e)&&t.push("box"),t}(t);t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{mlb game log (section|month) end\}\}/i,"");var n="! "+i.join(" !! "),a=rt("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mlb game log section",data:a}),""})),e.wiki=t},na=["res","record","opponent","method","event","date","round","time","location","notes"],aa=function(e){var t=e.wiki;t=t.replace(/\{\{mma record start[\s\S]+?\{\{end\}\}/gi,(function(t){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{end\}\}/i,"");var i="! "+na.join(" !! "),n=rt("{|\n"+i+"\n"+t+"\n|}");return n=n.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mma record start",data:n}),""})),e.wiki=t},ra=ze,oa=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=ra(n).text();return e.templates.push({template:"math",formula:a,raw:n}),a&&a.length<12?a:""}))).replace(/]*?)>([\s\S]+?)<\/chem>/g,(function(t,i,n){return e.templates.push({template:"chem",data:n}),""})),e.wiki=t},sa=function(e){Xn(e),Qn(e),oa(e),ia(e),aa(e),ta(e)},ca=new RegExp("^("+C.references.join("|")+"):?","i"),ua=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,la={heading:Ge,table:dt,paragraphs:Ut,templates:Vn,references:We,startEndTemplates:sa},pa=function(e,t){return la.startEndTemplates(e),la.references(e),la.templates(e),la.table(e),la.paragraphs(e,t),e=new ae(e)},ma=function(e){for(var t=[],i=e.wiki.split(ua),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},da=new RegExp("\\[\\[:?("+C.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),fa=new RegExp("^\\[\\[:?("+C.categories.join("|")+"):","ig"),ga={section:ma,categories:function(e){var t=e.wiki,i=t.match(da);i&&i.forEach((function(t){(t=(t=(t=t.replace(fa,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(da,""),e.wiki=t}},ha=function(e,t){t=t||{};var i=Object.assign(t,{title:t.title||null,pageID:t.pageID||t.id||null,namespace:t.namespace||t.ns||null,type:"page",wiki:e||"",categories:[],sections:[],coordinates:[]});return!0===F(e)?(i.type="redirect",i.redirectTo=K(e),ga.categories(i),new S(i)):(H(i),ga.categories(i),ga.section(i),new S(i))},ba=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return ha(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},ka=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},wa=function(e){var t=e.userAgent||e["User-Agent"]||e["Api-User-Agent"]||"User of the wtf_wikipedia library";return{method:"GET",headers:{"Content-Type":"application/json","Api-User-Agent":t,"User-Agent":t,Origin:"*"},redirect:"follow"}},va=/^https?:\/\//,ya={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},xa=function(t,i,n){var a=null;"function"==typeof i&&(a=i,i={}),"function"==typeof n&&(a=n,n={}),"string"==typeof i&&(n=n||{},i=Object.assign({},{lang:i},n)),i=i||{},(i=Object.assign({},ya,i)).title=t,va.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=wa(i);return ka(r,o).then((function(e){try{var t=u(e,i);return t=ba(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},$a={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},ja=function(e,t){var i;t=t||{},t=Object.assign({},$a,t),"string"==typeof e?t.lang=e:(i=e)&&"[object Object]"===Object.prototype.toString.call(i)&&(t=Object.assign(t,e));var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*";var a=wa(t);return ka(n,a).then((function(e){try{var t=u(e);return ba(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},za={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Oa=function(e,t,i){var n;i=i||{},i=Object.assign({},za,i),"string"==typeof t?i.lang=t:(n=t)&&"[object Object]"===Object.prototype.toString.call(n)&&(i=Object.assign(i,t));var a={pages:[],categories:[]};return new Promise((function(t,n){!function r(o){var s=function(e,t,i){e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!1===/^Category/i.test(e)&&(e="Category:"+e),e=e.replace(/ /g,"_")}(e),e=encodeURIComponent(e);var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");return t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="action=query&list=categorymembers&cmtitle=".concat(e,"&cmlimit=500&format=json&origin=*&redirects=true&cmtype=page|subcat"),i&&(n+="&cmcontinue="+i),n}(e,i,o),c=wa(i);return ka(s,c).then((function(e){a=function(e){var t=e.query.categorymembers||[],i={pages:[],categories:[]};return t.forEach((function(e){14===e.ns?(delete e.ns,i.categories.push(e)):(delete e.ns,i.pages.push(e))})),i}(e),e.continue&&e.continue.cmcontinue?r(e.continue.cmcontinue):t(a)})).catch((function(e){console.error(e),n(e)}))}(null)}))},Ea=function(e,t){return ha(e,t)},_a={Doc:S,Section:ae,Paragraph:wt,Sentence:be,Image:z,Infobox:Yt,Link:ue,List:Ct,Reference:Me,Table:lt,Template:Yn,wtf:Ea};return Ea.fetch=function(e,t,i,n){return xa(e,t,i)},Ea.random=function(e,t,i){return ja(e,t)},Ea.category=function(e,t,i,n){return Oa(e,t,i)},Ea.extend=function(e){return e(_a,Mn,this),this},Ea.version="8.1.1",Ea})); diff --git a/builds/wtf_wikipedia-client.mjs b/builds/wtf_wikipedia-client.mjs index ce944943..f2c71407 100644 --- a/builds/wtf_wikipedia-client.mjs +++ b/builds/wtf_wikipedia-client.mjs @@ -1 +1 @@ -var e=function(e){var t=new URL(e),i=t.pathname.replace(/^\/(wiki\/)?/,"");return i=decodeURIComponent(i),{domain:t.host,title:i}};function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){a=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);iObject.keys(t.data).length?-1:1})),"number"==typeof e?t[e]:t},text:function(e){return e=p(e,O),!0===this.isRedirect()?"":this.sections().map((function(t){return t.text(e)})).join("\n\n")},json:function(e){return e=p(e,O),d(this,e)},debug:function(){return console.log("\n"),this.sections().forEach((function(e){for(var t=" - ",i=0;i500)&&U.test(e)},K=function(e){var t=e.match(U);return t&&t[2]?(M(t[2])||[])[0]:{}},B=["table","code","score","data","categorytree","charinsert","hiero","imagemap","inputbox","nowiki","poem","references","source","syntaxhighlight","timeline"],W="< ?(".concat(B.join("|"),") ?[^>]{0,200}?>"),Y="< ?/ ?(".concat(B.join("|"),") ?>"),Z=new RegExp("".concat(W,"[").concat("\\s\\S","]+?").concat(Y),"ig"),G=function(e){return(e=(e=(e=(e=(e=(e=(e=e.replace(Z," ")).replace(/ ?< ?(span|div|table|data) [a-zA-Z0-9=%\.#:;'" ]{2,100}\/? ?> ?/g," ")).replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g," ")).replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g," ")).replace(/ ?< ?br ?\/> ?/g,"\n")).trim()};var H=function(e){var t=e.wiki;t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(//g,"")).replace(/__(NOTOC|NOEDITSECTION|FORCETOC|TOC)__/gi,"")).replace(/~~{1,3}/g,"")).replace(/\r/g,"")).replace(/\u3002/g,". ")).replace(/----/g,"")).replace(/\{\{\}\}/g," – ")).replace(/\{\{\\\}\}/g," / ")).replace(/ /g," "),t=(t=(t=G(t)).replace(/\([,;: ]+?\)/g,"")).replace(/{{(baseball|basketball) (primary|secondary) (style|color).*?\}\}/i,""),e.wiki=t},V=/[\\\.$]/,J=function(e){return"string"!=typeof e&&(e=""),e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/^\$/,"\\u0024")).replace(/\./g,"\\u002e")},Q=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.keys(e),i=0;i0&&(i.paragraphs=n)}if(!0===t.images){var a=e.images().map((function(e){return e.json(t)}));a.length>0&&(i.images=a)}if(!0===t.tables){var r=e.tables().map((function(e){return e.json(t)}));r.length>0&&(i.tables=r)}if(!0===t.templates){var o=e.templates();o.length>0&&(i.templates=o,!0===t.encode&&i.templates.forEach((function(e){return Q(e)})))}if(!0===t.infoboxes){var s=e.infoboxes().map((function(e){return e.json(t)}));s.length>0&&(i.infoboxes=s)}if(!0===t.lists){var c=e.lists().map((function(e){return e.json(t)}));c.length>0&&(i.lists=c)}if(!0===t.references||!0===t.citations){var u=e.references().map((function(e){return e.json(t)}));u.length>0&&(i.references=u)}return!0===t.sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},te={tables:!0,references:!0,paragraphs:!0,templates:!0,infoboxes:!0},ie=function(e){this.depth=e.depth,this.doc=null,this._title=e.title||"",Object.defineProperty(this,"doc",{enumerable:!1,value:null}),e.templates=e.templates||[],Object.defineProperty(this,"data",{enumerable:!1,value:e})},ne={title:function(){return this._title||""},index:function(){if(!this.doc)return null;var e=this.doc.sections().indexOf(this);return-1===e?null:e},indentation:function(){return this.depth},sentences:function(e){var t=this.paragraphs().reduce((function(e,t){return e.concat(t.sentences())}),[]);return"number"==typeof e?t[e]:t||[]},paragraphs:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t||[]},paragraph:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t[0]},links:function(e){var t=[];if(this.infoboxes().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.sentences().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.tables().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.lists().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},tables:function(e){var t=this.data.tables||[];return"number"==typeof e?t[e]:t},templates:function(e){var t=this.data.templates||[];return t=t.map((function(e){return e.json()})),"number"==typeof e?t[e]:"string"==typeof e?(e=e.toLowerCase(),t.filter((function(t){return t.template===e||t.name===e}))):t},infoboxes:function(e){var t=this.data.infoboxes||[];return"number"==typeof e?t[e]:t},coordinates:function(e){var t=[].concat(this.templates("coord"),this.templates("coor"));return"number"==typeof e?t[e]?t[e]:[]:t},lists:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.lists())})),"number"==typeof e?t[e]:t},interwiki:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},images:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.images())})),"number"==typeof e?t[e]:t||[]},references:function(e){var t=this.data.references||[];return"number"==typeof e?t[e]:t},remove:function(){if(!this.doc)return null;var e={};e[this.title()]=!0,this.children().forEach((function(t){return e[t.title()]=!0}));var t=this.doc.data.sections;return t=t.filter((function(t){return!0!==e.hasOwnProperty(t.title())})),this.doc.data.sections=t,this.doc},nextSibling:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index()+1;tthis.depth)for(var a=i+1;athis.depth;a+=1)n.push(t[a]);return"string"==typeof e?(e=e.toLowerCase(),n.find((function(t){return t.title().toLowerCase()===e}))):"number"==typeof e?n[e]:n},parent:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index();t>=0;t-=1)if(e[t]&&e[t].depth0&&(e.fmt=e.fmt||{},e.fmt.bold=t),i.length>0&&(e.fmt=e.fmt||{},e.fmt.italic=i),e},me=/^[0-9,.]+$/,de={text:!0,links:!0,formatting:!0,dates:!0,numbers:!0},fe=function(e,t){t=p(t,de);var i={},n=e.text();if(!0===t.text&&(i.text=n),!0===t.numbers&&me.test(n)){var a=Number(n.replace(/,/g,""));!1===isNaN(a)&&(i.number=a)}return t.links&&e.links().length>0&&(i.links=e.links().map((function(e){return e.json()}))),t.formatting&&e.data.fmt&&(i.formatting=e.data.fmt),t.dates&&void 0!==e.data.dates&&(i.dates=e.data.dates),i},ge=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},he={links:function(e){var t=this.data.links||[];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page===e}));return void 0===i?[]:[i]}return t},interwiki:function(e){var t=this.links().filter((function(e){return void 0!==e.wiki}));return"number"==typeof e?t[e]:t},bolds:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.bold&&(t=this.data.fmt.bold||[]),"number"==typeof e?t[e]:t},italics:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.italic&&(t=this.data.fmt.italic||[]),"number"==typeof e?t[e]:t},dates:function(e){var t=[];return this.data&&this.data.dates&&(t=this.data.dates||[]),"number"==typeof e?t[e]:t},text:function(e){return void 0!==e&&"string"==typeof e&&(this.data.text=e),this.data.text||""},json:function(e){return fe(this,e)}};Object.keys(he).forEach((function(e){ge.prototype[e]=he[e]})),ge.prototype.italic=ge.prototype.italics,ge.prototype.bold=ge.prototype.bolds,ge.prototype.plaintext=ge.prototype.text;var be=ge,ke=["ad","adj","adm","adv","al","alta","approx","apr","apt","arc","ariz","assn","asst","atty","aug","ave","ba","bc","bl","bldg","blvd","brig","bros","ca","cal","calif","capt","cca","cg","cl","cm","cmdr","co","col","colo","comdr","conn","corp","cpl","cres","ct","cyn","dak","dec","def","dept","det","dg","dist","dl","dm","dr","ea","eg","eng","esp","esq","est","etc","ex","exp","feb","fem","fig","fl oz","fl","fla","fm","fr","ft","fy","ga","gal","gb","gen","gov","hg","hon","hr","hrs","hwy","hz","ia","ida","ie","inc","inf","jan","jd","jr","jul","jun","kan","kans","kb","kg","km","kmph","lat","lb","lit","llb","lm","lng","lt","ltd","lx","ma","maj","mar","masc","mb","md","messrs","mg","mi","min","minn","misc","mister","ml","mlle","mm","mme","mph","mps","mr","mrs","ms","mstr","mt","neb","nebr","nee","no","nov","oct","okla","ont","op","ord","oz","pa","pd","penn","penna","phd","pl","pp","pref","prob","prof","pron","ps","psa","pseud","pt","pvt","qt","que","rb","rd","rep","reps","res","rev","sask","sec","sen","sens","sep","sept","sfc","sgt","sir","situ","sq ft","sq","sr","ss","st","supt","surg","tb","tbl","tbsp","tce","td","tel","temp","tenn","tex","tsp","univ","usafa","ut","va","vb","ver","vet","vitro","vivo","vol","vs","vt","wis","wisc","wr","wy","wyo","yb","µg"].concat("[^]][^]]"),we=new RegExp("(^| |')("+ke.join("|")+")[.!?] ?$","i"),ve=new RegExp("[ |.|'|[][A-Z].? *?$","i"),ye=new RegExp("\\.\\.\\.* +?$"),xe=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),$e=function(e){var t=[],i=[];if(!e||"string"!=typeof e||0===e.trim().length)return t;for(var n=function(e){var t=e.split(/(\n+)/);return function(e){var t=[];return e.forEach((function(e){t=t.concat(e)})),t}(t=(t=t.filter((function(e){return e.match(/\S/)}))).map((function(e){return e.split(/(\S.+?[.!?]"?)(?=\s+|$)/g)})))}(e),a=0;ai.length)return!1;var n=e.match(/"/g);return!(n&&n.length%2!=0&&e.length<900)}(o))?i[s+1]=i[s]+(i[s+1]||""):i[s]&&i[s].length>0&&(t.push(i[s]),i[s]="");return 0===t.length?[e]:t};function je(e){var t,i={text:e};return le(i),i.text=(t=(t=(t=i.text).replace(/\([,;: ]*\)/g,"")).replace(/\( *(; ?)+/g,"("),t=(t=re(t)).replace(/ +\.$/,".")),i=pe(i),new be(i)}var ze=je,Oe=function(e){var t=$e(e.wiki);(t=t.map(je))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},Ee=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},_e=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},Se=function(e){var t=e.split(/\n?\|/);t.forEach((function(e,i){null!==e&&(/\[\[[^\]]+$/.test(e)||/\{\{[^\}]+$/.test(e)||e.split("{{").length!==e.split("}}").length||e.split("[[").length!==e.split("]]").length)&&(t[i+1]=t[i]+"|"+t[i+1],t[i]=null)}));for(var i=(t=(t=t.filter((function(e){return null!==e}))).map((function(e){return(e||"").trim()}))).length-1;i>=0;i-=1){""===t[i]&&t.pop();break}return t},Ce=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,qe={template:!0,list:!0,prototype:!0},Ne=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===Ce.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return qe.hasOwnProperty(i)&&(i="_"+i),{key:i,val:n.trim()}}(n);if(a.key)return e[a.key]=a.val,e}t&&t[i]?e[t[i]]=n:(e.list=e.list||[],e.list.push(n));return i+=1,e}),{})},Ae={classname:!0,style:!0,align:!0,margin:!0,left:!0,break:!0,boxsize:!0,framestyle:!0,item_style:!0,collapsible:!0,list_style_type:!0,"list-style-type":!0,colwidth:!0},Le=function(e){return Object.keys(e).forEach((function(t){!0===Ae[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},De=ze,Ie=function(e,t){var i=De(e);return"json"===t?i.json():"raw"===t?i:i.text()},Te=function(e,t,i){t=t||[],e=Ee(e||"");var n=Se(e),a=n.shift(),r=Ne(n,t);return(r=Le(r))[1]&&t[0]&&!1===r.hasOwnProperty(t[0])&&(r[t[0]]=r[1],delete r[1]),Object.keys(r).forEach((function(e){r[e]="list"!==e?Ie(r[e],i):r[e].map((function(e){return Ie(e,i)}))})),a&&(r.template=_e(a)),r},Pe=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Re={title:function(){var e=this.data;return e.title||e.encyclopedia||e.author||""},links:function(e){var t=[];if("number"==typeof e)return t[e];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},text:function(){return""},json:function(){return this.data}};Object.keys(Re).forEach((function(e){Pe.prototype[e]=Re[e]}));var Me=Pe,Ue=ze,Fe=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Ke=function(e){var t=Te(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},Be=function(e){return{template:"citation",type:"inline",data:{},inline:Ue(e)||{}}},We=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Fe(n)){var a=Ke(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Be(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Fe(n)){var a=Ke(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Be(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Me(e)})),e.wiki=i},Ye=ze,Ze=/^(={1,5})(.{1,200}?)={1,5}$/,Ge=function(e,t){var i=t.match(Ze);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=Ye(n).text()).replace(/\{\{.+?\}\}/,"")};We(a),n=re(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},He=function(e){var t=[],i=[];e=function(e){return e=e.filter((function(e){return e&&!0!==/^\|\+/.test(e)})),!0===/^{\|/.test(e[0])&&e.shift(),!0===/^\|}/.test(e[e.length-1])&&e.pop(),!0===/^\|-/.test(e[0])&&e.shift(),e}(e);for(var n=0;n0&&(t.push(i),i=[]):(!(a=a.split(/(?:\|\||!!)/))[0]&&a[1]&&a.shift(),a.forEach((function(e){e=(e=e.replace(/^\| */,"")).trim(),i.push(e)})))}return i.length>0&&t.push(i),t},Ve=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Je=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Qe=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(Ve);if(null!==r){var o=parseInt(r[1],10);n=n.replace(Ve,""),t[a]=n;for(var s=i+1;s0}))}(e))},Xe=ze,et=/^!/,tt={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},it=function(e){return(e=Xe(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},nt=function(e){return e.length-e.filter((function(e){return e})).length>3},at=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=Xe(e).text(),e=(e=it(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];nt(e[0])&&e.shift();var i=e[0];return i&&i[0]&&i[1]&&(/^!/.test(i[0])||/^!/.test(i[1]))&&(t=i.map((function(e){return e=e.replace(/^\! */,""),e=it(e)})),e.shift()),(i=e[0])&&i[0]&&i[1]&&/^!/.test(i[0])&&/^!/.test(i[1])&&(i.forEach((function(e,i){e=e.replace(/^\! */,""),e=it(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Qe(i));if(!n||n.length<=1){n=at(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=at(i.slice(1))).length>0&&(i=i.slice(2))}return i.map((function(e){return function(e,t){var i={};return e.forEach((function(e,n){var a=t[n]||"col"+(n+1),r=Xe(e);r.text(it(r.text())),i[a]=r})),i}(e,n)}))},ot=function(e,t){return e.map((function(e){var i={};return Object.keys(e).forEach((function(t){i[t]=e[t].json()})),!0===t.encode&&(i=Q(i)),i}))},st={},ct=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},ut={links:function(e){var t=[];if(this.data.forEach((function(e){Object.keys(e).forEach((function(i){t=t.concat(e[i].links())}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},keyValue:function(e){var t=this.json(e);return t.forEach((function(e){Object.keys(e).forEach((function(t){e[t]=e[t].text}))})),t},json:function(e){return e=p(e,st),ot(this.data,e)},text:function(){return""}};ut.keyvalue=ut.keyValue,ut.keyval=ut.keyValue,Object.keys(ut).forEach((function(e){ct.prototype[e]=ut[e]}));var lt=ct,pt=/^\s*{\|/,mt=/^\s*\|}/,dt=function(e){for(var t=[],i=e.wiki,n=i.split("\n"),a=[],r=0;r0&&(a[a.length-1]+="\n"+n[r]);else{a[a.length-1]+="\n"+n[r];var o=a.pop();t.push(o)}else a.push(n[r]);var s=[];t.forEach((function(e){if(e){i=(i=i.replace(e+"\n","")).replace(e,"");var t=rt(e);t&&t.length>0&&s.push(new lt(t))}})),s.length>0&&(e.tables=s),e.wiki=i},ft={sentences:!0},gt=function(e,t){var i={};return!0===(t=p(t,ft)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},ht={sentences:!0,lists:!0,images:!0},bt=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},kt={sentences:function(e){return"number"==typeof e?this.data.sentences[e]:this.data.sentences||[]},references:function(e){return"number"==typeof e?this.data.references[e]:this.data.references},lists:function(e){return"number"==typeof e?this.data.lists[e]:this.data.lists},images:function(e){return"number"==typeof e?this.data.images[e]:this.data.images||[]},links:function(e){var t=[];if(this.sentences().forEach((function(i){t=t.concat(i.links(e))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},interwiki:function(e){var t=[];return this.sentences().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},text:function(e){e=p(e,ht);var t=this.sentences().map((function(t){return t.text(e)})).join(" ");return this.lists().forEach((function(e){t+="\n"+e.text()})),t},json:function(e){return e=p(e,ht),gt(this,e)}};kt.citations=kt.references,Object.keys(kt).forEach((function(e){bt.prototype[e]=kt[e]}));var wt=bt;var vt=function(e){for(var t=[],i=[],n=e.split(""),a=0,r=0;r0){for(var s=0,c=0,u=0;uc&&i.push("]"),t.push(i.join("")),i=[]}}return t},yt=ze,xt=new RegExp("("+C.images.join("|")+"):","i"),$t="(".concat(C.images.join("|"),")"),jt=new RegExp($t+":(.+?)[\\||\\]]","iu"),zt={thumb:!0,thumbnail:!0,border:!0,right:!0,left:!0,center:!0,top:!0,bottom:!0,none:!0,upright:!0,baseline:!0,middle:!0,sub:!0,super:!0},Ot=function(e){var t=e.wiki;vt(t).forEach((function(i){if(!0===xt.test(i)){e.images=e.images||[];var n=function(e){var t=e.match(jt);if(null===t||!t[2])return null;var i="".concat(t[1],":").concat(t[2]||""),n=(i=i.trim()).charAt(0).toUpperCase()+i.substring(1);if(n=n.replace(/ /g,"_")){var a={file:i};e=(e=e.replace(/^\[\[/,"")).replace(/\]\]$/,"");var r=Te(e),o=r.list||[];return r.alt&&(a.alt=r.alt),(o=o.filter((function(e){return!1===zt.hasOwnProperty(e)})))[o.length-1]&&(a.caption=yt(o[o.length-1])),new z(a,e)}return null}(i);n&&e.images.push(n),t=t.replace(i,"")}})),e.wiki=t},Et={},_t=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},St={lines:function(){return this.data},links:function(e){var t=[];if(this.lines().forEach((function(e){t=t.concat(e.links())})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},json:function(e){return e=p(e,Et),this.lines().map((function(t){return t.json(e)}))},text:function(){return function(e,t){return e.map((function(e){return" * "+e.text(t)})).join("\n")}(this.data)}};Object.keys(St).forEach((function(e){_t.prototype[e]=St[e]}));var Ct=_t,qt=ze,Nt=/^[#\*:;\|]+/,At=/^\*+[^:,\|]{4}/,Lt=/^ ?\#[^:,\|]{4}/,Dt=/[a-z_0-9\]\}]/i,It=function(e){return Nt.test(e)||At.test(e)||Lt.test(e)},Tt=function(e,t){for(var i=[],n=t;n0&&(i.push(r),a+=r.length-1)}else n.push(t[a]);e.lists=i.map((function(e){return new Ct(e)})),e.wiki=n.join("\n")}},Ut=function(e){var t=e.wiki,i=t.split(Rt);i=(i=i.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var t={wiki:e,lists:[],sentences:[],images:[]};return Mt.list(t),Mt.image(t),Pt(t),new wt(t)})),e.wiki=t,e.paragraphs=i},Ft=function(e,t){var i=Object.keys(e.data).reduce((function(t,i){return e.data[i]&&(t[i]=e.data[i].json()),t}),{});return!0===t.encode&&(i=Q(i)),i},Kt=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Bt=function(e){this._type=e.type,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Wt={type:function(){return this._type},links:function(e){var t=this,i=[];if(Object.keys(this.data).forEach((function(e){t.data[e].links().forEach((function(e){return i.push(e)}))})),"number"==typeof e)return i[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var n=i.find((function(t){return t.page()===e}));return void 0===n?[]:[n]}return i},image:function(){var e=this.get("image")||this.get("image2")||this.get("logo");if(!e)return null;var t=e.json();return t.file=t.text,t.text="",new z(t)},get:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=Kt(e);for(var t=Object.keys(this.data),i=0;i0?a++:a=e.indexOf("{",a+1)){var r=e[a];if("{"===r&&(t+=1),t>0){if("}"===r&&0===(t-=1)){n.push(r);var o=n.join("");n=[],/\{\{/.test(o)&&/\}\}/.test(o)&&i.push(o);continue}if(1===t&&"{"!==r&&"}"!==r){t=0,n=[];continue}n.push(r)}}return i},Gt=function(e){var t=null;return(t=/^\{\{[^\n]+\|/.test(e)?(e.match(/^\{\{(.+?)\|/)||[])[1]:-1!==e.indexOf("\n")?(e.match(/^\{\{(.+?)\n/)||[])[1]:(e.match(/^\{\{(.+?)\}\}$/)||[])[1])&&(t=t.replace(/:.*/,""),t=_e(t)),t||null},Ht=/\{\{/,Vt=function(e){return{body:e,name:Gt(e),children:[]}},Jt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Zt(i),t.children=t.children.map(Vt),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Ht.test(i)?e(t):null})),t},Qt=function(e){var t=Zt(e);return t=(t=t.map(Vt)).map(Jt)},Xt=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","navboxes","reflist","ref-list","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),ei=new RegExp("^(subst.)?("+C.infoboxes.join("|")+")[: \n]","i"),ti=/^infobox /i,ii=/ infobox$/i,ni=/$Year in [A-Z]/i,ai={"gnf protein box":!0,"automatic taxobox":!0,"chembox ":!0,editnotice:!0,geobox:!0,hybridbox:!0,ichnobox:!0,infraspeciesbox:!0,mycomorphbox:!0,oobox:!0,"paraphyletic group":!0,speciesbox:!0,subspeciesbox:!0,"starbox short":!0,taxobox:!0,nhlteamseason:!0,"asian games bid":!0,"canadian federal election results":!0,"dc thomson comic strip":!0,"daytona 24 races":!0,edencharacter:!0,"moldova national football team results":!0,samurai:!0,protein:!0,"sheet authority":!0,"order-of-approx":!0,"bacterial labs":!0,"medical resources":!0,ordination:!0,"hockey team coach":!0,"hockey team gm":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},ri=function(e){return!0===ai.hasOwnProperty(e)||(!!ei.test(e)||(!(!ti.test(e)&&!ii.test(e))||!!ni.test(e)))},oi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(ei),i=e.template;t&&t[0]&&(i=i.replace(t[0],""));var n={template:"infobox",type:i=i.trim(),data:e};return delete n.data.template,delete n.data.list,n},si=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],ci=si.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),ui=function(e){return e<10?"0"+e:String(e)},li=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===si.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(si[e.month]," ").concat(e.year);else{if(t="".concat(si[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(ui(e.hour),":").concat(ui(e.minute));void 0!==e.second&&(i=i+":"+ui(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},pi=function(e){for(var t={},i=["year","month","date","hour","minute","second"],n=0;n0&&(n.years=a,i-=31536e6*n.years);var r=Math.floor(i/2592e6,10);r>0&&(n.months=r,i-=2592e6*n.months);var o=Math.floor(i/864e5,10);return o>0&&(n.days=o),n},gi=pi,hi=li,bi=function(e){return{template:"date",data:e}},ki=function(e){var t=(e=Ee(e)).split("|"),i=gi(t.slice(1,4)),n=t.slice(4,7);if(0===n.length){var a=new Date;n=[a.getFullYear(),a.getMonth(),a.getDate()]}return{from:i,to:n=gi(n)}},wi={date:function(e,t){var i=Te(e,["year","month","date","hour","minute","second","timezone"]),n=gi([i.year,i.month,i.date||i.day]);return i.text=hi(n),i.timezone&&("Z"===i.timezone&&(i.timezone="UTC"),i.text+=" (".concat(i.timezone,")")),i.hour&&i.minute&&(i.second?i.text="".concat(i.hour,":").concat(i.minute,":").concat(i.second,", ")+i.text:i.text="".concat(i.hour,":").concat(i.minute,", ")+i.text),i.text&&t.push(bi(i)),i.text},natural_date:function(e,t){var i=Te(e,["text"]).text||"",n={};if(/^[0-9]{4}$/.test(i))n.year=parseInt(i,10);else{var a=i.replace(/[a-z]+\/[a-z]+/i,"");a=a.replace(/[0-9]+:[0-9]+(am|pm)?/i,"");var r=new Date(a);!1===isNaN(r.getTime())&&(n.year=r.getFullYear(),n.month=r.getMonth()+1,n.date=r.getDate())}return t.push(bi(n)),i.trim()},one_year:function(e,t){var i=Te(e,["year"]),n=Number(i.year);return t.push(bi({year:n})),String(n)},two_dates:function(e,t){var i=Te(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=gi([i.birth_year,i.birth_month,i.birth_date]);return t.push(bi(n)),hi(n)}var a=gi([i.death_year,i.death_month,i.death_date]);return t.push(bi(a)),hi(a)},age:function(e){var t=ki(e);return fi(t.from,t.to).years||0},"diff-y":function(e){var t=ki(e),i=fi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),n.join(", ")},"diff-ymd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-yd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-d":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return i.days+=365*(i.years||0),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")}},vi=function(e){var t=new Date(e);if(isNaN(t.getTime()))return"";var i=(new Date).getTime()-t.getTime(),n="ago";i<0&&(n="from now",i=Math.abs(i));var a=i/1e3/60/60/24;return a<365?parseInt(a,10)+" days "+n:parseInt(a/365,10)+" years "+n},yi=wi.date,xi=wi.natural_date,$i=["January","February","March","April","May","June","July","August","September","October","November","December"],ji=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],zi=Object.assign({},mi,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return ji[e.getDay()]},currentmonth:function(){var e=new Date;return $i[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return $i[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),$i[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),$i[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Te(e,["date","fmt"]).date;return vi(t)},"birth date and age":function(e,t){var i=Te(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?xi(e,t):(t.push(i),i=pi([i.year,i.month,i.day]),li(i))},"birth year and age":function(e,t){var i=Te(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return xi(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=pi([i.birth_year,i.birth_month]);var a=li(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Te(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?xi(e,t):(t.push(i),i=pi([i.death_year,i.death_month]),li(i))},"birth date and age2":function(e,t){var i=Te(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=pi([i.birth_year,i.birth_month,i.birth_day]),li(i)},"birth based on age as of date":function(e,t){var i=Te(e,["age","year","month","day"]);t.push(i);var n=parseInt(i.age,10),a=parseInt(i.year,10)-n;return a&&n?"".concat(a," (age ").concat(i.age,")"):"(age ".concat(i.age,")")},"death date and given age":function(e,t){var i=Te(e,["year","month","day","age"]);t.push(i),i=pi([i.year,i.month,i.day]);var n=li(i);return i.age&&(n+=" (age ".concat(i.age,")")),n},dts:function(e){e=(e=e.replace(/\|format=[ymd]+/i,"")).replace(/\|abbr=(on|off)/i,"");var t=Te(e,["year","month","date","bc"]);return t.date&&t.month&&t.year?!0===/[a-z]/.test(t.month)?[t.month,t.date,t.year].join(" "):[t.year,t.month,t.date].join("-"):t.month&&t.year?[t.year,t.month].join("-"):t.year?(t.year<0&&(t.year=Math.abs(t.year)+" BC"),t.year):""},start:yi,end:yi,birth:yi,death:yi,"start date":yi,"end date":yi,"birth date":yi,"death date":yi,"start date and age":yi,"end date and age":yi,"start-date":xi,"end-date":xi,"birth-date":xi,"death-date":xi,"birth-date and age":xi,"birth-date and given age":xi,"death-date and age":xi,"death-date and given age":xi,birthdeathage:wi.two_dates,dob:yi,age:wi.age,"age nts":wi.age,"age in years":wi["diff-y"],"age in years and months":wi["diff-ym"],"age in years, months and days":wi["diff-ymd"],"age in years and days":wi["diff-yd"],"age in days":wi["diff-d"]});zi.localday=zi.currentday,zi.localdayname=zi.currentdayname,zi.localmonth=zi.currentmonth,zi.localyear=zi.currentyear,zi.currentmonthname=zi.currentmonth,zi.currentmonthabbrev=zi.currentmonth,zi["death date and age"]=zi["birth date and age"],zi.bda=zi["birth date and age"],zi["birth date based on age at death"]=zi["birth based on age as of date"];var Oi=zi,Ei={tag:function(e){var t=Te(e,["tag","open"]);return t.open&&"pair"!==t.open?"":{span:!0,div:!0,p:!0}[t.tag]?t.content||"":"<".concat(t.tag," ").concat(t.attribs||"",">").concat(t.content||"","")},plural:function(e){e=e.replace(/plural:/,"plural|");var t=Te(e,["num","word"]),i=Number(t.num),n=t.word;return 1!==i&&(/.y$/.test(n)?n=n.replace(/y$/,"ies"):n+="s"),i+" "+n},"first word":function(e){var t=Te(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Te(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Te(e,["str","start","end"]),i=parseInt(t.start,10)-1,n=parseInt(t.end,10);return t.str.substr(i,n)},p1:0,p2:1,p3:2,braces:function(e){var t=Te(e,["text"]),i="";return t.list&&(i="|"+t.list.join("|")),"{{"+(t.text||"")+i+"}}"},nobold:0,noitalic:0,nocaps:0,syntaxhighlight:function(e,t){var i=Te(e);return t.push(i),i.code||""},samp:function(e,t){var i=Te(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Te(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Te(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Te(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Te(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Te(e,["degrees","minutes","seconds"]),i=(t.degrees||0)+"°";return t.minutes&&(i+=t.minutes+"′"),t.seconds&&(i+=t.seconds+"″"),i},val:function(e){var t=Te(e,["number","uncertainty"]),i=t.number;i&&Number(i)&&(i=Number(i).toLocaleString());var n=i||"";return t.p&&(n=t.p+n),t.s&&(n=t.s+n),(t.u||t.ul||t.upl)&&(n=n+" "+(t.u||t.ul||t.upl)),n}};Ei.rndfrac=Ei.rnd,Ei.rndnear=Ei.rnd,Ei["unité"]=Ei.val;["nowrap","nobr","big","cquote","pull quote","small","smaller","midsize","larger","big","kbd","bigger","large","mono","strongbad","stronggood","huge","xt","xt2","!xt","xtn","xtd","dc","dcr","mxt","!mxt","mxtn","mxtd","bxt","!bxt","bxtn","bxtd","delink","pre","var","mvar","pre2","code"].forEach((function(e){Ei[e]=function(e){return Te(e,["text"]).text||""}}));var _i=Ei,Si={plainlist:function(e){var t=(e=Ee(e)).split("|");return e=(t=t.slice(1)).join("|"),(t=(t=e.split(/\n ?\* ?/)).filter((function(e){return e}))).join("\n\n")},"collapsible list":function(e,t){var i=Te(e);t.push(i);var n="";if(i.title&&(n+="'''".concat(i.title,"'''")+"\n\n"),!i.list){i.list=[];for(var a=1;a<10;a+=1)i[a]&&(i.list.push(i[a]),delete i[a])}return i.list=i.list.filter((function(e){return e})),n+=i.list.join("\n\n")},"ordered list":function(e,t){var i=Te(e);return t.push(i),i.list=i.list||[],i.list.map((function(e,t){return"".concat(t+1,". ").concat(e)})).join("\n\n")},hlist:function(e){var t=Te(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Te(e).list||[]).join(", ")},catlist:function(e){return(Te(e).list||[]).join(", ")},"br separated entries":function(e){return(Te(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Te(e).list||[]).join(", ")},"anchored list":function(e){var t=Te(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Te(e).list||[];return(t=(t=t.filter((function(e){return e}))).map((function(e){return"• "+e}))).join("\n\n")},"columns-list":function(e,t){var i=((Te(e).list||[])[0]||"").split(/\n/);return i=(i=i.filter((function(e){return e}))).map((function(e){return e.replace(/\*/,"")})),t.push({template:"columns-list",list:i}),(i=i.map((function(e){return"• "+e}))).join("\n\n")}};Si.flatlist=Si.plainlist,Si.ublist=Si.plainlist,Si["unbulleted list"]=Si["collapsible list"],Si.ubl=Si["collapsible list"],Si["bare anchored list"]=Si["anchored list"],Si["plain list"]=Si.plainlist,Si.cmn=Si["columns-list"],Si.collist=Si["columns-list"],Si["col-list"]=Si["columns-list"],Si.columnslist=Si["columns-list"];var Ci=Si,qi={convert:function(e){var t=Te(e,["num","two","three","four"]);return"-"===t.two||"to"===t.two||"and"===t.two?t.four?"".concat(t.num," ").concat(t.two," ").concat(t.three," ").concat(t.four):"".concat(t.num," ").concat(t.two," ").concat(t.three):"".concat(t.num," ").concat(t.two)},term:function(e){var t=Te(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Te(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Te(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Te(e,["a","b","c"]);return t.c?"".concat(t.a," ").concat(t.b,"/").concat(t.c):t.b?"".concat(t.a,"/").concat(t.b):"1/".concat(t.b)},height:function(e,t){var i=Te(e);t.push(i);var n=[];return["m","cm","ft","in"].forEach((function(e){!0===i.hasOwnProperty(e)&&n.push(i[e]+e)})),n.join(" ")},"block indent":function(e){var t=Te(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Te(e,["text","author"]);if(t.push(i),i.text){var n='"'.concat(i.text,'"');return i.author&&(n+="\n\n",n+=" - ".concat(i.author)),n+"\n"}return""},lbs:function(e){var t=Te(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Te(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Te(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Te(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Te(e,["one","two","three"]),n=(i.one||"")+(i.two||"");return"?"===i.one&&(n=(i.two||"")+(i.three||"")),t.push({template:"sic",word:n}),"y"===i.nolink?n:"".concat(n," [sic]")},formatnum:function(e){e=e.replace(/:/,"|");var t=Te(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Te(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Te(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Te(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Te(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Te(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Te(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Te(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Te(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Te(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};qi["str left"]=qi.trunc,qi["str crop"]=qi.trunc,qi.tooltip=qi.abbr,qi.abbrv=qi.abbr,qi.define=qi.abbr,qi.cvt=qi.convert;var Ni=qi,Ai=Object.assign({},_i,Ci,Ni);var Li=function(e){var t=e.pop(),i=Number(e[0]||0),n=Number(e[1]||0),a=Number(e[2]||0);if("string"!=typeof t||isNaN(i))return null;var r=1;return/[SW]/i.test(t)&&(r=-1),r*(i+n/60+a/3600)},Di=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ii={s:!0,w:!0},Ti=function(e){var i=Te(e);i=function(e){return e.list=e.list||[],e.list=e.list.map((function(t){var i=Number(t);if(!isNaN(i))return i;var n=t.split(/:/);return n.length>1?(e.props=e.props||{},e.props[n[0]]=n.slice(1).join(":"),null):t})),e.list=e.list.filter((function(e){return null!==e})),e}(i);var n,a,r=(n=i.list,a=n.map((function(e){return t(e)})).join("|"),2===n.length&&"number|number"===a?{lat:n[0],lon:n[1]}:4===n.length&&"number|string|number|string"===a?(Ii[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Li(n.slice(0,3)),lon:Li(n.slice(3))}:8===n.length?{lat:Li(n.slice(0,4)),lon:Li(n.slice(4))}:{});return i.lat=Di(r.lat),i.lon=Di(r.lon),i.template="coord",delete i.list,i},Pi={coord:function(e,t){var i=Ti(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Pi.coor=Pi.coord,Pi["coor title dms"]=Pi.coord,Pi["coor title dec"]=Pi.coord,Pi["coor dms"]=Pi.coord,Pi["coor dm"]=Pi.coord,Pi["coor dec"]=Pi.coord;var Ri=Pi,Mi={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Te(e,["first","last","target","sort"]),i="".concat(t.first||""," ").concat(t.last||"");return i=i.trim(),t.nolink?t.target||i:(t.dab&&(i+=" (".concat(t.dab,")"),t.target&&(t.target+=" (".concat(t.dab,")"))),t.target?"[[".concat(t.target,"|").concat(i,"]]"):"[[".concat(i,"]]"))}};["lts","t","tfd links","tiw","tltt","tetl","tsetl","ti","tic","tiw","tlt","ttl","twlh","tl2","tlu","demo","hatnote","xpd","para","elc","xtag","mli","mlix","#invoke","url"].forEach((function(e){Mi[e]=function(e){var t=Te(e,["first","second"]);return t.second||t.first}})),Mi.m=Mi.mention,Mi["m-self"]=Mi.mention,Mi.l=Mi.link,Mi.ll=Mi.link,Mi["l-self"]=Mi.link;var Ui=Mi,Fi={wikt:"wiktionary",commons:"commons",c:"commons",commonscat:"commonscat",n:"wikinews",q:"wikiquote",s:"wikisource",a:"wikiauthor",b:"wikibooks",voy:"wikivoyage",v:"wikiversity",d:"wikidata",species:"wikispecies",m:"meta",mw:"mediawiki"},Ki={about:function(e,t){var i=Te(e);return t.push(i),""},main:function(e,t){var i=Te(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Te(e,["redirect"]),n=i.list||[],a=[],r=0;r0&&t.push(a)}return{template:"playoffbracket",rounds:t}}(e);return t.push(i),""}};["2teambracket","4team2elimbracket","8teambracket","16teambracket","32teambracket","cwsbracket","nhlbracket","nhlbracket-reseed","4teambracket-nhl","4teambracket-ncaa","4teambracket-mma","4teambracket-mlb","8teambracket-nhl","8teambracket-mlb","8teambracket-ncaa","8teambracket-afc","8teambracket-afl","8teambracket-tennis3","8teambracket-tennis5","16teambracket-nhl","16teambracket-nhl divisional","16teambracket-nhl-reseed","16teambracket-nba","16teambracket-swtc","16teambracket-afc","16teambracket-tennis3","16teambracket-tennis5"].forEach((function(e){Ji[e]=Ji["4teambracket"]}));var Qi=Ji,Xi={"£":"GB£","¥":"¥","৳":"৳","₩":"₩","€":"€","₱":"₱","₹":"₹","₽":"₽","cn¥":"CN¥","gb£":"GB£","india rs":"₹","indian rupee symbol":"₹","indian rupee":"₹","indian rupees":"₹","philippine peso":"₱","russian ruble":"₽","SK won":"₩","turkish lira":"TRY",a$:"A$",au$:"A$",aud:"A$",bdt:"BDT",brl:"BRL",ca$:"CA$",cad:"CA$",chf:"CHF",cny:"CN¥",czk:"czk",dkk:"dkk",dkk2:"dkk",euro:"€",gbp:"GB£",hk$:"HK$",hkd:"HK$",ils:"ILS",inr:"₹",jpy:"¥",myr:"MYR",nis:"ILS",nok:"NOK",nok2:"NOK",nz$:"NZ$",nzd:"NZ$",peso:"peso",pkr:"₨",r$:"BRL",rmb:"CN¥",rub:"₽",ruble:"₽",rupee:"₹",s$:"sgd",sek:"SEK",sek2:"SEK",sfr:"CHF",sgd:"sgd",shekel:"ILS",sheqel:"ILS",ttd:"TTD",us$:"US$",usd:"US$",yen:"¥",zar:"R"},en=function(e,t){var i=Te(e,["amount","code"]);t.push(i);var n=i.template||"";switch("currency"===n?(n=i.code)||(i.code=n="usd"):""!==n&&"monnaie"!==n&&"unité"!==n&&"nombre"!==n&&"nb"!==n||(n=i.code),n=(n||"").toLowerCase()){case"us":i.code=n="usd";break;case"uk":i.code=n="gbp"}var a="".concat(Xi[n]||"").concat(i.amount||"");return i.code&&!Xi[i.code.toLowerCase()]&&(a+=" "+i.code),a},tn={currency:en,monnaie:en,"unité":en,nombre:en,nb:en,iso4217:en,inrconvert:function(e,t){var i=Te(e,["rupee_value","currency_formatting"]);t.push(i);var n=i.currency_formatting;if(n){var a=1;switch(n){case"k":a=1e3;break;case"m":a=1e6;break;case"b":a=1e9;break;case"t":a=1e12;break;case"l":a=1e5;break;case"c":a=1e7;break;case"lc":a=1e12}i.rupee_value=i.rupee_value*a}return"inr ".concat(i.rupee_value||"")}};Object.keys(Xi).forEach((function(e){tn[e]=en}));var nn=tn,an={"election box begin":function(e,t){var i=Te(e);return t.push(i),""},"election box candidate":function(e,t){var i=Te(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Te(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Te(e);return t.push(i),""}};an["election box begin no change"]=an["election box begin"],an["election box begin no party"]=an["election box begin"],an["election box begin no party no change"]=an["election box begin"],an["election box inline begin"]=an["election box begin"],an["election box inline begin no change"]=an["election box begin"],an["election box candidate for alliance"]=an["election box candidate"],an["election box candidate minor party"]=an["election box candidate"],an["election box candidate no party link no change"]=an["election box candidate"],an["election box candidate with party link"]=an["election box candidate"],an["election box candidate with party link coalition 1918"]=an["election box candidate"],an["election box candidate with party link no change"]=an["election box candidate"],an["election box inline candidate"]=an["election box candidate"],an["election box inline candidate no change"]=an["election box candidate"],an["election box inline candidate with party link"]=an["election box candidate"],an["election box inline candidate with party link no change"]=an["election box candidate"],an["election box inline incumbent"]=an["election box candidate"];var rn=an,on=[["🇦🇩","and","andorra"],["🇦🇪","are","united arab emirates"],["🇦🇫","afg","afghanistan"],["🇦🇬","atg","antigua and barbuda"],["🇦🇮","aia","anguilla"],["🇦🇱","alb","albania"],["🇦🇲","arm","armenia"],["🇦🇴","ago","angola"],["🇦🇶","ata","antarctica"],["🇦🇷","arg","argentina"],["🇦🇸","asm","american samoa"],["🇦🇹","aut","austria"],["🇦🇺","aus","australia"],["🇦🇼","abw","aruba"],["🇦🇽","ala","åland islands"],["🇦🇿","aze","azerbaijan"],["🇧🇦","bih","bosnia and herzegovina"],["🇧🇧","brb","barbados"],["🇧🇩","bgd","bangladesh"],["🇧🇪","bel","belgium"],["🇧🇫","bfa","burkina faso"],["🇧🇬","bgr","bulgaria"],["🇧🇬","bul","bulgaria"],["🇧🇭","bhr","bahrain"],["🇧🇮","bdi","burundi"],["🇧🇯","ben","benin"],["🇧🇱","blm","saint barthélemy"],["🇧🇲","bmu","bermuda"],["🇧🇳","brn","brunei darussalam"],["🇧🇴","bol","bolivia"],["🇧🇶","bes","bonaire, sint eustatius and saba"],["🇧🇷","bra","brazil"],["🇧🇸","bhs","bahamas"],["🇧🇹","btn","bhutan"],["🇧🇻","bvt","bouvet island"],["🇧🇼","bwa","botswana"],["🇧🇾","blr","belarus"],["🇧🇿","blz","belize"],["🇨🇦","can","canada"],["🇨🇨","cck","cocos (keeling) islands"],["🇨🇩","cod","congo"],["🇨🇫","caf","central african republic"],["🇨🇬","cog","congo"],["🇨🇭","che","switzerland"],["🇨🇮","civ","côte d'ivoire"],["🇨🇰","cok","cook islands"],["🇨🇱","chl","chile"],["🇨🇲","cmr","cameroon"],["🇨🇳","chn","china"],["🇨🇴","col","colombia"],["🇨🇷","cri","costa rica"],["🇨🇺","cub","cuba"],["🇨🇻","cpv","cape verde"],["🇨🇼","cuw","curaçao"],["🇨🇽","cxr","christmas island"],["🇨🇾","cyp","cyprus"],["🇨🇿","cze","czech republic"],["🇩🇪","deu","germany"],["🇩🇪","ger","germany"],["🇩🇯","dji","djibouti"],["🇩🇰","dnk","denmark"],["🇩🇲","dma","dominica"],["🇩🇴","dom","dominican republic"],["🇩🇿","dza","algeria"],["🇪🇨","ecu","ecuador"],["🇪🇪","est","estonia"],["🇪🇬","egy","egypt"],["🇪🇭","esh","western sahara"],["🇪🇷","eri","eritrea"],["🇪🇸","esp","spain"],["🇪🇹","eth","ethiopia"],["🇫🇮","fin","finland"],["🇫🇯","fji","fiji"],["🇫🇰","flk","falkland islands (malvinas)"],["🇫🇲","fsm","micronesia"],["🇫🇴","fro","faroe islands"],["🇫🇷","fra","france"],["🇬🇦","gab","gabon"],["🇬🇧","gbr","united kingdom"],["🇬🇩","grd","grenada"],["🇬🇫","guf","french guiana"],["🇬🇬","ggy","guernsey"],["🇬🇭","gha","ghana"],["🇬🇮","gib","gibraltar"],["🇬🇱","grl","greenland"],["🇬🇲","gmb","gambia"],["🇬🇳","gin","guinea"],["🇬🇵","glp","guadeloupe"],["🇬🇶","gnq","equatorial guinea"],["🇬🇷","grc","greece"],["🇬🇸","sgs","south georgia"],["🇬🇹","gtm","guatemala"],["🇬🇺","gum","guam"],["🇬🇼","gnb","guinea-bissau"],["🇬🇾","guy","guyana"],["🇭🇰","hkg","hong kong"],["🇭🇲","hmd","heard island and mcdonald islands"],["🇭🇳","hnd","honduras"],["🇭🇷","hrv","croatia"],["🇭🇹","hti","haiti"],["🇭🇺","hun","hungary"],["🇮🇩","idn","indonesia"],["🇮🇪","irl","ireland"],["🇮🇱","isr","israel"],["🇮🇲","imn","isle of man"],["🇮🇳","ind","india"],["🇮🇴","iot","british indian ocean territory"],["🇮🇶","irq","iraq"],["🇮🇷","irn","iran"],["🇮🇸","isl","iceland"],["🇮🇹","ita","italy"],["🇯🇪","jey","jersey"],["🇯🇲","jam","jamaica"],["🇯🇴","jor","jordan"],["🇯🇵","jpn","japan"],["🇰🇪","ken","kenya"],["🇰🇬","kgz","kyrgyzstan"],["🇰🇭","khm","cambodia"],["🇰🇮","kir","kiribati"],["🇰🇲","com","comoros"],["🇰🇳","kna","saint kitts and nevis"],["🇰🇵","prk","north korea"],["🇰🇷","kor","south korea"],["🇰🇼","kwt","kuwait"],["🇰🇾","cym","cayman islands"],["🇰🇿","kaz","kazakhstan"],["🇱🇦","lao","lao people's democratic republic"],["🇱🇧","lbn","lebanon"],["🇱🇨","lca","saint lucia"],["🇱🇮","lie","liechtenstein"],["🇱🇰","lka","sri lanka"],["🇱🇷","lbr","liberia"],["🇱🇸","lso","lesotho"],["🇱🇹","ltu","lithuania"],["🇱🇺","lux","luxembourg"],["🇱🇻","lva","latvia"],["🇱🇾","lby","libya"],["🇲🇦","mar","morocco"],["🇲🇨","mco","monaco"],["🇲🇩","mda","moldova"],["🇲🇪","mne","montenegro"],["🇲🇫","maf","saint martin (french part)"],["🇲🇬","mdg","madagascar"],["🇲🇭","mhl","marshall islands"],["🇲🇰","mkd","macedonia"],["🇲🇱","mli","mali"],["🇲🇲","mmr","myanmar"],["🇲🇳","mng","mongolia"],["🇲🇴","mac","macao"],["🇲🇵","mnp","northern mariana islands"],["🇲🇶","mtq","martinique"],["🇲🇷","mrt","mauritania"],["🇲🇸","msr","montserrat"],["🇲🇹","mlt","malta"],["🇲🇺","mus","mauritius"],["🇲🇻","mdv","maldives"],["🇲🇼","mwi","malawi"],["🇲🇽","mex","mexico"],["🇲🇾","mys","malaysia"],["🇲🇿","moz","mozambique"],["🇳🇦","nam","namibia"],["🇳🇨","ncl","new caledonia"],["🇳🇪","ner","niger"],["🇳🇫","nfk","norfolk island"],["🇳🇬","nga","nigeria"],["🇳🇮","nic","nicaragua"],["🇳🇱","nld","netherlands"],["🇳🇴","nor","norway"],["🇳🇵","npl","nepal"],["🇳🇷","nru","nauru"],["🇳🇺","niu","niue"],["🇳🇿","nzl","new zealand"],["🇴🇲","omn","oman"],["🇵🇦","pan","panama"],["🇵🇪","per","peru"],["🇵🇫","pyf","french polynesia"],["🇵🇬","png","papua new guinea"],["🇵🇭","phl","philippines"],["🇵🇰","pak","pakistan"],["🇵🇱","pol","poland"],["🇵🇲","spm","saint pierre and miquelon"],["🇵🇳","pcn","pitcairn"],["🇵🇷","pri","puerto rico"],["🇵🇸","pse","palestinian territory"],["🇵🇹","prt","portugal"],["🇵🇼","plw","palau"],["🇵🇾","pry","paraguay"],["🇶🇦","qat","qatar"],["🇷🇪","reu","réunion"],["🇷🇴","rou","romania"],["🇷🇸","srb","serbia"],["🇷🇺","rus","russia"],["🇷🇼","rwa","rwanda"],["🇸🇦","sau","saudi arabia"],["🇸🇧","slb","solomon islands"],["🇸🇨","syc","seychelles"],["🇸🇩","sdn","sudan"],["🇸🇪","swe","sweden"],["🇸🇬","sgp","singapore"],["🇸🇭","shn","saint helena, ascension and tristan da cunha"],["🇸🇮","svn","slovenia"],["🇸🇯","sjm","svalbard and jan mayen"],["🇸🇰","svk","slovakia"],["🇸🇱","sle","sierra leone"],["🇸🇲","smr","san marino"],["🇸🇳","sen","senegal"],["🇸🇴","som","somalia"],["🇸🇷","sur","suriname"],["🇸🇸","ssd","south sudan"],["🇸🇹","stp","sao tome and principe"],["🇸🇻","slv","el salvador"],["🇸🇽","sxm","sint maarten (dutch part)"],["🇸🇾","syr","syrian arab republic"],["🇸🇿","swz","swaziland"],["🇹🇨","tca","turks and caicos islands"],["🇹🇩","tcd","chad"],["🇹🇫","atf","french southern territories"],["🇹🇬","tgo","togo"],["🇹🇭","tha","thailand"],["🇹🇯","tjk","tajikistan"],["🇹🇰","tkl","tokelau"],["🇹🇱","tls","timor-leste"],["🇹🇲","tkm","turkmenistan"],["🇹🇳","tun","tunisia"],["🇹🇴","ton","tonga"],["🇹🇷","tur","turkey"],["🇹🇹","tto","trinidad and tobago"],["🇹🇻","tuv","tuvalu"],["🇹🇼","twn","taiwan"],["🇹🇿","tza","tanzania"],["🇺🇦","ukr","ukraine"],["🇺🇬","uga","uganda"],["🇺🇲","umi","united states minor outlying islands"],["🇺🇸","usa","united states"],["🇺🇸","us","united states"],["🇺🇾","ury","uruguay"],["🇺🇿","uzb","uzbekistan"],["🇻🇦","vat","vatican city"],["🇻🇨","vct","saint vincent and the grenadines"],["🇻🇪","ven","venezuela"],["🇻🇬","vgb","virgin islands, british"],["🇻🇮","vir","virgin islands, u.s."],["🇻🇳","vnm","viet nam"],["🇻🇺","vut","vanuatu"],["","win","west indies"],["🇼🇫","wlf","wallis and futuna"],["🇼🇸","wsm","samoa"],["🇾🇪","yem","yemen"],["🇾🇹","myt","mayotte"],["🇿🇦","zaf","south africa"],["🇿🇲","zmb","zambia"],["🇿🇼 ","zwe","zimbabwe"],["🇺🇳","un","united nations"],["🏴󠁧󠁢󠁥󠁮󠁧󠁿󠁧󠁢󠁥󠁮󠁧󠁿","eng","england"],["🏴󠁧󠁢󠁳󠁣󠁴󠁿","sct","scotland"],["🏴󠁧󠁢󠁷󠁬󠁳󠁿","wal","wales"],["🇪🇺","eu","european union"]],sn={flag:function(e){var t=Te(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],a=n[0]||"";return"".concat(a," [[").concat(n[2],"|").concat(i,"]]")},flagcountry:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," [[").concat(i[2],"]]")},flagcu:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," ").concat(i[2])},flagicon:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"[[".concat(i[2],"|").concat(i[0],"]]"):""},flagdeco:function(e){var t=Te(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(i[2]," national football team|").concat(i[2],"]]"):""},fbicon:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?" [[".concat(i[2]," national football team|").concat(i[0],"]]"):""},flagathlete:function(e){var t=Te(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(t.name||"","]] (").concat(i[1].toUpperCase(),")"):"[[".concat(t.name||"","]]")}};on.forEach((function(e){sn[e[1]]=function(){return e[0]}})),sn.cr=sn.flagcountry,sn["cr-rt"]=sn.flagcountry,sn.cricon=sn.flagicon;var cn=sn,un=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===q.hasOwnProperty(t[1])?q[t[1]].english_title:t[1]:null},ln={ipa:function(e,t){var i=Te(e,["transcription","lang","audio"]);return i.lang=un(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Te(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=un(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Te(e,["lang","text","text2"]);return i.text2&&(i.iso=i.text,i.text=i.text2,delete i.text2),t.push(i),i.text||""}};Object.keys(q).forEach((function(e){ln["ipa-"+e]=ln.ipa,ln["ipac-"+e]=ln.ipac}));var pn=ln,mn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Te(e,["english","kanji","romaji","extra"]);t.push(i);var n=i.english||i.romaji||"";return i.kanji&&(n+=" (".concat(i.kanji,")")),n}};Object.keys(q).forEach((function(e){mn["lang-"+e]=mn["lang-de"]})),mn.nihongo2=mn.nihongo,mn.nihongo3=mn.nihongo,mn["nihongo-s"]=mn.nihongo,mn["nihongo foot"]=mn.nihongo;var dn=mn,fn=function(e){if(!e.numerator&&!e.denominator)return null;var t=Number(e.numerator)/Number(e.denominator);t*=100;var i=Number(e.decimals);return isNaN(i)&&(i=1),t=t.toFixed(i),Number(t)},gn={math:function(e,t){var i=Te(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Te(e,["a","b","c"]),n={template:"sfrac"};return i.c?(n.integer=i.a,n.numerator=i.b,n.denominator=i.c):i.b?(n.numerator=i.a,n.denominator=i.b):(n.numerator=1,n.denominator=i.a),t.push(n),n.integer?"".concat(n.integer," ").concat(n.numerator,"⁄").concat(n.denominator):"".concat(n.numerator,"⁄").concat(n.denominator)},radic:function(e){var t=Te(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Te(e,["numerator","denominator","decimals"]),i=fn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Te(e,["done","total","digits"]),i=fn({numerator:t.done,denominator:t.total,decimals:t.digits});return null===i?"":"".concat(t.done," (").concat(i,"%) done")},"winning percentage":function(e,t){var i=Te(e,["wins","losses","ties"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=Number(i.ties)||0,o=n+a+r;"y"===i.ignore_ties&&(r=0),r&&(n+=r/2);var s=fn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Te(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=fn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};gn.sfrac=gn.frac,gn.sqrt=gn.radic,gn.pct=gn.percentage,gn.percent=gn.percentage,gn.winpct=gn["winning percentage"],gn.winperc=gn["winning percentage"];var hn=gn,bn=function(e,t,i){var n=Te(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},kn={persondata:bn,taxobox:bn,citation:bn,portal:bn,reflist:bn,"cite book":bn,"cite journal":bn,"cite web":bn,"commons cat":bn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Te(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Te(e,["spouse","from","to","end"]);t.push(i);var n="".concat(i.spouse||"");return i.from&&(i.to?n+=" (m. ".concat(i.from,"-").concat(i.to,")"):n+=" (m. ".concat(i.from,")")),n},"based on":function(e,t){var i=Te(e,["title","author"]);return t.push(i),"".concat(i.title," by ").concat(i.author||"")},"video game release":function(e,t){for(var i=["region","date","region2","date2","region3","date3","region4","date4"],n=Te(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Bn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Wn={text:function(){return""},json:function(){return this.data}};Object.keys(Wn).forEach((function(e){Bn.prototype[e]=Wn[e]}));var Yn=Bn,Zn=new RegExp("^(cite |citation)","i"),Gn={citation:!0,refn:!0,harvnb:!0},Hn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Vn=function(e){var t=e.wiki,i=Qt(t),n=[];i.forEach((function(e){return function e(i,a){i.parent=a,i.children&&i.children.length>0&&i.children.forEach((function(t){return e(t,i)})),i.out=Kn(i,n);!function e(t,i,n){t.parent&&(t.parent.body=t.parent.body.replace(i,n),e(t.parent,i,n))}(i,i.body,i.out),t=t.replace(i.body,i.out)}(e,null)})),e.infoboxes=e.infoboxes||[],e.references=e.references||[],e.templates=e.templates||[],e.templates=e.templates.concat(n),e.templates=e.templates.filter((function(t){return!0===function(e){return!0===Gn[e.template]||!0===Zn.test(e.template)}(t)?(e.references.push(new Me(t)),!1):!0!==Hn(t)||(e.infoboxes.push(new Yt(t)),!1)})),e.templates=e.templates.map((function(e){return new Yn(e)})),i.forEach((function(e){t=t.replace(e.body,e.out)})),e.wiki=t},Jn=ze,Qn=function(e){var t=e.wiki;t=t.replace(/]*?)>([\s\S]+?)<\/gallery>/g,(function(t,i,n){var a=n.split(/\n/g);return(a=(a=a.filter((function(e){return e&&""!==e.trim()}))).map((function(e){var t=e.split(/\|/),i={file:t[0].trim()},n=new z(i).json(),a=t.slice(1).join("|");return""!==a&&(n.caption=Jn(a)),n}))).length>0&&e.templates.push({template:"gallery",images:a,pos:e.title}),""})),e.wiki=t},Xn=function(e){var t=e.wiki;t=t.replace(/\{\{election box begin([\s\S]+?)\{\{election box end\}\}/gi,(function(t){var i={wiki:t,templates:[]};Vn(i);var n=i.templates.map((function(e){return e.json()})),a=n.find((function(e){return"election box"===e.template}))||{},r=n.filter((function(e){return"election box candidate"===e.template})),o=n.find((function(e){return"election box gain"===e.template||"election box hold"===e.template}))||{};return(r.length>0||o)&&e.templates.push({template:"election box",title:a.title,candidates:r,summary:o.data}),""})),e.wiki=t},ea={coach:["team","year","g","w","l","w-l%","finish","pg","pw","pl","pw-l%"],player:["year","team","gp","gs","mpg","fg%","3p%","ft%","rpg","apg","spg","bpg","ppg"],roster:["player","gp","gs","mpg","fg%","3fg%","ft%","rpg","apg","spg","bpg","ppg"]},ta=function(e){var t=e.wiki;t=t.replace(/\{\{nba (coach|player|roster) statistics start([\s\S]+?)\{\{s-end\}\}/gi,(function(t,i){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{s-end\}\}/,""),i=i.toLowerCase().trim();var n="! "+ea[i].join(" !! "),a=rt("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"NBA "+i+" statistics",data:a}),""})),e.wiki=t},ia=function(e){var t=e.wiki;t=t.replace(/\{\{mlb game log (section|month)[\s\S]+?\{\{mlb game log (section|month) end\}\}/gi,(function(t){var i=function(e){var t=["#","date","opponent","score","win","loss","save","attendance","record"];return!0===/\|stadium=y/i.test(e)&&t.splice(7,0,"stadium"),!0===/\|time=y/i.test(e)&&t.splice(7,0,"time"),!0===/\|box=y/i.test(e)&&t.push("box"),t}(t);t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{mlb game log (section|month) end\}\}/i,"");var n="! "+i.join(" !! "),a=rt("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mlb game log section",data:a}),""})),e.wiki=t},na=["res","record","opponent","method","event","date","round","time","location","notes"],aa=function(e){var t=e.wiki;t=t.replace(/\{\{mma record start[\s\S]+?\{\{end\}\}/gi,(function(t){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{end\}\}/i,"");var i="! "+na.join(" !! "),n=rt("{|\n"+i+"\n"+t+"\n|}");return n=n.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mma record start",data:n}),""})),e.wiki=t},ra=ze,oa=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=ra(n).text();return e.templates.push({template:"math",formula:a,raw:n}),a&&a.length<12?a:""}))).replace(/]*?)>([\s\S]+?)<\/chem>/g,(function(t,i,n){return e.templates.push({template:"chem",data:n}),""})),e.wiki=t},sa=function(e){Xn(e),Qn(e),oa(e),ia(e),aa(e),ta(e)},ca=new RegExp("^("+C.references.join("|")+"):?","i"),ua=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,la={heading:Ge,table:dt,paragraphs:Ut,templates:Vn,references:We,startEndTemplates:sa},pa=function(e,t){return la.startEndTemplates(e),la.references(e),la.templates(e),la.table(e),la.paragraphs(e,t),e=new ae(e)},ma=function(e){for(var t=[],i=e.wiki.split(ua),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},da=new RegExp("\\[\\[:?("+C.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),fa=new RegExp("^\\[\\[:?("+C.categories.join("|")+"):","ig"),ga={section:ma,categories:function(e){var t=e.wiki,i=t.match(da);i&&i.forEach((function(t){(t=(t=(t=t.replace(fa,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(da,""),e.wiki=t}},ha=function(e,t){t=t||{};var i=Object.assign(t,{title:t.title||null,pageID:t.pageID||t.id||null,namespace:t.namespace||t.ns||null,type:"page",wiki:e||"",categories:[],sections:[],coordinates:[]});return!0===F(e)?(i.type="redirect",i.redirectTo=K(e),ga.categories(i),new S(i)):(H(i),ga.categories(i),ga.section(i),new S(i))},ba=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return ha(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},ka=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},wa=function(e){var t=e.userAgent||e["User-Agent"]||e["Api-User-Agent"]||"User of the wtf_wikipedia library";return{method:"GET",headers:{"Content-Type":"application/json","Api-User-Agent":t,"User-Agent":t,Origin:"*"},redirect:"follow"}},va=/^https?:\/\//,ya={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},xa=function(t,i,n){var a=null;"function"==typeof i&&(a=i,i={}),"function"==typeof n&&(a=n,n={}),"string"==typeof i&&(n=n||{},i=Object.assign({},{lang:i},n)),i=i||{},(i=Object.assign({},ya,i)).title=t,va.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=wa(i);return ka(r,o).then((function(e){try{var t=u(e,i);return t=ba(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},$a={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},ja=function(e,t){var i;t=t||{},t=Object.assign({},$a,t),"string"==typeof e?t.lang=e:(i=e)&&"[object Object]"===Object.prototype.toString.call(i)&&(t=Object.assign(t,e));var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*";var a=wa(t);return ka(n,a).then((function(e){try{var t=u(e);return ba(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},za={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Oa=function(e,t,i){var n;i=i||{},i=Object.assign({},za,i),"string"==typeof t?i.lang=t:(n=t)&&"[object Object]"===Object.prototype.toString.call(n)&&(i=Object.assign(i,t));var a={pages:[],categories:[]};return new Promise((function(t,n){!function r(o){var s=function(e,t,i){e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!1===/^Category/i.test(e)&&(e="Category:"+e),e=e.replace(/ /g,"_")}(e),e=encodeURIComponent(e);var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");return t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="action=query&list=categorymembers&cmtitle=".concat(e,"&cmlimit=500&format=json&origin=*&redirects=true&cmtype=page|subcat"),i&&(n+="&cmcontinue="+i),n}(e,i,o),c=wa(i);return ka(s,c).then((function(e){a=function(e){var t=e.query.categorymembers||[],i={pages:[],categories:[]};return t.forEach((function(e){14===e.ns?(delete e.ns,i.categories.push(e)):(delete e.ns,i.pages.push(e))})),i}(e),e.continue&&e.continue.cmcontinue?r(e.continue.cmcontinue):t(a)})).catch((function(e){console.error(e),n(e)}))}(null)}))},Ea=function(e,t){return ha(e,t)},_a={Doc:S,Section:ae,Paragraph:wt,Sentence:be,Image:z,Infobox:Yt,Link:ue,List:Ct,Reference:Me,Table:lt,Template:Yn,wtf:Ea};Ea.fetch=function(e,t,i,n){return xa(e,t,i)},Ea.random=function(e,t,i){return ja(e,t)},Ea.category=function(e,t,i,n){return Oa(e,t,i)},Ea.extend=function(e){return e(_a,Mn,this),this},Ea.version="8.1.0";var Sa=Ea;export default Sa; +var e=function(e){var t=new URL(e),i=t.pathname.replace(/^\/(wiki\/)?/,"");return i=decodeURIComponent(i),{domain:t.host,title:i}};function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var i=[],n=!0,a=!1,r=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){a=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);iObject.keys(t.data).length?-1:1})),"number"==typeof e?t[e]:t},text:function(e){return e=p(e,O),!0===this.isRedirect()?"":this.sections().map((function(t){return t.text(e)})).join("\n\n")},json:function(e){return e=p(e,O),d(this,e)},debug:function(){return console.log("\n"),this.sections().forEach((function(e){for(var t=" - ",i=0;i500)&&U.test(e)},K=function(e){var t=e.match(U);return t&&t[2]?(M(t[2])||[])[0]:{}},B=["table","code","score","data","categorytree","charinsert","hiero","imagemap","inputbox","nowiki","poem","references","source","syntaxhighlight","timeline"],W="< ?(".concat(B.join("|"),") ?[^>]{0,200}?>"),Y="< ?/ ?(".concat(B.join("|"),") ?>"),Z=new RegExp("".concat(W,"[").concat("\\s\\S","]+?").concat(Y),"ig"),G=function(e){return(e=(e=(e=(e=(e=(e=(e=e.replace(Z," ")).replace(/ ?< ?(span|div|table|data) [a-zA-Z0-9=%\.#:;'" ]{2,100}\/? ?> ?/g," ")).replace(/ ?< ?(ref) [a-zA-Z0-9=" ]{2,100}\/ ?> ?/g," ")).replace(/ ?<[ \/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s|small)[ \/]?> ?/g," ")).replace(/ ?<[ \/]?h[0-9][ \/]?> ?/g," ")).replace(/ ?< ?br ?\/> ?/g,"\n")).trim()};var H=function(e){var t=e.wiki;t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(//g,"")).replace(/__(NOTOC|NOEDITSECTION|FORCETOC|TOC)__/gi,"")).replace(/~~{1,3}/g,"")).replace(/\r/g,"")).replace(/\u3002/g,". ")).replace(/----/g,"")).replace(/\{\{\}\}/g," – ")).replace(/\{\{\\\}\}/g," / ")).replace(/ /g," "),t=(t=(t=G(t)).replace(/\([,;: ]+?\)/g,"")).replace(/{{(baseball|basketball) (primary|secondary) (style|color).*?\}\}/i,""),e.wiki=t},V=/[\\\.$]/,J=function(e){return"string"!=typeof e&&(e=""),e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/^\$/,"\\u0024")).replace(/\./g,"\\u002e")},Q=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.keys(e),i=0;i0&&(i.paragraphs=n)}if(!0===t.images){var a=e.images().map((function(e){return e.json(t)}));a.length>0&&(i.images=a)}if(!0===t.tables){var r=e.tables().map((function(e){return e.json(t)}));r.length>0&&(i.tables=r)}if(!0===t.templates){var o=e.templates();o.length>0&&(i.templates=o,!0===t.encode&&i.templates.forEach((function(e){return Q(e)})))}if(!0===t.infoboxes){var s=e.infoboxes().map((function(e){return e.json(t)}));s.length>0&&(i.infoboxes=s)}if(!0===t.lists){var c=e.lists().map((function(e){return e.json(t)}));c.length>0&&(i.lists=c)}if(!0===t.references||!0===t.citations){var u=e.references().map((function(e){return e.json(t)}));u.length>0&&(i.references=u)}return!0===t.sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},te={tables:!0,references:!0,paragraphs:!0,templates:!0,infoboxes:!0},ie=function(e){this.depth=e.depth,this.doc=null,this._title=e.title||"",Object.defineProperty(this,"doc",{enumerable:!1,value:null}),e.templates=e.templates||[],Object.defineProperty(this,"data",{enumerable:!1,value:e})},ne={title:function(){return this._title||""},index:function(){if(!this.doc)return null;var e=this.doc.sections().indexOf(this);return-1===e?null:e},indentation:function(){return this.depth},sentences:function(e){var t=this.paragraphs().reduce((function(e,t){return e.concat(t.sentences())}),[]);return"number"==typeof e?t[e]:t||[]},paragraphs:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t||[]},paragraph:function(e){var t=this.data.paragraphs||[];return"number"==typeof e?t[e]:t[0]},links:function(e){var t=[];if(this.infoboxes().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.sentences().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.tables().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),this.lists().forEach((function(i){i.links(e).forEach((function(e){return t.push(e)}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},tables:function(e){var t=this.data.tables||[];return"number"==typeof e?t[e]:t},templates:function(e){var t=this.data.templates||[];return t=t.map((function(e){return e.json()})),"number"==typeof e?t[e]:"string"==typeof e?(e=e.toLowerCase(),t.filter((function(t){return t.template===e||t.name===e}))):t},infoboxes:function(e){var t=this.data.infoboxes||[];return"number"==typeof e?t[e]:t},coordinates:function(e){var t=[].concat(this.templates("coord"),this.templates("coor"));return"number"==typeof e?t[e]?t[e]:[]:t},lists:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.lists())})),"number"==typeof e?t[e]:t},interwiki:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},images:function(e){var t=[];return this.paragraphs().forEach((function(e){t=t.concat(e.images())})),"number"==typeof e?t[e]:t||[]},references:function(e){var t=this.data.references||[];return"number"==typeof e?t[e]:t},remove:function(){if(!this.doc)return null;var e={};e[this.title()]=!0,this.children().forEach((function(t){return e[t.title()]=!0}));var t=this.doc.data.sections;return t=t.filter((function(t){return!0!==e.hasOwnProperty(t.title())})),this.doc.data.sections=t,this.doc},nextSibling:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index()+1;tthis.depth)for(var a=i+1;athis.depth;a+=1)n.push(t[a]);return"string"==typeof e?(e=e.toLowerCase(),n.find((function(t){return t.title().toLowerCase()===e}))):"number"==typeof e?n[e]:n},parent:function(){if(!this.doc)return null;for(var e=this.doc.sections(),t=this.index();t>=0;t-=1)if(e[t]&&e[t].depth0&&(e.fmt=e.fmt||{},e.fmt.bold=t),i.length>0&&(e.fmt=e.fmt||{},e.fmt.italic=i),e},me=/^[0-9,.]+$/,de={text:!0,links:!0,formatting:!0,dates:!0,numbers:!0},fe=function(e,t){t=p(t,de);var i={},n=e.text();if(!0===t.text&&(i.text=n),!0===t.numbers&&me.test(n)){var a=Number(n.replace(/,/g,""));!1===isNaN(a)&&(i.number=a)}return t.links&&e.links().length>0&&(i.links=e.links().map((function(e){return e.json()}))),t.formatting&&e.data.fmt&&(i.formatting=e.data.fmt),t.dates&&void 0!==e.data.dates&&(i.dates=e.data.dates),i},ge=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},he={links:function(e){var t=this.data.links||[];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page===e}));return void 0===i?[]:[i]}return t},interwiki:function(e){var t=this.links().filter((function(e){return void 0!==e.wiki}));return"number"==typeof e?t[e]:t},bolds:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.bold&&(t=this.data.fmt.bold||[]),"number"==typeof e?t[e]:t},italics:function(e){var t=[];return this.data&&this.data.fmt&&this.data.fmt.italic&&(t=this.data.fmt.italic||[]),"number"==typeof e?t[e]:t},dates:function(e){var t=[];return this.data&&this.data.dates&&(t=this.data.dates||[]),"number"==typeof e?t[e]:t},text:function(e){return void 0!==e&&"string"==typeof e&&(this.data.text=e),this.data.text||""},json:function(e){return fe(this,e)}};Object.keys(he).forEach((function(e){ge.prototype[e]=he[e]})),ge.prototype.italic=ge.prototype.italics,ge.prototype.bold=ge.prototype.bolds,ge.prototype.plaintext=ge.prototype.text;var be=ge,ke=["ad","adj","adm","adv","al","alta","approx","apr","apt","arc","ariz","assn","asst","atty","aug","ave","ba","bc","bl","bldg","blvd","brig","bros","ca","cal","calif","capt","cca","cg","cl","cm","cmdr","co","col","colo","comdr","conn","corp","cpl","cres","ct","cyn","dak","dec","def","dept","det","dg","dist","dl","dm","dr","ea","eg","eng","esp","esq","est","etc","ex","exp","feb","fem","fig","fl oz","fl","fla","fm","fr","ft","fy","ga","gal","gb","gen","gov","hg","hon","hr","hrs","hwy","hz","ia","ida","ie","inc","inf","jan","jd","jr","jul","jun","kan","kans","kb","kg","km","kmph","lat","lb","lit","llb","lm","lng","lt","ltd","lx","ma","maj","mar","masc","mb","md","messrs","mg","mi","min","minn","misc","mister","ml","mlle","mm","mme","mph","mps","mr","mrs","ms","mstr","mt","neb","nebr","nee","no","nov","oct","okla","ont","op","ord","oz","pa","pd","penn","penna","phd","pl","pp","pref","prob","prof","pron","ps","psa","pseud","pt","pvt","qt","que","rb","rd","rep","reps","res","rev","sask","sec","sen","sens","sep","sept","sfc","sgt","sir","situ","sq ft","sq","sr","ss","st","supt","surg","tb","tbl","tbsp","tce","td","tel","temp","tenn","tex","tsp","univ","usafa","ut","va","vb","ver","vet","vitro","vivo","vol","vs","vt","wis","wisc","wr","wy","wyo","yb","µg"].concat("[^]][^]]"),we=new RegExp("(^| |')("+ke.join("|")+")[.!?] ?$","i"),ve=new RegExp("[ |.|'|[][A-Z].? *?$","i"),ye=new RegExp("\\.\\.\\.* +?$"),xe=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),$e=function(e){var t=[],i=[];if(!e||"string"!=typeof e||0===e.trim().length)return t;for(var n=function(e){var t=e.split(/(\n+)/);return function(e){var t=[];return e.forEach((function(e){t=t.concat(e)})),t}(t=(t=t.filter((function(e){return e.match(/\S/)}))).map((function(e){return e.split(/(\S.+?[.!?]"?)(?=\s+|$)/g)})))}(e),a=0;ai.length)return!1;var n=e.match(/"/g);return!(n&&n.length%2!=0&&e.length<900)}(o))?i[s+1]=i[s]+(i[s+1]||""):i[s]&&i[s].length>0&&(t.push(i[s]),i[s]="");return 0===t.length?[e]:t};function je(e){var t,i={text:e};return le(i),i.text=(t=(t=(t=i.text).replace(/\([,;: ]*\)/g,"")).replace(/\( *(; ?)+/g,"("),t=(t=re(t)).replace(/ +\.$/,".")),i=pe(i),new be(i)}var ze=je,Oe=function(e){var t=$e(e.wiki);(t=t.map(je))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},Ee=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},_e=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},Se=function(e){var t=e.split(/\n?\|/);t.forEach((function(e,i){null!==e&&(/\[\[[^\]]+$/.test(e)||/\{\{[^\}]+$/.test(e)||e.split("{{").length!==e.split("}}").length||e.split("[[").length!==e.split("]]").length)&&(t[i+1]=t[i]+"|"+t[i+1],t[i]=null)}));for(var i=(t=(t=t.filter((function(e){return null!==e}))).map((function(e){return(e||"").trim()}))).length-1;i>=0;i-=1){""===t[i]&&t.pop();break}return t},Ce=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,qe={template:!0,list:!0,prototype:!0},Ne=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===Ce.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return qe.hasOwnProperty(i)&&(i="_"+i),{key:i,val:n.trim()}}(n);if(a.key)return e[a.key]=a.val,e}t&&t[i]?e[t[i]]=n:(e.list=e.list||[],e.list.push(n));return i+=1,e}),{})},Ae={classname:!0,style:!0,align:!0,margin:!0,left:!0,break:!0,boxsize:!0,framestyle:!0,item_style:!0,collapsible:!0,list_style_type:!0,"list-style-type":!0,colwidth:!0},Le=function(e){return Object.keys(e).forEach((function(t){!0===Ae[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},De=ze,Ie=function(e,t){var i=De(e);return"json"===t?i.json():"raw"===t?i:i.text()},Te=function(e,t,i){t=t||[],e=Ee(e||"");var n=Se(e),a=n.shift(),r=Ne(n,t);return(r=Le(r))[1]&&t[0]&&!1===r.hasOwnProperty(t[0])&&(r[t[0]]=r[1],delete r[1]),Object.keys(r).forEach((function(e){r[e]="list"!==e?Ie(r[e],i):r[e].map((function(e){return Ie(e,i)}))})),a&&(r.template=_e(a)),r},Pe=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Re={title:function(){var e=this.data;return e.title||e.encyclopedia||e.author||""},links:function(e){var t=[];if("number"==typeof e)return t[e];if("number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},text:function(){return""},json:function(){return this.data}};Object.keys(Re).forEach((function(e){Pe.prototype[e]=Re[e]}));var Me=Pe,Ue=ze,Fe=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Ke=function(e){var t=Te(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},Be=function(e){return{template:"citation",type:"inline",data:{},inline:Ue(e)||{}}},We=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Fe(n)){var a=Ke(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Be(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Fe(n)){var a=Ke(n);a&&t.push(a),i=i.replace(n,"")}else t.push(Be(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Me(e)})),e.wiki=i},Ye=ze,Ze=/^(={1,5})(.{1,200}?)={1,5}$/,Ge=function(e,t){var i=t.match(Ze);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=Ye(n).text()).replace(/\{\{.+?\}\}/,"")};We(a),n=re(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},He=function(e){var t=[],i=[];e=function(e){return e=e.filter((function(e){return e&&!0!==/^\|\+/.test(e)})),!0===/^{\|/.test(e[0])&&e.shift(),!0===/^\|}/.test(e[e.length-1])&&e.pop(),!0===/^\|-/.test(e[0])&&e.shift(),e}(e);for(var n=0;n0&&(t.push(i),i=[]):(!(a=a.split(/(?:\|\||!!)/))[0]&&a[1]&&a.shift(),a.forEach((function(e){e=(e=e.replace(/^\| */,"")).trim(),i.push(e)})))}return i.length>0&&t.push(i),t},Ve=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Je=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Qe=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(Ve);if(null!==r){var o=parseInt(r[1],10);n=n.replace(Ve,""),t[a]=n;for(var s=i+1;s0}))}(e))},Xe=ze,et=/^!/,tt={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},it=function(e){return(e=Xe(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},nt=function(e){return(e=e||[]).length-e.filter((function(e){return e})).length>3},at=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=Xe(e).text(),e=(e=it(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];nt(e[0])&&e.shift();var i=e[0];return i&&i[0]&&i[1]&&(/^!/.test(i[0])||/^!/.test(i[1]))&&(t=i.map((function(e){return e=e.replace(/^\! */,""),e=it(e)})),e.shift()),(i=e[0])&&i[0]&&i[1]&&/^!/.test(i[0])&&/^!/.test(i[1])&&(i.forEach((function(e,i){e=e.replace(/^\! */,""),e=it(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Qe(i));if(!n||n.length<=1){n=at(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=at(i.slice(1))).length>0&&(i=i.slice(2))}return i.map((function(e){return function(e,t){var i={};return e.forEach((function(e,n){var a=t[n]||"col"+(n+1),r=Xe(e);r.text(it(r.text())),i[a]=r})),i}(e,n)}))},ot=function(e,t){return e.map((function(e){var i={};return Object.keys(e).forEach((function(t){i[t]=e[t].json()})),!0===t.encode&&(i=Q(i)),i}))},st={},ct=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},ut={links:function(e){var t=[];if(this.data.forEach((function(e){Object.keys(e).forEach((function(i){t=t.concat(e[i].links())}))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},keyValue:function(e){var t=this.json(e);return t.forEach((function(e){Object.keys(e).forEach((function(t){e[t]=e[t].text}))})),t},json:function(e){return e=p(e,st),ot(this.data,e)},text:function(){return""}};ut.keyvalue=ut.keyValue,ut.keyval=ut.keyValue,Object.keys(ut).forEach((function(e){ct.prototype[e]=ut[e]}));var lt=ct,pt=/^\s*{\|/,mt=/^\s*\|}/,dt=function(e){for(var t=[],i=e.wiki,n=i.split("\n"),a=[],r=0;r0&&(a[a.length-1]+="\n"+n[r]);else{a[a.length-1]+="\n"+n[r];var o=a.pop();t.push(o)}else a.push(n[r]);var s=[];t.forEach((function(e){if(e){i=(i=i.replace(e+"\n","")).replace(e,"");var t=rt(e);t&&t.length>0&&s.push(new lt(t))}})),s.length>0&&(e.tables=s),e.wiki=i},ft={sentences:!0},gt=function(e,t){var i={};return!0===(t=p(t,ft)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},ht={sentences:!0,lists:!0,images:!0},bt=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},kt={sentences:function(e){return"number"==typeof e?this.data.sentences[e]:this.data.sentences||[]},references:function(e){return"number"==typeof e?this.data.references[e]:this.data.references},lists:function(e){return"number"==typeof e?this.data.lists[e]:this.data.lists},images:function(e){return"number"==typeof e?this.data.images[e]:this.data.images||[]},links:function(e){var t=[];if(this.sentences().forEach((function(i){t=t.concat(i.links(e))})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t||[]},interwiki:function(e){var t=[];return this.sentences().forEach((function(e){t=t.concat(e.interwiki())})),"number"==typeof e?t[e]:t||[]},text:function(e){e=p(e,ht);var t=this.sentences().map((function(t){return t.text(e)})).join(" ");return this.lists().forEach((function(e){t+="\n"+e.text()})),t},json:function(e){return e=p(e,ht),gt(this,e)}};kt.citations=kt.references,Object.keys(kt).forEach((function(e){bt.prototype[e]=kt[e]}));var wt=bt;var vt=function(e){for(var t=[],i=[],n=e.split(""),a=0,r=0;r0){for(var s=0,c=0,u=0;uc&&i.push("]"),t.push(i.join("")),i=[]}}return t},yt=ze,xt=new RegExp("("+C.images.join("|")+"):","i"),$t="(".concat(C.images.join("|"),")"),jt=new RegExp($t+":(.+?)[\\||\\]]","iu"),zt={thumb:!0,thumbnail:!0,border:!0,right:!0,left:!0,center:!0,top:!0,bottom:!0,none:!0,upright:!0,baseline:!0,middle:!0,sub:!0,super:!0},Ot=function(e){var t=e.wiki;vt(t).forEach((function(i){if(!0===xt.test(i)){e.images=e.images||[];var n=function(e){var t=e.match(jt);if(null===t||!t[2])return null;var i="".concat(t[1],":").concat(t[2]||""),n=(i=i.trim()).charAt(0).toUpperCase()+i.substring(1);if(n=n.replace(/ /g,"_")){var a={file:i};e=(e=e.replace(/^\[\[/,"")).replace(/\]\]$/,"");var r=Te(e),o=r.list||[];return r.alt&&(a.alt=r.alt),(o=o.filter((function(e){return!1===zt.hasOwnProperty(e)})))[o.length-1]&&(a.caption=yt(o[o.length-1])),new z(a,e)}return null}(i);n&&e.images.push(n),t=t.replace(i,"")}})),e.wiki=t},Et={},_t=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},St={lines:function(){return this.data},links:function(e){var t=[];if(this.lines().forEach((function(e){t=t.concat(e.links())})),"number"==typeof e)return t[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var i=t.find((function(t){return t.page()===e}));return void 0===i?[]:[i]}return t},json:function(e){return e=p(e,Et),this.lines().map((function(t){return t.json(e)}))},text:function(){return function(e,t){return e.map((function(e){return" * "+e.text(t)})).join("\n")}(this.data)}};Object.keys(St).forEach((function(e){_t.prototype[e]=St[e]}));var Ct=_t,qt=ze,Nt=/^[#\*:;\|]+/,At=/^\*+[^:,\|]{4}/,Lt=/^ ?\#[^:,\|]{4}/,Dt=/[a-z_0-9\]\}]/i,It=function(e){return Nt.test(e)||At.test(e)||Lt.test(e)},Tt=function(e,t){for(var i=[],n=t;n0&&(i.push(r),a+=r.length-1)}else n.push(t[a]);e.lists=i.map((function(e){return new Ct(e)})),e.wiki=n.join("\n")}},Ut=function(e){var t=e.wiki,i=t.split(Rt);i=(i=i.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var t={wiki:e,lists:[],sentences:[],images:[]};return Mt.list(t),Mt.image(t),Pt(t),new wt(t)})),e.wiki=t,e.paragraphs=i},Ft=function(e,t){var i=Object.keys(e.data).reduce((function(t,i){return e.data[i]&&(t[i]=e.data[i].json()),t}),{});return!0===t.encode&&(i=Q(i)),i},Kt=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Bt=function(e){this._type=e.type,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Wt={type:function(){return this._type},links:function(e){var t=this,i=[];if(Object.keys(this.data).forEach((function(e){t.data[e].links().forEach((function(e){return i.push(e)}))})),"number"==typeof e)return i[e];if("string"==typeof e){e=e.charAt(0).toUpperCase()+e.substring(1);var n=i.find((function(t){return t.page()===e}));return void 0===n?[]:[n]}return i},image:function(){var e=this.get("image")||this.get("image2")||this.get("logo");if(!e)return null;var t=e.json();return t.file=t.text,t.text="",new z(t)},get:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=Kt(e);for(var t=Object.keys(this.data),i=0;i0?a++:a=e.indexOf("{",a+1)){var r=e[a];if("{"===r&&(t+=1),t>0){if("}"===r&&0===(t-=1)){n.push(r);var o=n.join("");n=[],/\{\{/.test(o)&&/\}\}/.test(o)&&i.push(o);continue}if(1===t&&"{"!==r&&"}"!==r){t=0,n=[];continue}n.push(r)}}return i},Gt=function(e){var t=null;return(t=/^\{\{[^\n]+\|/.test(e)?(e.match(/^\{\{(.+?)\|/)||[])[1]:-1!==e.indexOf("\n")?(e.match(/^\{\{(.+?)\n/)||[])[1]:(e.match(/^\{\{(.+?)\}\}$/)||[])[1])&&(t=t.replace(/:.*/,""),t=_e(t)),t||null},Ht=/\{\{/,Vt=function(e){return{body:e,name:Gt(e),children:[]}},Jt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Zt(i),t.children=t.children.map(Vt),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Ht.test(i)?e(t):null})),t},Qt=function(e){var t=Zt(e);return t=(t=t.map(Vt)).map(Jt)},Xt=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","navboxes","reflist","ref-list","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),ei=new RegExp("^(subst.)?("+C.infoboxes.join("|")+")[: \n]","i"),ti=/^infobox /i,ii=/ infobox$/i,ni=/$Year in [A-Z]/i,ai={"gnf protein box":!0,"automatic taxobox":!0,"chembox ":!0,editnotice:!0,geobox:!0,hybridbox:!0,ichnobox:!0,infraspeciesbox:!0,mycomorphbox:!0,oobox:!0,"paraphyletic group":!0,speciesbox:!0,subspeciesbox:!0,"starbox short":!0,taxobox:!0,nhlteamseason:!0,"asian games bid":!0,"canadian federal election results":!0,"dc thomson comic strip":!0,"daytona 24 races":!0,edencharacter:!0,"moldova national football team results":!0,samurai:!0,protein:!0,"sheet authority":!0,"order-of-approx":!0,"bacterial labs":!0,"medical resources":!0,ordination:!0,"hockey team coach":!0,"hockey team gm":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},ri=function(e){return!0===ai.hasOwnProperty(e)||(!!ei.test(e)||(!(!ti.test(e)&&!ii.test(e))||!!ni.test(e)))},oi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(ei),i=e.template;t&&t[0]&&(i=i.replace(t[0],""));var n={template:"infobox",type:i=i.trim(),data:e};return delete n.data.template,delete n.data.list,n},si=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],ci=si.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),ui=function(e){return e<10?"0"+e:String(e)},li=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===si.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(si[e.month]," ").concat(e.year);else{if(t="".concat(si[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(ui(e.hour),":").concat(ui(e.minute));void 0!==e.second&&(i=i+":"+ui(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},pi=function(e){for(var t={},i=["year","month","date","hour","minute","second"],n=0;n0&&(n.years=a,i-=31536e6*n.years);var r=Math.floor(i/2592e6,10);r>0&&(n.months=r,i-=2592e6*n.months);var o=Math.floor(i/864e5,10);return o>0&&(n.days=o),n},gi=pi,hi=li,bi=function(e){return{template:"date",data:e}},ki=function(e){var t=(e=Ee(e)).split("|"),i=gi(t.slice(1,4)),n=t.slice(4,7);if(0===n.length){var a=new Date;n=[a.getFullYear(),a.getMonth(),a.getDate()]}return{from:i,to:n=gi(n)}},wi={date:function(e,t){var i=Te(e,["year","month","date","hour","minute","second","timezone"]),n=gi([i.year,i.month,i.date||i.day]);return i.text=hi(n),i.timezone&&("Z"===i.timezone&&(i.timezone="UTC"),i.text+=" (".concat(i.timezone,")")),i.hour&&i.minute&&(i.second?i.text="".concat(i.hour,":").concat(i.minute,":").concat(i.second,", ")+i.text:i.text="".concat(i.hour,":").concat(i.minute,", ")+i.text),i.text&&t.push(bi(i)),i.text},natural_date:function(e,t){var i=Te(e,["text"]).text||"",n={};if(/^[0-9]{4}$/.test(i))n.year=parseInt(i,10);else{var a=i.replace(/[a-z]+\/[a-z]+/i,"");a=a.replace(/[0-9]+:[0-9]+(am|pm)?/i,"");var r=new Date(a);!1===isNaN(r.getTime())&&(n.year=r.getFullYear(),n.month=r.getMonth()+1,n.date=r.getDate())}return t.push(bi(n)),i.trim()},one_year:function(e,t){var i=Te(e,["year"]),n=Number(i.year);return t.push(bi({year:n})),String(n)},two_dates:function(e,t){var i=Te(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=gi([i.birth_year,i.birth_month,i.birth_date]);return t.push(bi(n)),hi(n)}var a=gi([i.death_year,i.death_month,i.death_date]);return t.push(bi(a)),hi(a)},age:function(e){var t=ki(e);return fi(t.from,t.to).years||0},"diff-y":function(e){var t=ki(e),i=fi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),n.join(", ")},"diff-ymd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),1===i.months?n.push("1 month"):i.months&&0!==i.months&&n.push(i.months+" months"),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-yd":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return 1===i.years?n.push(i.years+" year"):i.years&&0!==i.years&&n.push(i.years+" years"),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")},"diff-d":function(e){var t=ki(e),i=fi(t.from,t.to),n=[];return i.days+=365*(i.years||0),i.days+=30*(i.months||0),1===i.days?n.push("1 day"):i.days&&0!==i.days&&n.push(i.days+" days"),n.join(", ")}},vi=function(e){var t=new Date(e);if(isNaN(t.getTime()))return"";var i=(new Date).getTime()-t.getTime(),n="ago";i<0&&(n="from now",i=Math.abs(i));var a=i/1e3/60/60/24;return a<365?parseInt(a,10)+" days "+n:parseInt(a/365,10)+" years "+n},yi=wi.date,xi=wi.natural_date,$i=["January","February","March","April","May","June","July","August","September","October","November","December"],ji=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],zi=Object.assign({},mi,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return ji[e.getDay()]},currentmonth:function(){var e=new Date;return $i[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return $i[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),$i[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),$i[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Te(e,["date","fmt"]).date;return vi(t)},"birth date and age":function(e,t){var i=Te(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?xi(e,t):(t.push(i),i=pi([i.year,i.month,i.day]),li(i))},"birth year and age":function(e,t){var i=Te(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return xi(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=pi([i.birth_year,i.birth_month]);var a=li(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Te(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?xi(e,t):(t.push(i),i=pi([i.death_year,i.death_month]),li(i))},"birth date and age2":function(e,t){var i=Te(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=pi([i.birth_year,i.birth_month,i.birth_day]),li(i)},"birth based on age as of date":function(e,t){var i=Te(e,["age","year","month","day"]);t.push(i);var n=parseInt(i.age,10),a=parseInt(i.year,10)-n;return a&&n?"".concat(a," (age ").concat(i.age,")"):"(age ".concat(i.age,")")},"death date and given age":function(e,t){var i=Te(e,["year","month","day","age"]);t.push(i),i=pi([i.year,i.month,i.day]);var n=li(i);return i.age&&(n+=" (age ".concat(i.age,")")),n},dts:function(e){e=(e=e.replace(/\|format=[ymd]+/i,"")).replace(/\|abbr=(on|off)/i,"");var t=Te(e,["year","month","date","bc"]);return t.date&&t.month&&t.year?!0===/[a-z]/.test(t.month)?[t.month,t.date,t.year].join(" "):[t.year,t.month,t.date].join("-"):t.month&&t.year?[t.year,t.month].join("-"):t.year?(t.year<0&&(t.year=Math.abs(t.year)+" BC"),t.year):""},start:yi,end:yi,birth:yi,death:yi,"start date":yi,"end date":yi,"birth date":yi,"death date":yi,"start date and age":yi,"end date and age":yi,"start-date":xi,"end-date":xi,"birth-date":xi,"death-date":xi,"birth-date and age":xi,"birth-date and given age":xi,"death-date and age":xi,"death-date and given age":xi,birthdeathage:wi.two_dates,dob:yi,age:wi.age,"age nts":wi.age,"age in years":wi["diff-y"],"age in years and months":wi["diff-ym"],"age in years, months and days":wi["diff-ymd"],"age in years and days":wi["diff-yd"],"age in days":wi["diff-d"]});zi.localday=zi.currentday,zi.localdayname=zi.currentdayname,zi.localmonth=zi.currentmonth,zi.localyear=zi.currentyear,zi.currentmonthname=zi.currentmonth,zi.currentmonthabbrev=zi.currentmonth,zi["death date and age"]=zi["birth date and age"],zi.bda=zi["birth date and age"],zi["birth date based on age at death"]=zi["birth based on age as of date"];var Oi=zi,Ei={tag:function(e){var t=Te(e,["tag","open"]);return t.open&&"pair"!==t.open?"":{span:!0,div:!0,p:!0}[t.tag]?t.content||"":"<".concat(t.tag," ").concat(t.attribs||"",">").concat(t.content||"","")},plural:function(e){e=e.replace(/plural:/,"plural|");var t=Te(e,["num","word"]),i=Number(t.num),n=t.word;return 1!==i&&(/.y$/.test(n)?n=n.replace(/y$/,"ies"):n+="s"),i+" "+n},"first word":function(e){var t=Te(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Te(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Te(e,["str","start","end"]),i=parseInt(t.start,10)-1,n=parseInt(t.end,10);return t.str.substr(i,n)},p1:0,p2:1,p3:2,braces:function(e){var t=Te(e,["text"]),i="";return t.list&&(i="|"+t.list.join("|")),"{{"+(t.text||"")+i+"}}"},nobold:0,noitalic:0,nocaps:0,syntaxhighlight:function(e,t){var i=Te(e);return t.push(i),i.code||""},samp:function(e,t){var i=Te(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Te(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Te(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Te(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Te(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Te(e,["degrees","minutes","seconds"]),i=(t.degrees||0)+"°";return t.minutes&&(i+=t.minutes+"′"),t.seconds&&(i+=t.seconds+"″"),i},val:function(e){var t=Te(e,["number","uncertainty"]),i=t.number;i&&Number(i)&&(i=Number(i).toLocaleString());var n=i||"";return t.p&&(n=t.p+n),t.s&&(n=t.s+n),(t.u||t.ul||t.upl)&&(n=n+" "+(t.u||t.ul||t.upl)),n}};Ei.rndfrac=Ei.rnd,Ei.rndnear=Ei.rnd,Ei["unité"]=Ei.val;["nowrap","nobr","big","cquote","pull quote","small","smaller","midsize","larger","big","kbd","bigger","large","mono","strongbad","stronggood","huge","xt","xt2","!xt","xtn","xtd","dc","dcr","mxt","!mxt","mxtn","mxtd","bxt","!bxt","bxtn","bxtd","delink","pre","var","mvar","pre2","code"].forEach((function(e){Ei[e]=function(e){return Te(e,["text"]).text||""}}));var _i=Ei,Si={plainlist:function(e){var t=(e=Ee(e)).split("|");return e=(t=t.slice(1)).join("|"),(t=(t=e.split(/\n ?\* ?/)).filter((function(e){return e}))).join("\n\n")},"collapsible list":function(e,t){var i=Te(e);t.push(i);var n="";if(i.title&&(n+="'''".concat(i.title,"'''")+"\n\n"),!i.list){i.list=[];for(var a=1;a<10;a+=1)i[a]&&(i.list.push(i[a]),delete i[a])}return i.list=i.list.filter((function(e){return e})),n+=i.list.join("\n\n")},"ordered list":function(e,t){var i=Te(e);return t.push(i),i.list=i.list||[],i.list.map((function(e,t){return"".concat(t+1,". ").concat(e)})).join("\n\n")},hlist:function(e){var t=Te(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Te(e).list||[]).join(", ")},catlist:function(e){return(Te(e).list||[]).join(", ")},"br separated entries":function(e){return(Te(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Te(e).list||[]).join(", ")},"anchored list":function(e){var t=Te(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Te(e).list||[];return(t=(t=t.filter((function(e){return e}))).map((function(e){return"• "+e}))).join("\n\n")},"columns-list":function(e,t){var i=((Te(e).list||[])[0]||"").split(/\n/);return i=(i=i.filter((function(e){return e}))).map((function(e){return e.replace(/\*/,"")})),t.push({template:"columns-list",list:i}),(i=i.map((function(e){return"• "+e}))).join("\n\n")}};Si.flatlist=Si.plainlist,Si.ublist=Si.plainlist,Si["unbulleted list"]=Si["collapsible list"],Si.ubl=Si["collapsible list"],Si["bare anchored list"]=Si["anchored list"],Si["plain list"]=Si.plainlist,Si.cmn=Si["columns-list"],Si.collist=Si["columns-list"],Si["col-list"]=Si["columns-list"],Si.columnslist=Si["columns-list"];var Ci=Si,qi={convert:function(e){var t=Te(e,["num","two","three","four"]);return"-"===t.two||"to"===t.two||"and"===t.two?t.four?"".concat(t.num," ").concat(t.two," ").concat(t.three," ").concat(t.four):"".concat(t.num," ").concat(t.two," ").concat(t.three):"".concat(t.num," ").concat(t.two)},term:function(e){var t=Te(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Te(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Te(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Te(e,["a","b","c"]);return t.c?"".concat(t.a," ").concat(t.b,"/").concat(t.c):t.b?"".concat(t.a,"/").concat(t.b):"1/".concat(t.b)},height:function(e,t){var i=Te(e);t.push(i);var n=[];return["m","cm","ft","in"].forEach((function(e){!0===i.hasOwnProperty(e)&&n.push(i[e]+e)})),n.join(" ")},"block indent":function(e){var t=Te(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Te(e,["text","author"]);if(t.push(i),i.text){var n='"'.concat(i.text,'"');return i.author&&(n+="\n\n",n+=" - ".concat(i.author)),n+"\n"}return""},lbs:function(e){var t=Te(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Te(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Te(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Te(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Te(e,["one","two","three"]),n=(i.one||"")+(i.two||"");return"?"===i.one&&(n=(i.two||"")+(i.three||"")),t.push({template:"sic",word:n}),"y"===i.nolink?n:"".concat(n," [sic]")},formatnum:function(e){e=e.replace(/:/,"|");var t=Te(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Te(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Te(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Te(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Te(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Te(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Te(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Te(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Te(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Te(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};qi["str left"]=qi.trunc,qi["str crop"]=qi.trunc,qi.tooltip=qi.abbr,qi.abbrv=qi.abbr,qi.define=qi.abbr,qi.cvt=qi.convert;var Ni=qi,Ai=Object.assign({},_i,Ci,Ni);var Li=function(e){var t=e.pop(),i=Number(e[0]||0),n=Number(e[1]||0),a=Number(e[2]||0);if("string"!=typeof t||isNaN(i))return null;var r=1;return/[SW]/i.test(t)&&(r=-1),r*(i+n/60+a/3600)},Di=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ii={s:!0,w:!0},Ti=function(e){var i=Te(e);i=function(e){return e.list=e.list||[],e.list=e.list.map((function(t){var i=Number(t);if(!isNaN(i))return i;var n=t.split(/:/);return n.length>1?(e.props=e.props||{},e.props[n[0]]=n.slice(1).join(":"),null):t})),e.list=e.list.filter((function(e){return null!==e})),e}(i);var n,a,r=(n=i.list,a=n.map((function(e){return t(e)})).join("|"),2===n.length&&"number|number"===a?{lat:n[0],lon:n[1]}:4===n.length&&"number|string|number|string"===a?(Ii[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Li(n.slice(0,3)),lon:Li(n.slice(3))}:8===n.length?{lat:Li(n.slice(0,4)),lon:Li(n.slice(4))}:{});return i.lat=Di(r.lat),i.lon=Di(r.lon),i.template="coord",delete i.list,i},Pi={coord:function(e,t){var i=Ti(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Pi.coor=Pi.coord,Pi["coor title dms"]=Pi.coord,Pi["coor title dec"]=Pi.coord,Pi["coor dms"]=Pi.coord,Pi["coor dm"]=Pi.coord,Pi["coor dec"]=Pi.coord;var Ri=Pi,Mi={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Te(e,["first","last","target","sort"]),i="".concat(t.first||""," ").concat(t.last||"");return i=i.trim(),t.nolink?t.target||i:(t.dab&&(i+=" (".concat(t.dab,")"),t.target&&(t.target+=" (".concat(t.dab,")"))),t.target?"[[".concat(t.target,"|").concat(i,"]]"):"[[".concat(i,"]]"))}};["lts","t","tfd links","tiw","tltt","tetl","tsetl","ti","tic","tiw","tlt","ttl","twlh","tl2","tlu","demo","hatnote","xpd","para","elc","xtag","mli","mlix","#invoke","url"].forEach((function(e){Mi[e]=function(e){var t=Te(e,["first","second"]);return t.second||t.first}})),Mi.m=Mi.mention,Mi["m-self"]=Mi.mention,Mi.l=Mi.link,Mi.ll=Mi.link,Mi["l-self"]=Mi.link;var Ui=Mi,Fi={wikt:"wiktionary",commons:"commons",c:"commons",commonscat:"commonscat",n:"wikinews",q:"wikiquote",s:"wikisource",a:"wikiauthor",b:"wikibooks",voy:"wikivoyage",v:"wikiversity",d:"wikidata",species:"wikispecies",m:"meta",mw:"mediawiki"},Ki={about:function(e,t){var i=Te(e);return t.push(i),""},main:function(e,t){var i=Te(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Te(e,["redirect"]),n=i.list||[],a=[],r=0;r0&&t.push(a)}return{template:"playoffbracket",rounds:t}}(e);return t.push(i),""}};["2teambracket","4team2elimbracket","8teambracket","16teambracket","32teambracket","cwsbracket","nhlbracket","nhlbracket-reseed","4teambracket-nhl","4teambracket-ncaa","4teambracket-mma","4teambracket-mlb","8teambracket-nhl","8teambracket-mlb","8teambracket-ncaa","8teambracket-afc","8teambracket-afl","8teambracket-tennis3","8teambracket-tennis5","16teambracket-nhl","16teambracket-nhl divisional","16teambracket-nhl-reseed","16teambracket-nba","16teambracket-swtc","16teambracket-afc","16teambracket-tennis3","16teambracket-tennis5"].forEach((function(e){Ji[e]=Ji["4teambracket"]}));var Qi=Ji,Xi={"£":"GB£","¥":"¥","৳":"৳","₩":"₩","€":"€","₱":"₱","₹":"₹","₽":"₽","cn¥":"CN¥","gb£":"GB£","india rs":"₹","indian rupee symbol":"₹","indian rupee":"₹","indian rupees":"₹","philippine peso":"₱","russian ruble":"₽","SK won":"₩","turkish lira":"TRY",a$:"A$",au$:"A$",aud:"A$",bdt:"BDT",brl:"BRL",ca$:"CA$",cad:"CA$",chf:"CHF",cny:"CN¥",czk:"czk",dkk:"dkk",dkk2:"dkk",euro:"€",gbp:"GB£",hk$:"HK$",hkd:"HK$",ils:"ILS",inr:"₹",jpy:"¥",myr:"MYR",nis:"ILS",nok:"NOK",nok2:"NOK",nz$:"NZ$",nzd:"NZ$",peso:"peso",pkr:"₨",r$:"BRL",rmb:"CN¥",rub:"₽",ruble:"₽",rupee:"₹",s$:"sgd",sek:"SEK",sek2:"SEK",sfr:"CHF",sgd:"sgd",shekel:"ILS",sheqel:"ILS",ttd:"TTD",us$:"US$",usd:"US$",yen:"¥",zar:"R"},en=function(e,t){var i=Te(e,["amount","code"]);t.push(i);var n=i.template||"";switch("currency"===n?(n=i.code)||(i.code=n="usd"):""!==n&&"monnaie"!==n&&"unité"!==n&&"nombre"!==n&&"nb"!==n||(n=i.code),n=(n||"").toLowerCase()){case"us":i.code=n="usd";break;case"uk":i.code=n="gbp"}var a="".concat(Xi[n]||"").concat(i.amount||"");return i.code&&!Xi[i.code.toLowerCase()]&&(a+=" "+i.code),a},tn={currency:en,monnaie:en,"unité":en,nombre:en,nb:en,iso4217:en,inrconvert:function(e,t){var i=Te(e,["rupee_value","currency_formatting"]);t.push(i);var n=i.currency_formatting;if(n){var a=1;switch(n){case"k":a=1e3;break;case"m":a=1e6;break;case"b":a=1e9;break;case"t":a=1e12;break;case"l":a=1e5;break;case"c":a=1e7;break;case"lc":a=1e12}i.rupee_value=i.rupee_value*a}return"inr ".concat(i.rupee_value||"")}};Object.keys(Xi).forEach((function(e){tn[e]=en}));var nn=tn,an={"election box begin":function(e,t){var i=Te(e);return t.push(i),""},"election box candidate":function(e,t){var i=Te(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Te(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Te(e);return t.push(i),""}};an["election box begin no change"]=an["election box begin"],an["election box begin no party"]=an["election box begin"],an["election box begin no party no change"]=an["election box begin"],an["election box inline begin"]=an["election box begin"],an["election box inline begin no change"]=an["election box begin"],an["election box candidate for alliance"]=an["election box candidate"],an["election box candidate minor party"]=an["election box candidate"],an["election box candidate no party link no change"]=an["election box candidate"],an["election box candidate with party link"]=an["election box candidate"],an["election box candidate with party link coalition 1918"]=an["election box candidate"],an["election box candidate with party link no change"]=an["election box candidate"],an["election box inline candidate"]=an["election box candidate"],an["election box inline candidate no change"]=an["election box candidate"],an["election box inline candidate with party link"]=an["election box candidate"],an["election box inline candidate with party link no change"]=an["election box candidate"],an["election box inline incumbent"]=an["election box candidate"];var rn=an,on=[["🇦🇩","and","andorra"],["🇦🇪","are","united arab emirates"],["🇦🇫","afg","afghanistan"],["🇦🇬","atg","antigua and barbuda"],["🇦🇮","aia","anguilla"],["🇦🇱","alb","albania"],["🇦🇲","arm","armenia"],["🇦🇴","ago","angola"],["🇦🇶","ata","antarctica"],["🇦🇷","arg","argentina"],["🇦🇸","asm","american samoa"],["🇦🇹","aut","austria"],["🇦🇺","aus","australia"],["🇦🇼","abw","aruba"],["🇦🇽","ala","åland islands"],["🇦🇿","aze","azerbaijan"],["🇧🇦","bih","bosnia and herzegovina"],["🇧🇧","brb","barbados"],["🇧🇩","bgd","bangladesh"],["🇧🇪","bel","belgium"],["🇧🇫","bfa","burkina faso"],["🇧🇬","bgr","bulgaria"],["🇧🇬","bul","bulgaria"],["🇧🇭","bhr","bahrain"],["🇧🇮","bdi","burundi"],["🇧🇯","ben","benin"],["🇧🇱","blm","saint barthélemy"],["🇧🇲","bmu","bermuda"],["🇧🇳","brn","brunei darussalam"],["🇧🇴","bol","bolivia"],["🇧🇶","bes","bonaire, sint eustatius and saba"],["🇧🇷","bra","brazil"],["🇧🇸","bhs","bahamas"],["🇧🇹","btn","bhutan"],["🇧🇻","bvt","bouvet island"],["🇧🇼","bwa","botswana"],["🇧🇾","blr","belarus"],["🇧🇿","blz","belize"],["🇨🇦","can","canada"],["🇨🇨","cck","cocos (keeling) islands"],["🇨🇩","cod","congo"],["🇨🇫","caf","central african republic"],["🇨🇬","cog","congo"],["🇨🇭","che","switzerland"],["🇨🇮","civ","côte d'ivoire"],["🇨🇰","cok","cook islands"],["🇨🇱","chl","chile"],["🇨🇲","cmr","cameroon"],["🇨🇳","chn","china"],["🇨🇴","col","colombia"],["🇨🇷","cri","costa rica"],["🇨🇺","cub","cuba"],["🇨🇻","cpv","cape verde"],["🇨🇼","cuw","curaçao"],["🇨🇽","cxr","christmas island"],["🇨🇾","cyp","cyprus"],["🇨🇿","cze","czech republic"],["🇩🇪","deu","germany"],["🇩🇪","ger","germany"],["🇩🇯","dji","djibouti"],["🇩🇰","dnk","denmark"],["🇩🇲","dma","dominica"],["🇩🇴","dom","dominican republic"],["🇩🇿","dza","algeria"],["🇪🇨","ecu","ecuador"],["🇪🇪","est","estonia"],["🇪🇬","egy","egypt"],["🇪🇭","esh","western sahara"],["🇪🇷","eri","eritrea"],["🇪🇸","esp","spain"],["🇪🇹","eth","ethiopia"],["🇫🇮","fin","finland"],["🇫🇯","fji","fiji"],["🇫🇰","flk","falkland islands (malvinas)"],["🇫🇲","fsm","micronesia"],["🇫🇴","fro","faroe islands"],["🇫🇷","fra","france"],["🇬🇦","gab","gabon"],["🇬🇧","gbr","united kingdom"],["🇬🇩","grd","grenada"],["🇬🇫","guf","french guiana"],["🇬🇬","ggy","guernsey"],["🇬🇭","gha","ghana"],["🇬🇮","gib","gibraltar"],["🇬🇱","grl","greenland"],["🇬🇲","gmb","gambia"],["🇬🇳","gin","guinea"],["🇬🇵","glp","guadeloupe"],["🇬🇶","gnq","equatorial guinea"],["🇬🇷","grc","greece"],["🇬🇸","sgs","south georgia"],["🇬🇹","gtm","guatemala"],["🇬🇺","gum","guam"],["🇬🇼","gnb","guinea-bissau"],["🇬🇾","guy","guyana"],["🇭🇰","hkg","hong kong"],["🇭🇲","hmd","heard island and mcdonald islands"],["🇭🇳","hnd","honduras"],["🇭🇷","hrv","croatia"],["🇭🇹","hti","haiti"],["🇭🇺","hun","hungary"],["🇮🇩","idn","indonesia"],["🇮🇪","irl","ireland"],["🇮🇱","isr","israel"],["🇮🇲","imn","isle of man"],["🇮🇳","ind","india"],["🇮🇴","iot","british indian ocean territory"],["🇮🇶","irq","iraq"],["🇮🇷","irn","iran"],["🇮🇸","isl","iceland"],["🇮🇹","ita","italy"],["🇯🇪","jey","jersey"],["🇯🇲","jam","jamaica"],["🇯🇴","jor","jordan"],["🇯🇵","jpn","japan"],["🇰🇪","ken","kenya"],["🇰🇬","kgz","kyrgyzstan"],["🇰🇭","khm","cambodia"],["🇰🇮","kir","kiribati"],["🇰🇲","com","comoros"],["🇰🇳","kna","saint kitts and nevis"],["🇰🇵","prk","north korea"],["🇰🇷","kor","south korea"],["🇰🇼","kwt","kuwait"],["🇰🇾","cym","cayman islands"],["🇰🇿","kaz","kazakhstan"],["🇱🇦","lao","lao people's democratic republic"],["🇱🇧","lbn","lebanon"],["🇱🇨","lca","saint lucia"],["🇱🇮","lie","liechtenstein"],["🇱🇰","lka","sri lanka"],["🇱🇷","lbr","liberia"],["🇱🇸","lso","lesotho"],["🇱🇹","ltu","lithuania"],["🇱🇺","lux","luxembourg"],["🇱🇻","lva","latvia"],["🇱🇾","lby","libya"],["🇲🇦","mar","morocco"],["🇲🇨","mco","monaco"],["🇲🇩","mda","moldova"],["🇲🇪","mne","montenegro"],["🇲🇫","maf","saint martin (french part)"],["🇲🇬","mdg","madagascar"],["🇲🇭","mhl","marshall islands"],["🇲🇰","mkd","macedonia"],["🇲🇱","mli","mali"],["🇲🇲","mmr","myanmar"],["🇲🇳","mng","mongolia"],["🇲🇴","mac","macao"],["🇲🇵","mnp","northern mariana islands"],["🇲🇶","mtq","martinique"],["🇲🇷","mrt","mauritania"],["🇲🇸","msr","montserrat"],["🇲🇹","mlt","malta"],["🇲🇺","mus","mauritius"],["🇲🇻","mdv","maldives"],["🇲🇼","mwi","malawi"],["🇲🇽","mex","mexico"],["🇲🇾","mys","malaysia"],["🇲🇿","moz","mozambique"],["🇳🇦","nam","namibia"],["🇳🇨","ncl","new caledonia"],["🇳🇪","ner","niger"],["🇳🇫","nfk","norfolk island"],["🇳🇬","nga","nigeria"],["🇳🇮","nic","nicaragua"],["🇳🇱","nld","netherlands"],["🇳🇴","nor","norway"],["🇳🇵","npl","nepal"],["🇳🇷","nru","nauru"],["🇳🇺","niu","niue"],["🇳🇿","nzl","new zealand"],["🇴🇲","omn","oman"],["🇵🇦","pan","panama"],["🇵🇪","per","peru"],["🇵🇫","pyf","french polynesia"],["🇵🇬","png","papua new guinea"],["🇵🇭","phl","philippines"],["🇵🇰","pak","pakistan"],["🇵🇱","pol","poland"],["🇵🇲","spm","saint pierre and miquelon"],["🇵🇳","pcn","pitcairn"],["🇵🇷","pri","puerto rico"],["🇵🇸","pse","palestinian territory"],["🇵🇹","prt","portugal"],["🇵🇼","plw","palau"],["🇵🇾","pry","paraguay"],["🇶🇦","qat","qatar"],["🇷🇪","reu","réunion"],["🇷🇴","rou","romania"],["🇷🇸","srb","serbia"],["🇷🇺","rus","russia"],["🇷🇼","rwa","rwanda"],["🇸🇦","sau","saudi arabia"],["🇸🇧","slb","solomon islands"],["🇸🇨","syc","seychelles"],["🇸🇩","sdn","sudan"],["🇸🇪","swe","sweden"],["🇸🇬","sgp","singapore"],["🇸🇭","shn","saint helena, ascension and tristan da cunha"],["🇸🇮","svn","slovenia"],["🇸🇯","sjm","svalbard and jan mayen"],["🇸🇰","svk","slovakia"],["🇸🇱","sle","sierra leone"],["🇸🇲","smr","san marino"],["🇸🇳","sen","senegal"],["🇸🇴","som","somalia"],["🇸🇷","sur","suriname"],["🇸🇸","ssd","south sudan"],["🇸🇹","stp","sao tome and principe"],["🇸🇻","slv","el salvador"],["🇸🇽","sxm","sint maarten (dutch part)"],["🇸🇾","syr","syrian arab republic"],["🇸🇿","swz","swaziland"],["🇹🇨","tca","turks and caicos islands"],["🇹🇩","tcd","chad"],["🇹🇫","atf","french southern territories"],["🇹🇬","tgo","togo"],["🇹🇭","tha","thailand"],["🇹🇯","tjk","tajikistan"],["🇹🇰","tkl","tokelau"],["🇹🇱","tls","timor-leste"],["🇹🇲","tkm","turkmenistan"],["🇹🇳","tun","tunisia"],["🇹🇴","ton","tonga"],["🇹🇷","tur","turkey"],["🇹🇹","tto","trinidad and tobago"],["🇹🇻","tuv","tuvalu"],["🇹🇼","twn","taiwan"],["🇹🇿","tza","tanzania"],["🇺🇦","ukr","ukraine"],["🇺🇬","uga","uganda"],["🇺🇲","umi","united states minor outlying islands"],["🇺🇸","usa","united states"],["🇺🇸","us","united states"],["🇺🇾","ury","uruguay"],["🇺🇿","uzb","uzbekistan"],["🇻🇦","vat","vatican city"],["🇻🇨","vct","saint vincent and the grenadines"],["🇻🇪","ven","venezuela"],["🇻🇬","vgb","virgin islands, british"],["🇻🇮","vir","virgin islands, u.s."],["🇻🇳","vnm","viet nam"],["🇻🇺","vut","vanuatu"],["","win","west indies"],["🇼🇫","wlf","wallis and futuna"],["🇼🇸","wsm","samoa"],["🇾🇪","yem","yemen"],["🇾🇹","myt","mayotte"],["🇿🇦","zaf","south africa"],["🇿🇲","zmb","zambia"],["🇿🇼 ","zwe","zimbabwe"],["🇺🇳","un","united nations"],["🏴󠁧󠁢󠁥󠁮󠁧󠁿󠁧󠁢󠁥󠁮󠁧󠁿","eng","england"],["🏴󠁧󠁢󠁳󠁣󠁴󠁿","sct","scotland"],["🏴󠁧󠁢󠁷󠁬󠁳󠁿","wal","wales"],["🇪🇺","eu","european union"]],sn={flag:function(e){var t=Te(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],a=n[0]||"";return"".concat(a," [[").concat(n[2],"|").concat(i,"]]")},flagcountry:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," [[").concat(i[2],"]]")},flagcu:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[],n=i[0]||"";return"".concat(n," ").concat(i[2])},flagicon:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"[[".concat(i[2],"|").concat(i[0],"]]"):""},flagdeco:function(e){var t=Te(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(on.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(i[2]," national football team|").concat(i[2],"]]"):""},fbicon:function(e){var t=Te(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?" [[".concat(i[2]," national football team|").concat(i[0],"]]"):""},flagathlete:function(e){var t=Te(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=on.find((function(e){return t.flag===e[1]||t.flag===e[2]}));return i?"".concat(i[0]," [[").concat(t.name||"","]] (").concat(i[1].toUpperCase(),")"):"[[".concat(t.name||"","]]")}};on.forEach((function(e){sn[e[1]]=function(){return e[0]}})),sn.cr=sn.flagcountry,sn["cr-rt"]=sn.flagcountry,sn.cricon=sn.flagicon;var cn=sn,un=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===q.hasOwnProperty(t[1])?q[t[1]].english_title:t[1]:null},ln={ipa:function(e,t){var i=Te(e,["transcription","lang","audio"]);return i.lang=un(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Te(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=un(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Te(e,["lang","text","text2"]);return i.text2&&(i.iso=i.text,i.text=i.text2,delete i.text2),t.push(i),i.text||""}};Object.keys(q).forEach((function(e){ln["ipa-"+e]=ln.ipa,ln["ipac-"+e]=ln.ipac}));var pn=ln,mn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Te(e,["english","kanji","romaji","extra"]);t.push(i);var n=i.english||i.romaji||"";return i.kanji&&(n+=" (".concat(i.kanji,")")),n}};Object.keys(q).forEach((function(e){mn["lang-"+e]=mn["lang-de"]})),mn.nihongo2=mn.nihongo,mn.nihongo3=mn.nihongo,mn["nihongo-s"]=mn.nihongo,mn["nihongo foot"]=mn.nihongo;var dn=mn,fn=function(e){if(!e.numerator&&!e.denominator)return null;var t=Number(e.numerator)/Number(e.denominator);t*=100;var i=Number(e.decimals);return isNaN(i)&&(i=1),t=t.toFixed(i),Number(t)},gn={math:function(e,t){var i=Te(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Te(e,["a","b","c"]),n={template:"sfrac"};return i.c?(n.integer=i.a,n.numerator=i.b,n.denominator=i.c):i.b?(n.numerator=i.a,n.denominator=i.b):(n.numerator=1,n.denominator=i.a),t.push(n),n.integer?"".concat(n.integer," ").concat(n.numerator,"⁄").concat(n.denominator):"".concat(n.numerator,"⁄").concat(n.denominator)},radic:function(e){var t=Te(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Te(e,["numerator","denominator","decimals"]),i=fn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Te(e,["done","total","digits"]),i=fn({numerator:t.done,denominator:t.total,decimals:t.digits});return null===i?"":"".concat(t.done," (").concat(i,"%) done")},"winning percentage":function(e,t){var i=Te(e,["wins","losses","ties"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=Number(i.ties)||0,o=n+a+r;"y"===i.ignore_ties&&(r=0),r&&(n+=r/2);var s=fn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Te(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=fn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};gn.sfrac=gn.frac,gn.sqrt=gn.radic,gn.pct=gn.percentage,gn.percent=gn.percentage,gn.winpct=gn["winning percentage"],gn.winperc=gn["winning percentage"];var hn=gn,bn=function(e,t,i){var n=Te(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},kn={persondata:bn,taxobox:bn,citation:bn,portal:bn,reflist:bn,"cite book":bn,"cite journal":bn,"cite web":bn,"commons cat":bn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Te(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Te(e,["spouse","from","to","end"]);t.push(i);var n="".concat(i.spouse||"");return i.from&&(i.to?n+=" (m. ".concat(i.from,"-").concat(i.to,")"):n+=" (m. ".concat(i.from,")")),n},"based on":function(e,t){var i=Te(e,["title","author"]);return t.push(i),"".concat(i.title," by ").concat(i.author||"")},"video game release":function(e,t){for(var i=["region","date","region2","date2","region3","date3","region4","date4"],n=Te(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Bn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Wn={text:function(){return""},json:function(){return this.data}};Object.keys(Wn).forEach((function(e){Bn.prototype[e]=Wn[e]}));var Yn=Bn,Zn=new RegExp("^(cite |citation)","i"),Gn={citation:!0,refn:!0,harvnb:!0},Hn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Vn=function(e){var t=e.wiki,i=Qt(t),n=[];i.forEach((function(e){return function e(i,a){i.parent=a,i.children&&i.children.length>0&&i.children.forEach((function(t){return e(t,i)})),i.out=Kn(i,n);!function e(t,i,n){t.parent&&(t.parent.body=t.parent.body.replace(i,n),e(t.parent,i,n))}(i,i.body,i.out),t=t.replace(i.body,i.out)}(e,null)})),e.infoboxes=e.infoboxes||[],e.references=e.references||[],e.templates=e.templates||[],e.templates=e.templates.concat(n),e.templates=e.templates.filter((function(t){return!0===function(e){return!0===Gn[e.template]||!0===Zn.test(e.template)}(t)?(e.references.push(new Me(t)),!1):!0!==Hn(t)||(e.infoboxes.push(new Yt(t)),!1)})),e.templates=e.templates.map((function(e){return new Yn(e)})),i.forEach((function(e){t=t.replace(e.body,e.out)})),e.wiki=t},Jn=ze,Qn=function(e){var t=e.wiki;t=t.replace(/]*?)>([\s\S]+?)<\/gallery>/g,(function(t,i,n){var a=n.split(/\n/g);return(a=(a=a.filter((function(e){return e&&""!==e.trim()}))).map((function(e){var t=e.split(/\|/),i={file:t[0].trim()},n=new z(i).json(),a=t.slice(1).join("|");return""!==a&&(n.caption=Jn(a)),n}))).length>0&&e.templates.push({template:"gallery",images:a,pos:e.title}),""})),e.wiki=t},Xn=function(e){var t=e.wiki;t=t.replace(/\{\{election box begin([\s\S]+?)\{\{election box end\}\}/gi,(function(t){var i={wiki:t,templates:[]};Vn(i);var n=i.templates.map((function(e){return e.json()})),a=n.find((function(e){return"election box"===e.template}))||{},r=n.filter((function(e){return"election box candidate"===e.template})),o=n.find((function(e){return"election box gain"===e.template||"election box hold"===e.template}))||{};return(r.length>0||o)&&e.templates.push({template:"election box",title:a.title,candidates:r,summary:o.data}),""})),e.wiki=t},ea={coach:["team","year","g","w","l","w-l%","finish","pg","pw","pl","pw-l%"],player:["year","team","gp","gs","mpg","fg%","3p%","ft%","rpg","apg","spg","bpg","ppg"],roster:["player","gp","gs","mpg","fg%","3fg%","ft%","rpg","apg","spg","bpg","ppg"]},ta=function(e){var t=e.wiki;t=t.replace(/\{\{nba (coach|player|roster) statistics start([\s\S]+?)\{\{s-end\}\}/gi,(function(t,i){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{s-end\}\}/,""),i=i.toLowerCase().trim();var n="! "+ea[i].join(" !! "),a=rt("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"NBA "+i+" statistics",data:a}),""})),e.wiki=t},ia=function(e){var t=e.wiki;t=t.replace(/\{\{mlb game log (section|month)[\s\S]+?\{\{mlb game log (section|month) end\}\}/gi,(function(t){var i=function(e){var t=["#","date","opponent","score","win","loss","save","attendance","record"];return!0===/\|stadium=y/i.test(e)&&t.splice(7,0,"stadium"),!0===/\|time=y/i.test(e)&&t.splice(7,0,"time"),!0===/\|box=y/i.test(e)&&t.push("box"),t}(t);t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{mlb game log (section|month) end\}\}/i,"");var n="! "+i.join(" !! "),a=rt("{|\n"+n+"\n"+t+"\n|}");return a=a.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mlb game log section",data:a}),""})),e.wiki=t},na=["res","record","opponent","method","event","date","round","time","location","notes"],aa=function(e){var t=e.wiki;t=t.replace(/\{\{mma record start[\s\S]+?\{\{end\}\}/gi,(function(t){t=(t=t.replace(/^\{\{.*?\}\}/,"")).replace(/\{\{end\}\}/i,"");var i="! "+na.join(" !! "),n=rt("{|\n"+i+"\n"+t+"\n|}");return n=n.map((function(e){return Object.keys(e).forEach((function(t){e[t]=e[t].text()})),e})),e.templates.push({template:"mma record start",data:n}),""})),e.wiki=t},ra=ze,oa=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=ra(n).text();return e.templates.push({template:"math",formula:a,raw:n}),a&&a.length<12?a:""}))).replace(/]*?)>([\s\S]+?)<\/chem>/g,(function(t,i,n){return e.templates.push({template:"chem",data:n}),""})),e.wiki=t},sa=function(e){Xn(e),Qn(e),oa(e),ia(e),aa(e),ta(e)},ca=new RegExp("^("+C.references.join("|")+"):?","i"),ua=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,la={heading:Ge,table:dt,paragraphs:Ut,templates:Vn,references:We,startEndTemplates:sa},pa=function(e,t){return la.startEndTemplates(e),la.references(e),la.templates(e),la.table(e),la.paragraphs(e,t),e=new ae(e)},ma=function(e){for(var t=[],i=e.wiki.split(ua),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},da=new RegExp("\\[\\[:?("+C.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),fa=new RegExp("^\\[\\[:?("+C.categories.join("|")+"):","ig"),ga={section:ma,categories:function(e){var t=e.wiki,i=t.match(da);i&&i.forEach((function(t){(t=(t=(t=t.replace(fa,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(da,""),e.wiki=t}},ha=function(e,t){t=t||{};var i=Object.assign(t,{title:t.title||null,pageID:t.pageID||t.id||null,namespace:t.namespace||t.ns||null,type:"page",wiki:e||"",categories:[],sections:[],coordinates:[]});return!0===F(e)?(i.type="redirect",i.redirectTo=K(e),ga.categories(i),new S(i)):(H(i),ga.categories(i),ga.section(i),new S(i))},ba=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return ha(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},ka=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},wa=function(e){var t=e.userAgent||e["User-Agent"]||e["Api-User-Agent"]||"User of the wtf_wikipedia library";return{method:"GET",headers:{"Content-Type":"application/json","Api-User-Agent":t,"User-Agent":t,Origin:"*"},redirect:"follow"}},va=/^https?:\/\//,ya={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},xa=function(t,i,n){var a=null;"function"==typeof i&&(a=i,i={}),"function"==typeof n&&(a=n,n={}),"string"==typeof i&&(n=n||{},i=Object.assign({},{lang:i},n)),i=i||{},(i=Object.assign({},ya,i)).title=t,va.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=wa(i);return ka(r,o).then((function(e){try{var t=u(e,i);return t=ba(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},$a={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},ja=function(e,t){var i;t=t||{},t=Object.assign({},$a,t),"string"==typeof e?t.lang=e:(i=e)&&"[object Object]"===Object.prototype.toString.call(i)&&(t=Object.assign(t,e));var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="format=json&action=query&generator=random&grnnamespace=0&prop=revisions&rvprop=content&grnlimit=1&rvslots=main&origin=*";var a=wa(t);return ka(n,a).then((function(e){try{var t=u(e);return ba(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},za={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Oa=function(e,t,i){var n;i=i||{},i=Object.assign({},za,i),"string"==typeof t?i.lang=t:(n=t)&&"[object Object]"===Object.prototype.toString.call(n)&&(i=Object.assign(i,t));var a={pages:[],categories:[]};return new Promise((function(t,n){!function r(o){var s=function(e,t,i){e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!1===/^Category/i.test(e)&&(e="Category:"+e),e=e.replace(/ /g,"_")}(e),e=encodeURIComponent(e);var n="https://".concat(t.lang,".wikipedia.org/").concat(t.path,"?");return t.domain&&(n="https://".concat(t.domain,"/").concat(t.path,"?")),n+="action=query&list=categorymembers&cmtitle=".concat(e,"&cmlimit=500&format=json&origin=*&redirects=true&cmtype=page|subcat"),i&&(n+="&cmcontinue="+i),n}(e,i,o),c=wa(i);return ka(s,c).then((function(e){a=function(e){var t=e.query.categorymembers||[],i={pages:[],categories:[]};return t.forEach((function(e){14===e.ns?(delete e.ns,i.categories.push(e)):(delete e.ns,i.pages.push(e))})),i}(e),e.continue&&e.continue.cmcontinue?r(e.continue.cmcontinue):t(a)})).catch((function(e){console.error(e),n(e)}))}(null)}))},Ea=function(e,t){return ha(e,t)},_a={Doc:S,Section:ae,Paragraph:wt,Sentence:be,Image:z,Infobox:Yt,Link:ue,List:Ct,Reference:Me,Table:lt,Template:Yn,wtf:Ea};Ea.fetch=function(e,t,i,n){return xa(e,t,i)},Ea.random=function(e,t,i){return ja(e,t)},Ea.category=function(e,t,i,n){return Oa(e,t,i)},Ea.extend=function(e){return e(_a,Mn,this),this},Ea.version="8.1.1";var Sa=Ea;export default Sa; diff --git a/builds/wtf_wikipedia.js b/builds/wtf_wikipedia.js index 6cffcc6e..f721796d 100644 --- a/builds/wtf_wikipedia.js +++ b/builds/wtf_wikipedia.js @@ -1,4 +1,4 @@ -/* wtf_wikipedia 8.1.0 MIT */ +/* wtf_wikipedia 8.1.1 MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('https')) : typeof define === 'function' && define.amd ? define(['https'], factory) : @@ -3893,6 +3893,7 @@ }; var skipSpanRow = function skipSpanRow(row) { + row = row || []; var len = row.length; var hasTxt = row.filter(function (str) { return str; @@ -3998,7 +3999,15 @@ .split(/\n/).map(function (l) { return l.trim(); }); - var rows = _findRows(lines); //remove non-header span rows + var rows = _findRows(lines); + rows = rows.filter(function (r) { + return r; + }); + + if (rows.length === 0) { + return []; + } //remove non-header span rows + rows = removeMidSpans(rows); //support colspan, rowspan... @@ -8797,7 +8806,7 @@ var category = fetchCategory; - var _version = '8.1.0'; + var _version = '8.1.1'; var wtf = function wtf(wiki, options) { return _01Document(wiki, options); diff --git a/builds/wtf_wikipedia.mjs b/builds/wtf_wikipedia.mjs index f447101e..4348cd81 100644 --- a/builds/wtf_wikipedia.mjs +++ b/builds/wtf_wikipedia.mjs @@ -1,4 +1,4 @@ -/* wtf_wikipedia 8.1.0 MIT */ +/* wtf_wikipedia 8.1.1 MIT */ import https from 'https'; var parseUrl = function parseUrl(url) { @@ -3887,6 +3887,7 @@ var cleanText = function cleanText(str) { }; var skipSpanRow = function skipSpanRow(row) { + row = row || []; var len = row.length; var hasTxt = row.filter(function (str) { return str; @@ -3992,7 +3993,15 @@ var parseTable = function parseTable(wiki) { .split(/\n/).map(function (l) { return l.trim(); }); - var rows = _findRows(lines); //remove non-header span rows + var rows = _findRows(lines); + rows = rows.filter(function (r) { + return r; + }); + + if (rows.length === 0) { + return []; + } //remove non-header span rows + rows = removeMidSpans(rows); //support colspan, rowspan... @@ -8791,7 +8800,7 @@ var fetchCategory = function fetchCategory(category, lang, options) { var category = fetchCategory; -var _version = '8.1.0'; +var _version = '8.1.1'; var wtf = function wtf(wiki, options) { return _01Document(wiki, options); diff --git a/package.json b/package.json index 867d1810..51f6036b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wtf_wikipedia", "description": "parse wikiscript into json", - "version": "8.1.0", + "version": "8.1.1", "author": "Spencer Kelly (http://spencermounta.in)", "repository": { "type": "git", diff --git a/plugins/classify/src/byInfobox/infoboxes.js b/plugins/classify/src/byInfobox/infoboxes.js index a15ac29a..a5e02725 100644 --- a/plugins/classify/src/byInfobox/infoboxes.js +++ b/plugins/classify/src/byInfobox/infoboxes.js @@ -246,7 +246,7 @@ module.exports = { nfl_single_game: 'Event/SportsEvent', //1 nobility: 'Organization', //5 non_test_cricket_team: 'Organization/SportsTeam', //4 - 'non-profit': 'SportsTeam', //6 + 'non-profit': 'Organization/SportsTeam', //6 nrhp: '', //144 nycs: '', //7 officeholder: 'Person', //133 diff --git a/plugins/classify/src/index.js b/plugins/classify/src/index.js index 02f28c9f..28c0ac21 100644 --- a/plugins/classify/src/index.js +++ b/plugins/classify/src/index.js @@ -14,7 +14,7 @@ const plugin = function(models) { // dont classify these if (skipPage(doc, options)) { - return null + return score(res, options) } //look for 'infobox person', etc diff --git a/plugins/classify/src/score.js b/plugins/classify/src/score.js index b07d75e5..951f92bd 100644 --- a/plugins/classify/src/score.js +++ b/plugins/classify/src/score.js @@ -63,11 +63,10 @@ const getScore = function(detail) { score *= 0.8 } } - return { root: root, category: category, - score: score, + score: Math.ceil(score), detail: detail } } diff --git a/scratch.js b/scratch.js index 74e06fd5..4e5c024a 100644 --- a/scratch.js +++ b/scratch.js @@ -5,9 +5,10 @@ wtf.extend(require('./plugins/i18n/src')) wtf.extend(require('./plugins/summary/src')) wtf.extend(require('./plugins/category/src')) -// wtf.fetch('Toronto').then(doc => { -// let html = doc.html() -// console.log(html) +// wtf.fetch('Croatian language').then(doc => { +// console.log(doc.tables().map(t => t.json())) +// // let html = doc.html() +// // console.log(html) // }) // wtf.fetchCategory('Larchmont, New York').then(res => { @@ -28,3 +29,7 @@ wtf.extend(require('./plugins/category/src')) // let doc = wtf(txt) // let res = doc.classify() // console.log(res) +let str = ` +` +let doc = wtf(str) +console.log(doc.table()) diff --git a/src/_version.js b/src/_version.js index 7301a4a2..108c1c18 100644 --- a/src/_version.js +++ b/src/_version.js @@ -1 +1 @@ -module.exports = '8.1.0' \ No newline at end of file +module.exports = '8.1.1' \ No newline at end of file diff --git a/src/table/parse/index.js b/src/table/parse/index.js index c291a1e3..e94adb1d 100644 --- a/src/table/parse/index.js +++ b/src/table/parse/index.js @@ -32,6 +32,7 @@ const cleanText = function(str) { } const skipSpanRow = function(row) { + row = row || [] let len = row.length let hasTxt = row.filter(str => str).length //does it have 3 empty spaces? @@ -127,6 +128,10 @@ const parseTable = function(wiki) { .split(/\n/) .map(l => l.trim()) let rows = findRows(lines) + rows = rows.filter(r => r) + if (rows.length === 0) { + return [] + } //remove non-header span rows rows = removeMidSpans(rows)