From 68ccfdea0941d1c0a414694681e5b476f9e0dfb9 Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Wed, 22 Apr 2020 09:49:13 -0400 Subject: [PATCH 1/5] fix for #260 --- scratch.js | 8 +++- src/01-document/Document.js | 92 ++++++++++++++++++------------------- 2 files changed, 52 insertions(+), 48 deletions(-) diff --git a/scratch.js b/scratch.js index bd45d797..374f0809 100644 --- a/scratch.js +++ b/scratch.js @@ -2,5 +2,9 @@ var wtf = require('./src/index') wtf.extend(require('./plugins/wikitext/src')) // wtf.extend(require('./plugins/i18n/src')) -var str = `[[Image:Levellers declaration and standard.gif|thumb|Woodcut from a [[Diggers]] document by [[William Everard (Digger)|William Everard]]]]` -console.log(wtf(str).json()) +// var str = `[[Image:Levellers declaration and standard.gif|thumb|Woodcut from a [[Diggers]] document by [[William Everard (Digger)|William Everard]]]]` +// console.log(wtf(str).json()) +;(async () => { + const doc = await wtf.fetch('Nuclear Waste Technical Review Board') + console.log(doc.url()) +})() diff --git a/src/01-document/Document.js b/src/01-document/Document.js index 10925753..3eb54c58 100644 --- a/src/01-document/Document.js +++ b/src/01-document/Document.js @@ -7,19 +7,19 @@ const Image = require('../image/Image') const defaults = { tables: true, lists: true, - paragraphs: true + paragraphs: true, } // -const Document = function(data) { +const Document = function (data) { Object.defineProperty(this, 'data', { enumerable: false, - value: data + value: data, }) } const methods = { - title: function(str) { + title: function (str) { //use like a setter if (str !== undefined) { this.data.title = str @@ -37,19 +37,19 @@ const methods = { } return guess }, - pageID: function(id) { + pageID: function (id) { if (id !== undefined) { this.data.pageID = id } return this.data.pageID }, - language: function(lang) { + language: function (lang) { if (lang !== undefined) { this.data.lang = lang } return this.data.lang }, - url: function() { + url: function () { let title = this.title() if (!title) { return null @@ -59,36 +59,36 @@ const methods = { // replace blank to underscore title = title.replace(/ /g, '_') title = encodeURIComponent(title) - return `https://${lang}.${domain}.org/wiki/${title}` + return `https://${lang}.${domain}/wiki/${title}` }, - namespace: function(ns) { + namespace: function (ns) { if (ns !== undefined) { this.data.namespace = ns } return this.data.namespace }, - isRedirect: function() { + isRedirect: function () { return this.data.type === 'redirect' }, - redirectTo: function() { + redirectTo: function () { return this.data.redirectTo }, - isDisambiguation: function() { + isDisambiguation: function () { return disambig(this) }, - categories: function(clue) { + categories: function (clue) { if (typeof clue === 'number') { return this.data.categories[clue] } return this.data.categories || [] }, - sections: function(clue) { + sections: function (clue) { let arr = this.data.sections || [] - arr.forEach(sec => (sec.doc = this)) + arr.forEach((sec) => (sec.doc = this)) //grab a specific section, by its title if (typeof clue === 'string') { let str = clue.toLowerCase().trim() - return arr.find(s => { + return arr.find((s) => { return s.title().toLowerCase() === str }) } @@ -97,9 +97,9 @@ const methods = { } return arr }, - paragraphs: function(n) { + paragraphs: function (n) { let arr = [] - this.data.sections.forEach(s => { + this.data.sections.forEach((s) => { arr = arr.concat(s.paragraphs()) }) if (typeof n === 'number') { @@ -107,16 +107,16 @@ const methods = { } return arr }, - paragraph: function(n) { + paragraph: function (n) { let arr = this.paragraphs() || [] if (typeof n === 'number') { return arr[n] } return arr[0] }, - sentences: function(n) { + sentences: function (n) { let arr = [] - this.sections().forEach(sec => { + this.sections().forEach((sec) => { arr = arr.concat(sec.sentences()) }) if (typeof n === 'number') { @@ -124,23 +124,23 @@ const methods = { } return arr }, - sentence: function() { + sentence: function () { return this.sentences(0) }, - images: function(clue) { + images: function (clue) { let arr = sectionMap(this, 'images', null) //grab image from infobox, first - this.infoboxes().forEach(info => { + this.infoboxes().forEach((info) => { let img = info.image() if (img) { arr.unshift(img) //put it at the top } }) //look for 'gallery' templates, too - this.templates().forEach(obj => { + this.templates().forEach((obj) => { if (obj.template === 'gallery') { obj.images = obj.images || [] - obj.images.forEach(img => { + obj.images.forEach((img) => { if (img instanceof Image === false) { img = new Image(img) } @@ -153,31 +153,31 @@ const methods = { } return arr }, - image: function() { + image: function () { return this.images(0) }, - links: function(clue) { + links: function (clue) { return sectionMap(this, 'links', clue) }, - interwiki: function(clue) { + interwiki: function (clue) { return sectionMap(this, 'interwiki', clue) }, - lists: function(clue) { + lists: function (clue) { return sectionMap(this, 'lists', clue) }, - tables: function(clue) { + tables: function (clue) { return sectionMap(this, 'tables', clue) }, - templates: function(clue) { + templates: function (clue) { return sectionMap(this, 'templates', clue) }, - references: function(clue) { + references: function (clue) { return sectionMap(this, 'references', clue) }, - coordinates: function(clue) { + coordinates: function (clue) { return sectionMap(this, 'coordinates', clue) }, - infoboxes: function(clue) { + infoboxes: function (clue) { let arr = sectionMap(this, 'infoboxes') //sort them by biggest-first arr = arr.sort((a, b) => { @@ -191,22 +191,22 @@ const methods = { } return arr }, - text: function(options) { + text: function (options) { options = setDefaults(options, defaults) //nah, skip these. if (this.isRedirect() === true) { return '' } - let arr = this.sections().map(sec => sec.text(options)) + let arr = this.sections().map((sec) => sec.text(options)) return arr.join('\n\n') }, - json: function(options) { + json: function (options) { options = setDefaults(options, defaults) return toJSON(this, options) }, - debug: function() { + debug: function () { console.log('\n') - this.sections().forEach(sec => { + this.sections().forEach((sec) => { let indent = ' - ' for (let i = 0; i < sec.depth; i += 1) { indent = ' -' + indent @@ -214,10 +214,10 @@ const methods = { console.log(indent + (sec.title() || '(Intro)')) }) return this - } + }, } -const isArray = function(arr) { +const isArray = function (arr) { return Object.prototype.toString.call(arr) === '[object Array]' } //add singular-methods, too @@ -233,13 +233,13 @@ let plurals = [ 'links', 'images', 'templates', - 'categories' + 'categories', ] -plurals.forEach(fn => { +plurals.forEach((fn) => { let sing = fn.replace(/ies$/, 'y') sing = sing.replace(/oxes$/, 'ox') sing = sing.replace(/s$/, '') - methods[sing] = function(n) { + methods[sing] = function (n) { n = n || 0 let res = this[fn](n) if (isArray(res)) { @@ -249,7 +249,7 @@ plurals.forEach(fn => { } }) -Object.keys(methods).forEach(k => { +Object.keys(methods).forEach((k) => { Document.prototype[k] = methods[k] }) From 38db79907ffc89638756ec422e42e3eb75b78fff Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Sat, 25 Apr 2020 13:12:10 -0400 Subject: [PATCH 2/5] support invoke for #348 --- scratch.js | 8 ++++---- src/template/find/index.js | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/scratch.js b/scratch.js index 374f0809..7f41a8b0 100644 --- a/scratch.js +++ b/scratch.js @@ -4,7 +4,7 @@ wtf.extend(require('./plugins/wikitext/src')) // var str = `[[Image:Levellers declaration and standard.gif|thumb|Woodcut from a [[Diggers]] document by [[William Everard (Digger)|William Everard]]]]` // console.log(wtf(str).json()) -;(async () => { - const doc = await wtf.fetch('Nuclear Waste Technical Review Board') - console.log(doc.url()) -})() + +wtf.fetch('Template:2019–20 coronavirus pandemic data/United States/California medical cases chart').then((doc) => { + console.log(doc.template('medical cases chart')) +}) diff --git a/src/template/find/index.js b/src/template/find/index.js index 524823cd..2e4f100a 100644 --- a/src/template/find/index.js +++ b/src/template/find/index.js @@ -2,15 +2,17 @@ const findFlat = require('./flat') const getName = require('../_parsers/_getName') const hasTemplate = /\{\{/ -const parseTemplate = function(tmpl) { +const parseTemplate = function (tmpl) { + // this is some unexplained Lua thing + tmpl = tmpl.replace(/#invoke:/, '') return { body: tmpl, name: getName(tmpl), - children: [] + children: [], } } -const doEach = function(obj) { +const doEach = function (obj) { // peel-off top-level let wiki = obj.body.substr(2) wiki = wiki.replace(/\}\}$/, '') @@ -23,7 +25,7 @@ const doEach = function(obj) { return obj } // recurse through children - obj.children.forEach(ch => { + obj.children.forEach((ch) => { let inside = ch.body.substr(2) if (hasTemplate.test(inside)) { return doEach(ch) //keep going @@ -34,7 +36,7 @@ const doEach = function(obj) { } // return a nested structure of all templates -const findTemplates = function(wiki) { +const findTemplates = function (wiki) { let list = findFlat(wiki) list = list.map(parseTemplate) list = list.map(doEach) From 4740baef23b4e5091c3f496cfd22ac62636ff28e Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Sat, 25 Apr 2020 13:13:44 -0400 Subject: [PATCH 3/5] update deps, 8.2.1 --- builds/wtf_wikipedia-client.js | 8 +- builds/wtf_wikipedia-client.min.js | 2 +- builds/wtf_wikipedia-client.mjs | 2 +- builds/wtf_wikipedia.js | 8 +- builds/wtf_wikipedia.mjs | 8 +- package-lock.json | 333 ++++++++++++++++++++++------- package.json | 8 +- src/_version.js | 2 +- 8 files changed, 280 insertions(+), 91 deletions(-) diff --git a/builds/wtf_wikipedia-client.js b/builds/wtf_wikipedia-client.js index 4fe4a685..bb745e65 100644 --- a/builds/wtf_wikipedia-client.js +++ b/builds/wtf_wikipedia-client.js @@ -1,4 +1,4 @@ -/* wtf_wikipedia 8.2.0 MIT */ +/* wtf_wikipedia 8.2.1 MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -697,7 +697,7 @@ title = title.replace(/ /g, '_'); title = encodeURIComponent(title); - return "https://".concat(lang, ".").concat(domain, ".org/wiki/").concat(title); + return "https://".concat(lang, ".").concat(domain, "/wiki/").concat(title); }, namespace: function namespace(ns) { if (ns !== undefined) { @@ -4784,6 +4784,8 @@ var hasTemplate = /\{\{/; var parseTemplate = function parseTemplate(tmpl) { + // this is some unexplained Lua thing + tmpl = tmpl.replace(/#invoke:/, ''); return { body: tmpl, name: _getName(tmpl), @@ -8822,7 +8824,7 @@ var category = fetchCategory; - var _version = '8.2.0'; + var _version = '8.2.1'; var wtf = function wtf(wiki, options) { return _01Document(wiki, options); diff --git a/builds/wtf_wikipedia-client.min.js b/builds/wtf_wikipedia-client.min.js index 67e0f9dc..0330413a 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,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),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"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=/ c\. $/,$e=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),je=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 ze(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 Oe=ze,Ee=function(e){var t=je(e.wiki);(t=t.map(ze))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},_e=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},Se=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},Ce=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},qe=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,Ne={template:!0,list:!0,prototype:!0},Ae=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===qe.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return Ne.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}),{})},Le={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},De=function(e){return Object.keys(e).forEach((function(t){!0===Le[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},Ie=Oe,Te=function(e,t){var i=Ie(e);return"json"===t?i.json():"raw"===t?i:i.text()},Pe=function(e,t,i){t=t||[],e=_e(e||"");var n=Ce(e),a=n.shift(),r=Ae(n,t);return(r=De(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?Te(r[e],i):r[e].map((function(e){return Te(e,i)}))})),a&&(r.template=Se(a)),r},Re=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Me={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(Me).forEach((function(e){Re.prototype[e]=Me[e]}));var Ue=Re,Fe=Oe,Ke=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Be=function(e){var t=Pe(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},We=function(e){return{template:"citation",type:"inline",data:{},inline:Fe(e)||{}}},Ye=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Ue(e)})),e.wiki=i},Ze=Oe,Ge=/^(={1,5})(.{1,200}?)={1,5}$/,He=function(e,t){var i=t.match(Ge);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=Ze(n).text()).replace(/\{\{.+?\}\}/,"")};Ye(a),n=re(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},Ve=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},Je=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Qe=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Xe=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(Je);if(null!==r){var o=parseInt(r[1],10);n=n.replace(Je,""),t[a]=n;for(var s=i+1;s0}))}(e))},et=Oe,tt=/^!/,it={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},nt=function(e){return(e=et(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},at=function(e){return(e=e||[]).length-e.filter((function(e){return e})).length>3},rt=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=et(e).text(),e=(e=nt(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];at(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=nt(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=nt(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Xe(i));if(!n||n.length<=1){n=rt(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=rt(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=et(e);r.text(nt(r.text())),i[a]=r})),i}(e,n)}))},st=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}))},ct={},ut=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},lt={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,ct),st(this.data,e)},text:function(){return""}};lt.keyvalue=lt.keyValue,lt.keyval=lt.keyValue,Object.keys(lt).forEach((function(e){ut.prototype[e]=lt[e]}));var pt=ut,mt=/^\s*{\|/,dt=/^\s*\|}/,ft=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=ot(e);t&&t.length>0&&s.push(new pt(t))}})),s.length>0&&(e.tables=s),e.wiki=i},gt={sentences:!0},ht=function(e,t){var i={};return!0===(t=p(t,gt)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},bt={sentences:!0,lists:!0,images:!0},kt=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},wt={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,bt);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,bt),ht(this,e)}};wt.citations=wt.references,Object.keys(wt).forEach((function(e){kt.prototype[e]=wt[e]}));var vt=kt;var yt=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},xt=Oe,$t=new RegExp("("+C.images.join("|")+"):","i"),jt="(".concat(C.images.join("|"),")"),zt=new RegExp(jt+":(.+?)[\\||\\]]","iu"),Ot={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},Et=function(e){var t=e.wiki;yt(t).forEach((function(i){if(!0===$t.test(i)){e.images=e.images||[];var n=function(e){var t=e.match(zt);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=Pe(e),o=r.list||[];return r.alt&&(a.alt=r.alt),(o=o.filter((function(e){return!1===Ot.hasOwnProperty(e)})))[o.length-1]&&(a.caption=xt(o[o.length-1])),new z(a,e)}return null}(i);n&&e.images.push(n),t=t.replace(i,"")}})),e.wiki=t},_t={},St=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Ct={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,_t),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(Ct).forEach((function(e){St.prototype[e]=Ct[e]}));var qt=St,Nt=Oe,At=/^[#\*:;\|]+/,Lt=/^\*+[^:,\|]{4}/,Dt=/^ ?\#[^:,\|]{4}/,It=/[a-z_0-9\]\}]/i,Tt=function(e){return At.test(e)||Lt.test(e)||Dt.test(e)},Pt=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 qt(e)})),e.wiki=n.join("\n")}},Ft=function(e){var t=e.wiki,i=t.split(Mt);i=(i=i.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var t={wiki:e,lists:[],sentences:[],images:[]};return Ut.list(t),Ut.image(t),Rt(t),new vt(t)})),e.wiki=t,e.paragraphs=i},Kt=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},Bt=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Wt=function(e){this._type=e.type,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Yt={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=Bt(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},Ht=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=Se(t)),t||null},Vt=/\{\{/,Jt=function(e){return{body:e,name:Ht(e),children:[]}},Qt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Gt(i),t.children=t.children.map(Jt),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Vt.test(i)?e(t):null})),t},Xt=function(e){var t=Gt(e);return t=(t=t.map(Jt)).map(Qt)},ei=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),ti=new RegExp("^(subst.)?("+C.infoboxes.join("|")+")[: \n]","i"),ii=/^infobox /i,ni=/ infobox$/i,ai=/$Year in [A-Z]/i,ri={"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,"pro hockey team":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},oi=function(e){return!0===ri.hasOwnProperty(e)||(!!ti.test(e)||(!(!ii.test(e)&&!ni.test(e))||!!ai.test(e)))},si=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(ti),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},ci=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],ui=ci.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),li=function(e){return e<10?"0"+e:String(e)},pi=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===ci.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(ci[e.month]," ").concat(e.year);else{if(t="".concat(ci[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(li(e.hour),":").concat(li(e.minute));void 0!==e.second&&(i=i+":"+li(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},mi=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},hi=mi,bi=pi,ki=function(e){return{template:"date",data:e}},wi=function(e){var t=(e=_e(e)).split("|"),i=hi(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=hi(n)}},vi={date:function(e,t){var i=Pe(e,["year","month","date","hour","minute","second","timezone"]),n=hi([i.year,i.month,i.date||i.day]);return i.text=bi(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(ki(i)),i.text},natural_date:function(e,t){var i=Pe(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(ki(n)),i.trim()},one_year:function(e,t){var i=Pe(e,["year"]),n=Number(i.year);return t.push(ki({year:n})),String(n)},two_dates:function(e,t){var i=Pe(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=hi([i.birth_year,i.birth_month,i.birth_date]);return t.push(ki(n)),bi(n)}var a=hi([i.death_year,i.death_month,i.death_date]);return t.push(ki(a)),bi(a)},age:function(e){var t=wi(e);return gi(t.from,t.to).years||0},"diff-y":function(e){var t=wi(e),i=gi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=wi(e),i=gi(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=wi(e),i=gi(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=wi(e),i=gi(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=wi(e),i=gi(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(", ")}},yi=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},xi=vi.date,$i=vi.natural_date,ji=["January","February","March","April","May","June","July","August","September","October","November","December"],zi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Oi=Object.assign({},di,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return zi[e.getDay()]},currentmonth:function(){var e=new Date;return ji[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return ji[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),ji[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),ji[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Pe(e,["date","fmt"]).date;return yi(t)},"birth date and age":function(e,t){var i=Pe(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?$i(e,t):(t.push(i),i=mi([i.year,i.month,i.day]),pi(i))},"birth year and age":function(e,t){var i=Pe(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return $i(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=mi([i.birth_year,i.birth_month]);var a=pi(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Pe(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?$i(e,t):(t.push(i),i=mi([i.death_year,i.death_month]),pi(i))},"birth date and age2":function(e,t){var i=Pe(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=mi([i.birth_year,i.birth_month,i.birth_day]),pi(i)},"birth based on age as of date":function(e,t){var i=Pe(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=Pe(e,["year","month","day","age"]);t.push(i),i=mi([i.year,i.month,i.day]);var n=pi(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=Pe(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:xi,end:xi,birth:xi,death:xi,"start date":xi,"end date":xi,"birth date":xi,"death date":xi,"start date and age":xi,"end date and age":xi,"start-date":$i,"end-date":$i,"birth-date":$i,"death-date":$i,"birth-date and age":$i,"birth-date and given age":$i,"death-date and age":$i,"death-date and given age":$i,birthdeathage:vi.two_dates,dob:xi,age:vi.age,"age nts":vi.age,"age in years":vi["diff-y"],"age in years and months":vi["diff-ym"],"age in years, months and days":vi["diff-ymd"],"age in years and days":vi["diff-yd"],"age in days":vi["diff-d"]});Oi.localday=Oi.currentday,Oi.localdayname=Oi.currentdayname,Oi.localmonth=Oi.currentmonth,Oi.localyear=Oi.currentyear,Oi.currentmonthname=Oi.currentmonth,Oi.currentmonthabbrev=Oi.currentmonth,Oi["death date and age"]=Oi["birth date and age"],Oi.bda=Oi["birth date and age"],Oi["birth date based on age at death"]=Oi["birth based on age as of date"];var Ei=Oi,_i={tag:function(e){var t=Pe(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=Pe(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=Pe(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Pe(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Pe(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=Pe(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=Pe(e);return t.push(i),i.code||""},samp:function(e,t){var i=Pe(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Pe(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Pe(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Pe(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=Pe(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}};_i.rndfrac=_i.rnd,_i.rndnear=_i.rnd,_i["unité"]=_i.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){_i[e]=function(e){return Pe(e,["text"]).text||""}}));var Si=_i,Ci={plainlist:function(e){var t=(e=_e(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=Pe(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=Pe(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=Pe(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Pe(e).list||[]).join(", ")},catlist:function(e){return(Pe(e).list||[]).join(", ")},"br separated entries":function(e){return(Pe(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Pe(e).list||[]).join(", ")},"anchored list":function(e){var t=Pe(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Pe(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=((Pe(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")}};Ci.flatlist=Ci.plainlist,Ci.ublist=Ci.plainlist,Ci["unbulleted list"]=Ci["collapsible list"],Ci.ubl=Ci["collapsible list"],Ci["bare anchored list"]=Ci["anchored list"],Ci["plain list"]=Ci.plainlist,Ci.cmn=Ci["columns-list"],Ci.collist=Ci["columns-list"],Ci["col-list"]=Ci["columns-list"],Ci.columnslist=Ci["columns-list"];var qi=Ci,Ni={convert:function(e){var t=Pe(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=Pe(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Pe(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Pe(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Pe(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=Pe(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=Pe(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Pe(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=Pe(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Pe(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Pe(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=Pe(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Pe(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Pe(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Pe(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};Ni["str left"]=Ni.trunc,Ni["str crop"]=Ni.trunc,Ni.tooltip=Ni.abbr,Ni.abbrv=Ni.abbr,Ni.define=Ni.abbr,Ni.cvt=Ni.convert;var Ai=Ni,Li=Object.assign({},Si,qi,Ai);var Di=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)},Ii=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ti={s:!0,w:!0},Pi=function(e){var i=Pe(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?(Ti[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Di(n.slice(0,3)),lon:Di(n.slice(3))}:8===n.length?{lat:Di(n.slice(0,4)),lon:Di(n.slice(4))}:{});return i.lat=Ii(r.lat),i.lon=Ii(r.lon),i.template="coord",delete i.list,i},Ri={coord:function(e,t){var i=Pi(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Ri.coor=Ri.coord,Ri["coor title dms"]=Ri.coord,Ri["coor title dec"]=Ri.coord,Ri["coor dms"]=Ri.coord,Ri["coor dm"]=Ri.coord,Ri["coor dec"]=Ri.coord;var Mi=Ri,Ui={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Pe(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){Ui[e]=function(e){var t=Pe(e,["first","second"]);return t.second||t.first}})),Ui.m=Ui.mention,Ui["m-self"]=Ui.mention,Ui.l=Ui.link,Ui.ll=Ui.link,Ui["l-self"]=Ui.link;var Fi=Ui,Ki={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"},Bi={about:function(e,t){var i=Pe(e);return t.push(i),""},main:function(e,t){var i=Pe(e);return t.push(i),""},"main list":function(e,t){var i=Pe(e);return t.push(i),""},see:function(e,t){var i=Pe(e);return t.push(i),""},for:function(e,t){var i=Pe(e);return t.push(i),""},further:function(e,t){var i=Pe(e);return t.push(i),""},"further information":function(e,t){var i=Pe(e);return t.push(i),""},listen:function(e,t){var i=Pe(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Pe(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){Qi[e]=Qi["4teambracket"]}));var Xi=Qi,en={"£":"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"},tn=function(e,t){var i=Pe(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(en[n]||"").concat(i.amount||"");return i.code&&!en[i.code.toLowerCase()]&&(a+=" "+i.code),a},nn={currency:tn,monnaie:tn,"unité":tn,nombre:tn,nb:tn,iso4217:tn,inrconvert:function(e,t){var i=Pe(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(en).forEach((function(e){nn[e]=tn}));var an=nn,rn={"election box begin":function(e,t){var i=Pe(e);return t.push(i),""},"election box candidate":function(e,t){var i=Pe(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Pe(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Pe(e);return t.push(i),""}};rn["election box begin no change"]=rn["election box begin"],rn["election box begin no party"]=rn["election box begin"],rn["election box begin no party no change"]=rn["election box begin"],rn["election box inline begin"]=rn["election box begin"],rn["election box inline begin no change"]=rn["election box begin"],rn["election box candidate for alliance"]=rn["election box candidate"],rn["election box candidate minor party"]=rn["election box candidate"],rn["election box candidate no party link no change"]=rn["election box candidate"],rn["election box candidate with party link"]=rn["election box candidate"],rn["election box candidate with party link coalition 1918"]=rn["election box candidate"],rn["election box candidate with party link no change"]=rn["election box candidate"],rn["election box inline candidate"]=rn["election box candidate"],rn["election box inline candidate no change"]=rn["election box candidate"],rn["election box inline candidate with party link"]=rn["election box candidate"],rn["election box inline candidate with party link no change"]=rn["election box candidate"],rn["election box inline incumbent"]=rn["election box candidate"];var on=rn,sn=[["🇦🇩","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"]],cn={flag:function(e){var t=Pe(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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||"","]]")}};sn.forEach((function(e){cn[e[1]]=function(){return e[0]}})),cn.cr=cn.flagcountry,cn["cr-rt"]=cn.flagcountry,cn.cricon=cn.flagicon;var un=cn,ln=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===q.hasOwnProperty(t[1])?q[t[1]].english_title:t[1]:null},pn={ipa:function(e,t){var i=Pe(e,["transcription","lang","audio"]);return i.lang=ln(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Pe(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=ln(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Pe(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){pn["ipa-"+e]=pn.ipa,pn["ipac-"+e]=pn.ipac}));var mn=pn,dn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Pe(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){dn["lang-"+e]=dn["lang-de"]})),dn.nihongo2=dn.nihongo,dn.nihongo3=dn.nihongo,dn["nihongo-s"]=dn.nihongo,dn["nihongo foot"]=dn.nihongo;var fn=dn,gn=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)},hn={math:function(e,t){var i=Pe(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Pe(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=Pe(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Pe(e,["numerator","denominator","decimals"]),i=gn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Pe(e,["done","total","digits"]),i=gn({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=Pe(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=gn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Pe(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=gn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};hn.sfrac=hn.frac,hn.sqrt=hn.radic,hn.pct=hn.percentage,hn.percent=hn.percentage,hn.winpct=hn["winning percentage"],hn.winperc=hn["winning percentage"];var bn=hn,kn=function(e,t,i){var n=Pe(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},wn={persondata:kn,taxobox:kn,citation:kn,portal:kn,reflist:kn,"cite book":kn,"cite journal":kn,"cite web":kn,"commons cat":kn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Pe(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Pe(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=Pe(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=Pe(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Wn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Yn={text:function(){return""},json:function(){return this.data}};Object.keys(Yn).forEach((function(e){Wn.prototype[e]=Yn[e]}));var Zn=Wn,Gn=new RegExp("^(cite |citation)","i"),Hn={citation:!0,refn:!0,harvnb:!0},Vn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Jn=function(e){var t=e.wiki,i=Xt(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=Bn(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===Hn[e.template]||!0===Gn.test(e.template)}(t)?(e.references.push(new Ue(t)),!1):!0!==Vn(t)||(e.infoboxes.push(new Zt(t)),!1)})),e.templates=e.templates.map((function(e){return new Zn(e)})),i.forEach((function(e){t=t.replace(e.body,e.out)})),e.wiki=t},Qn=Oe,Xn=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=Qn(a)),n}))).length>0&&e.templates.push({template:"gallery",images:a,pos:e.title}),""})),e.wiki=t},ea=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:[]};Jn(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},ta={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"]},ia=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="! "+ta[i].join(" !! "),a=ot("{|\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},na=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=ot("{|\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},aa=["res","record","opponent","method","event","date","round","time","location","notes"],ra=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="! "+aa.join(" !! "),n=ot("{|\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},oa=Oe,sa=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=oa(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},ca=function(e){ea(e),Xn(e),sa(e),na(e),ra(e),ia(e)},ua=new RegExp("^("+C.references.join("|")+"):?","i"),la=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,pa={heading:He,table:ft,paragraphs:Ft,templates:Jn,references:Ye,startEndTemplates:ca},ma=function(e,t){return pa.startEndTemplates(e),pa.references(e),pa.templates(e),pa.table(e),pa.paragraphs(e,t),e=new ae(e)},da=function(e){for(var t=[],i=e.wiki.split(la),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},fa=new RegExp("\\[\\[:?("+C.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),ga=new RegExp("^\\[\\[:?("+C.categories.join("|")+"):","ig"),ha={section:da,categories:function(e){var t=e.wiki,i=t.match(fa);i&&i.forEach((function(t){(t=(t=(t=t.replace(ga,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(fa,""),e.wiki=t}},ba=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),ha.categories(i),new S(i)):(H(i),ha.categories(i),ha.section(i),new S(i))},ka=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return ba(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},wa=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},va=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"}},ya=/^https?:\/\//,xa={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},$a=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({},xa,i)).title=t,ya.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=va(i);return wa(r,o).then((function(e){try{var t=u(e,i);return t=ka(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},ja={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},za=function(e,t){var i;t=t||{},t=Object.assign({},ja,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=va(t);return wa(n,a).then((function(e){try{var t=u(e);return ka(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},Oa={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Ea=function(e,t,i){var n;i=i||{},i=Object.assign({},Oa,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=va(i);return wa(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)}))},_a=function(e,t){return ba(e,t)},Sa={Doc:S,Section:ae,Paragraph:vt,Sentence:be,Image:z,Infobox:Zt,Link:ue,List:qt,Reference:Ue,Table:pt,Template:Zn,http:wa,wtf:_a};return _a.fetch=function(e,t,i,n){return $a(e,t,i)},_a.random=function(e,t,i){return za(e,t)},_a.category=function(e,t,i,n){return Ea(e,t,i)},_a.extend=function(e){return e(Sa,Un,this),this},_a.version="8.2.0",_a})); +!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,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),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"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=/ c\. $/,$e=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),je=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 ze(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 Oe=ze,Ee=function(e){var t=je(e.wiki);(t=t.map(ze))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},_e=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},Se=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},Ce=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},qe=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,Ne={template:!0,list:!0,prototype:!0},Ae=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===qe.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return Ne.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}),{})},Le={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},De=function(e){return Object.keys(e).forEach((function(t){!0===Le[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},Ie=Oe,Te=function(e,t){var i=Ie(e);return"json"===t?i.json():"raw"===t?i:i.text()},Pe=function(e,t,i){t=t||[],e=_e(e||"");var n=Ce(e),a=n.shift(),r=Ae(n,t);return(r=De(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?Te(r[e],i):r[e].map((function(e){return Te(e,i)}))})),a&&(r.template=Se(a)),r},Re=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Me={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(Me).forEach((function(e){Re.prototype[e]=Me[e]}));var Ue=Re,Fe=Oe,Ke=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Be=function(e){var t=Pe(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},We=function(e){return{template:"citation",type:"inline",data:{},inline:Fe(e)||{}}},Ye=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Ue(e)})),e.wiki=i},Ze=Oe,Ge=/^(={1,5})(.{1,200}?)={1,5}$/,He=function(e,t){var i=t.match(Ge);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=Ze(n).text()).replace(/\{\{.+?\}\}/,"")};Ye(a),n=re(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},Ve=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},Je=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Qe=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Xe=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(Je);if(null!==r){var o=parseInt(r[1],10);n=n.replace(Je,""),t[a]=n;for(var s=i+1;s0}))}(e))},et=Oe,tt=/^!/,it={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},nt=function(e){return(e=et(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},at=function(e){return(e=e||[]).length-e.filter((function(e){return e})).length>3},rt=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=et(e).text(),e=(e=nt(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];at(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=nt(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=nt(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Xe(i));if(!n||n.length<=1){n=rt(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=rt(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=et(e);r.text(nt(r.text())),i[a]=r})),i}(e,n)}))},st=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}))},ct={},ut=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},lt={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,ct),st(this.data,e)},text:function(){return""}};lt.keyvalue=lt.keyValue,lt.keyval=lt.keyValue,Object.keys(lt).forEach((function(e){ut.prototype[e]=lt[e]}));var pt=ut,mt=/^\s*{\|/,dt=/^\s*\|}/,ft=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=ot(e);t&&t.length>0&&s.push(new pt(t))}})),s.length>0&&(e.tables=s),e.wiki=i},gt={sentences:!0},ht=function(e,t){var i={};return!0===(t=p(t,gt)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},bt={sentences:!0,lists:!0,images:!0},kt=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},wt={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,bt);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,bt),ht(this,e)}};wt.citations=wt.references,Object.keys(wt).forEach((function(e){kt.prototype[e]=wt[e]}));var vt=kt;var yt=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},xt=Oe,$t=new RegExp("("+C.images.join("|")+"):","i"),jt="(".concat(C.images.join("|"),")"),zt=new RegExp(jt+":(.+?)[\\||\\]]","iu"),Ot={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},Et=function(e){var t=e.wiki;yt(t).forEach((function(i){if(!0===$t.test(i)){e.images=e.images||[];var n=function(e){var t=e.match(zt);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=Pe(e),o=r.list||[];return r.alt&&(a.alt=r.alt),(o=o.filter((function(e){return!1===Ot.hasOwnProperty(e)})))[o.length-1]&&(a.caption=xt(o[o.length-1])),new z(a,e)}return null}(i);n&&e.images.push(n),t=t.replace(i,"")}})),e.wiki=t},_t={},St=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Ct={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,_t),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(Ct).forEach((function(e){St.prototype[e]=Ct[e]}));var qt=St,Nt=Oe,At=/^[#\*:;\|]+/,Lt=/^\*+[^:,\|]{4}/,Dt=/^ ?\#[^:,\|]{4}/,It=/[a-z_0-9\]\}]/i,Tt=function(e){return At.test(e)||Lt.test(e)||Dt.test(e)},Pt=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 qt(e)})),e.wiki=n.join("\n")}},Ft=function(e){var t=e.wiki,i=t.split(Mt);i=(i=i.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var t={wiki:e,lists:[],sentences:[],images:[]};return Ut.list(t),Ut.image(t),Rt(t),new vt(t)})),e.wiki=t,e.paragraphs=i},Kt=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},Bt=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Wt=function(e){this._type=e.type,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Yt={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=Bt(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},Ht=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=Se(t)),t||null},Vt=/\{\{/,Jt=function(e){return{body:e=e.replace(/#invoke:/,""),name:Ht(e),children:[]}},Qt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Gt(i),t.children=t.children.map(Jt),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Vt.test(i)?e(t):null})),t},Xt=function(e){var t=Gt(e);return t=(t=t.map(Jt)).map(Qt)},ei=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),ti=new RegExp("^(subst.)?("+C.infoboxes.join("|")+")[: \n]","i"),ii=/^infobox /i,ni=/ infobox$/i,ai=/$Year in [A-Z]/i,ri={"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,"pro hockey team":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},oi=function(e){return!0===ri.hasOwnProperty(e)||(!!ti.test(e)||(!(!ii.test(e)&&!ni.test(e))||!!ai.test(e)))},si=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(ti),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},ci=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],ui=ci.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),li=function(e){return e<10?"0"+e:String(e)},pi=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===ci.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(ci[e.month]," ").concat(e.year);else{if(t="".concat(ci[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(li(e.hour),":").concat(li(e.minute));void 0!==e.second&&(i=i+":"+li(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},mi=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},hi=mi,bi=pi,ki=function(e){return{template:"date",data:e}},wi=function(e){var t=(e=_e(e)).split("|"),i=hi(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=hi(n)}},vi={date:function(e,t){var i=Pe(e,["year","month","date","hour","minute","second","timezone"]),n=hi([i.year,i.month,i.date||i.day]);return i.text=bi(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(ki(i)),i.text},natural_date:function(e,t){var i=Pe(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(ki(n)),i.trim()},one_year:function(e,t){var i=Pe(e,["year"]),n=Number(i.year);return t.push(ki({year:n})),String(n)},two_dates:function(e,t){var i=Pe(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=hi([i.birth_year,i.birth_month,i.birth_date]);return t.push(ki(n)),bi(n)}var a=hi([i.death_year,i.death_month,i.death_date]);return t.push(ki(a)),bi(a)},age:function(e){var t=wi(e);return gi(t.from,t.to).years||0},"diff-y":function(e){var t=wi(e),i=gi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=wi(e),i=gi(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=wi(e),i=gi(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=wi(e),i=gi(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=wi(e),i=gi(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(", ")}},yi=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},xi=vi.date,$i=vi.natural_date,ji=["January","February","March","April","May","June","July","August","September","October","November","December"],zi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Oi=Object.assign({},di,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return zi[e.getDay()]},currentmonth:function(){var e=new Date;return ji[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return ji[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),ji[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),ji[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Pe(e,["date","fmt"]).date;return yi(t)},"birth date and age":function(e,t){var i=Pe(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?$i(e,t):(t.push(i),i=mi([i.year,i.month,i.day]),pi(i))},"birth year and age":function(e,t){var i=Pe(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return $i(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=mi([i.birth_year,i.birth_month]);var a=pi(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Pe(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?$i(e,t):(t.push(i),i=mi([i.death_year,i.death_month]),pi(i))},"birth date and age2":function(e,t){var i=Pe(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=mi([i.birth_year,i.birth_month,i.birth_day]),pi(i)},"birth based on age as of date":function(e,t){var i=Pe(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=Pe(e,["year","month","day","age"]);t.push(i),i=mi([i.year,i.month,i.day]);var n=pi(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=Pe(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:xi,end:xi,birth:xi,death:xi,"start date":xi,"end date":xi,"birth date":xi,"death date":xi,"start date and age":xi,"end date and age":xi,"start-date":$i,"end-date":$i,"birth-date":$i,"death-date":$i,"birth-date and age":$i,"birth-date and given age":$i,"death-date and age":$i,"death-date and given age":$i,birthdeathage:vi.two_dates,dob:xi,age:vi.age,"age nts":vi.age,"age in years":vi["diff-y"],"age in years and months":vi["diff-ym"],"age in years, months and days":vi["diff-ymd"],"age in years and days":vi["diff-yd"],"age in days":vi["diff-d"]});Oi.localday=Oi.currentday,Oi.localdayname=Oi.currentdayname,Oi.localmonth=Oi.currentmonth,Oi.localyear=Oi.currentyear,Oi.currentmonthname=Oi.currentmonth,Oi.currentmonthabbrev=Oi.currentmonth,Oi["death date and age"]=Oi["birth date and age"],Oi.bda=Oi["birth date and age"],Oi["birth date based on age at death"]=Oi["birth based on age as of date"];var Ei=Oi,_i={tag:function(e){var t=Pe(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=Pe(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=Pe(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Pe(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Pe(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=Pe(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=Pe(e);return t.push(i),i.code||""},samp:function(e,t){var i=Pe(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Pe(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Pe(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Pe(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=Pe(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}};_i.rndfrac=_i.rnd,_i.rndnear=_i.rnd,_i["unité"]=_i.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){_i[e]=function(e){return Pe(e,["text"]).text||""}}));var Si=_i,Ci={plainlist:function(e){var t=(e=_e(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=Pe(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=Pe(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=Pe(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Pe(e).list||[]).join(", ")},catlist:function(e){return(Pe(e).list||[]).join(", ")},"br separated entries":function(e){return(Pe(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Pe(e).list||[]).join(", ")},"anchored list":function(e){var t=Pe(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Pe(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=((Pe(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")}};Ci.flatlist=Ci.plainlist,Ci.ublist=Ci.plainlist,Ci["unbulleted list"]=Ci["collapsible list"],Ci.ubl=Ci["collapsible list"],Ci["bare anchored list"]=Ci["anchored list"],Ci["plain list"]=Ci.plainlist,Ci.cmn=Ci["columns-list"],Ci.collist=Ci["columns-list"],Ci["col-list"]=Ci["columns-list"],Ci.columnslist=Ci["columns-list"];var qi=Ci,Ni={convert:function(e){var t=Pe(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=Pe(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Pe(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Pe(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Pe(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=Pe(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=Pe(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Pe(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=Pe(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Pe(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Pe(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=Pe(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Pe(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Pe(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Pe(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};Ni["str left"]=Ni.trunc,Ni["str crop"]=Ni.trunc,Ni.tooltip=Ni.abbr,Ni.abbrv=Ni.abbr,Ni.define=Ni.abbr,Ni.cvt=Ni.convert;var Ai=Ni,Li=Object.assign({},Si,qi,Ai);var Di=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)},Ii=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ti={s:!0,w:!0},Pi=function(e){var i=Pe(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?(Ti[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Di(n.slice(0,3)),lon:Di(n.slice(3))}:8===n.length?{lat:Di(n.slice(0,4)),lon:Di(n.slice(4))}:{});return i.lat=Ii(r.lat),i.lon=Ii(r.lon),i.template="coord",delete i.list,i},Ri={coord:function(e,t){var i=Pi(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Ri.coor=Ri.coord,Ri["coor title dms"]=Ri.coord,Ri["coor title dec"]=Ri.coord,Ri["coor dms"]=Ri.coord,Ri["coor dm"]=Ri.coord,Ri["coor dec"]=Ri.coord;var Mi=Ri,Ui={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Pe(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){Ui[e]=function(e){var t=Pe(e,["first","second"]);return t.second||t.first}})),Ui.m=Ui.mention,Ui["m-self"]=Ui.mention,Ui.l=Ui.link,Ui.ll=Ui.link,Ui["l-self"]=Ui.link;var Fi=Ui,Ki={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"},Bi={about:function(e,t){var i=Pe(e);return t.push(i),""},main:function(e,t){var i=Pe(e);return t.push(i),""},"main list":function(e,t){var i=Pe(e);return t.push(i),""},see:function(e,t){var i=Pe(e);return t.push(i),""},for:function(e,t){var i=Pe(e);return t.push(i),""},further:function(e,t){var i=Pe(e);return t.push(i),""},"further information":function(e,t){var i=Pe(e);return t.push(i),""},listen:function(e,t){var i=Pe(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Pe(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){Qi[e]=Qi["4teambracket"]}));var Xi=Qi,en={"£":"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"},tn=function(e,t){var i=Pe(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(en[n]||"").concat(i.amount||"");return i.code&&!en[i.code.toLowerCase()]&&(a+=" "+i.code),a},nn={currency:tn,monnaie:tn,"unité":tn,nombre:tn,nb:tn,iso4217:tn,inrconvert:function(e,t){var i=Pe(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(en).forEach((function(e){nn[e]=tn}));var an=nn,rn={"election box begin":function(e,t){var i=Pe(e);return t.push(i),""},"election box candidate":function(e,t){var i=Pe(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Pe(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Pe(e);return t.push(i),""}};rn["election box begin no change"]=rn["election box begin"],rn["election box begin no party"]=rn["election box begin"],rn["election box begin no party no change"]=rn["election box begin"],rn["election box inline begin"]=rn["election box begin"],rn["election box inline begin no change"]=rn["election box begin"],rn["election box candidate for alliance"]=rn["election box candidate"],rn["election box candidate minor party"]=rn["election box candidate"],rn["election box candidate no party link no change"]=rn["election box candidate"],rn["election box candidate with party link"]=rn["election box candidate"],rn["election box candidate with party link coalition 1918"]=rn["election box candidate"],rn["election box candidate with party link no change"]=rn["election box candidate"],rn["election box inline candidate"]=rn["election box candidate"],rn["election box inline candidate no change"]=rn["election box candidate"],rn["election box inline candidate with party link"]=rn["election box candidate"],rn["election box inline candidate with party link no change"]=rn["election box candidate"],rn["election box inline incumbent"]=rn["election box candidate"];var on=rn,sn=[["🇦🇩","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"]],cn={flag:function(e){var t=Pe(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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||"","]]")}};sn.forEach((function(e){cn[e[1]]=function(){return e[0]}})),cn.cr=cn.flagcountry,cn["cr-rt"]=cn.flagcountry,cn.cricon=cn.flagicon;var un=cn,ln=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===q.hasOwnProperty(t[1])?q[t[1]].english_title:t[1]:null},pn={ipa:function(e,t){var i=Pe(e,["transcription","lang","audio"]);return i.lang=ln(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Pe(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=ln(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Pe(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){pn["ipa-"+e]=pn.ipa,pn["ipac-"+e]=pn.ipac}));var mn=pn,dn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Pe(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){dn["lang-"+e]=dn["lang-de"]})),dn.nihongo2=dn.nihongo,dn.nihongo3=dn.nihongo,dn["nihongo-s"]=dn.nihongo,dn["nihongo foot"]=dn.nihongo;var fn=dn,gn=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)},hn={math:function(e,t){var i=Pe(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Pe(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=Pe(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Pe(e,["numerator","denominator","decimals"]),i=gn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Pe(e,["done","total","digits"]),i=gn({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=Pe(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=gn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Pe(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=gn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};hn.sfrac=hn.frac,hn.sqrt=hn.radic,hn.pct=hn.percentage,hn.percent=hn.percentage,hn.winpct=hn["winning percentage"],hn.winperc=hn["winning percentage"];var bn=hn,kn=function(e,t,i){var n=Pe(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},wn={persondata:kn,taxobox:kn,citation:kn,portal:kn,reflist:kn,"cite book":kn,"cite journal":kn,"cite web":kn,"commons cat":kn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Pe(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Pe(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=Pe(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=Pe(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Wn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Yn={text:function(){return""},json:function(){return this.data}};Object.keys(Yn).forEach((function(e){Wn.prototype[e]=Yn[e]}));var Zn=Wn,Gn=new RegExp("^(cite |citation)","i"),Hn={citation:!0,refn:!0,harvnb:!0},Vn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Jn=function(e){var t=e.wiki,i=Xt(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=Bn(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===Hn[e.template]||!0===Gn.test(e.template)}(t)?(e.references.push(new Ue(t)),!1):!0!==Vn(t)||(e.infoboxes.push(new Zt(t)),!1)})),e.templates=e.templates.map((function(e){return new Zn(e)})),i.forEach((function(e){t=t.replace(e.body,e.out)})),e.wiki=t},Qn=Oe,Xn=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=Qn(a)),n}))).length>0&&e.templates.push({template:"gallery",images:a,pos:e.title}),""})),e.wiki=t},ea=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:[]};Jn(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},ta={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"]},ia=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="! "+ta[i].join(" !! "),a=ot("{|\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},na=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=ot("{|\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},aa=["res","record","opponent","method","event","date","round","time","location","notes"],ra=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="! "+aa.join(" !! "),n=ot("{|\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},oa=Oe,sa=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=oa(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},ca=function(e){ea(e),Xn(e),sa(e),na(e),ra(e),ia(e)},ua=new RegExp("^("+C.references.join("|")+"):?","i"),la=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,pa={heading:He,table:ft,paragraphs:Ft,templates:Jn,references:Ye,startEndTemplates:ca},ma=function(e,t){return pa.startEndTemplates(e),pa.references(e),pa.templates(e),pa.table(e),pa.paragraphs(e,t),e=new ae(e)},da=function(e){for(var t=[],i=e.wiki.split(la),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},fa=new RegExp("\\[\\[:?("+C.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),ga=new RegExp("^\\[\\[:?("+C.categories.join("|")+"):","ig"),ha={section:da,categories:function(e){var t=e.wiki,i=t.match(fa);i&&i.forEach((function(t){(t=(t=(t=t.replace(ga,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(fa,""),e.wiki=t}},ba=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),ha.categories(i),new S(i)):(H(i),ha.categories(i),ha.section(i),new S(i))},ka=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return ba(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},wa=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},va=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"}},ya=/^https?:\/\//,xa={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},$a=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({},xa,i)).title=t,ya.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=va(i);return wa(r,o).then((function(e){try{var t=u(e,i);return t=ka(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},ja={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},za=function(e,t){var i;t=t||{},t=Object.assign({},ja,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=va(t);return wa(n,a).then((function(e){try{var t=u(e);return ka(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},Oa={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Ea=function(e,t,i){var n;i=i||{},i=Object.assign({},Oa,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=va(i);return wa(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)}))},_a=function(e,t){return ba(e,t)},Sa={Doc:S,Section:ae,Paragraph:vt,Sentence:be,Image:z,Infobox:Zt,Link:ue,List:qt,Reference:Ue,Table:pt,Template:Zn,http:wa,wtf:_a};return _a.fetch=function(e,t,i,n){return $a(e,t,i)},_a.random=function(e,t,i){return za(e,t)},_a.category=function(e,t,i,n){return Ea(e,t,i)},_a.extend=function(e){return e(Sa,Un,this),this},_a.version="8.2.1",_a})); diff --git a/builds/wtf_wikipedia-client.mjs b/builds/wtf_wikipedia-client.mjs index 32859be0..2020d762 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,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),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"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=/ c\. $/,$e=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),je=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 ze(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 Oe=ze,Ee=function(e){var t=je(e.wiki);(t=t.map(ze))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},_e=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},Se=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},Ce=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},qe=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,Ne={template:!0,list:!0,prototype:!0},Ae=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===qe.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return Ne.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}),{})},Le={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},De=function(e){return Object.keys(e).forEach((function(t){!0===Le[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},Ie=Oe,Te=function(e,t){var i=Ie(e);return"json"===t?i.json():"raw"===t?i:i.text()},Pe=function(e,t,i){t=t||[],e=_e(e||"");var n=Ce(e),a=n.shift(),r=Ae(n,t);return(r=De(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?Te(r[e],i):r[e].map((function(e){return Te(e,i)}))})),a&&(r.template=Se(a)),r},Re=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Me={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(Me).forEach((function(e){Re.prototype[e]=Me[e]}));var Ue=Re,Fe=Oe,Ke=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Be=function(e){var t=Pe(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},We=function(e){return{template:"citation",type:"inline",data:{},inline:Fe(e)||{}}},Ye=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Ue(e)})),e.wiki=i},Ze=Oe,Ge=/^(={1,5})(.{1,200}?)={1,5}$/,He=function(e,t){var i=t.match(Ge);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=Ze(n).text()).replace(/\{\{.+?\}\}/,"")};Ye(a),n=re(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},Ve=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},Je=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Qe=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Xe=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(Je);if(null!==r){var o=parseInt(r[1],10);n=n.replace(Je,""),t[a]=n;for(var s=i+1;s0}))}(e))},et=Oe,tt=/^!/,it={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},nt=function(e){return(e=et(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},at=function(e){return(e=e||[]).length-e.filter((function(e){return e})).length>3},rt=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=et(e).text(),e=(e=nt(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];at(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=nt(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=nt(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Xe(i));if(!n||n.length<=1){n=rt(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=rt(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=et(e);r.text(nt(r.text())),i[a]=r})),i}(e,n)}))},st=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}))},ct={},ut=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},lt={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,ct),st(this.data,e)},text:function(){return""}};lt.keyvalue=lt.keyValue,lt.keyval=lt.keyValue,Object.keys(lt).forEach((function(e){ut.prototype[e]=lt[e]}));var pt=ut,mt=/^\s*{\|/,dt=/^\s*\|}/,ft=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=ot(e);t&&t.length>0&&s.push(new pt(t))}})),s.length>0&&(e.tables=s),e.wiki=i},gt={sentences:!0},ht=function(e,t){var i={};return!0===(t=p(t,gt)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},bt={sentences:!0,lists:!0,images:!0},kt=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},wt={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,bt);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,bt),ht(this,e)}};wt.citations=wt.references,Object.keys(wt).forEach((function(e){kt.prototype[e]=wt[e]}));var vt=kt;var yt=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},xt=Oe,$t=new RegExp("("+C.images.join("|")+"):","i"),jt="(".concat(C.images.join("|"),")"),zt=new RegExp(jt+":(.+?)[\\||\\]]","iu"),Ot={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},Et=function(e){var t=e.wiki;yt(t).forEach((function(i){if(!0===$t.test(i)){e.images=e.images||[];var n=function(e){var t=e.match(zt);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=Pe(e),o=r.list||[];return r.alt&&(a.alt=r.alt),(o=o.filter((function(e){return!1===Ot.hasOwnProperty(e)})))[o.length-1]&&(a.caption=xt(o[o.length-1])),new z(a,e)}return null}(i);n&&e.images.push(n),t=t.replace(i,"")}})),e.wiki=t},_t={},St=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Ct={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,_t),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(Ct).forEach((function(e){St.prototype[e]=Ct[e]}));var qt=St,Nt=Oe,At=/^[#\*:;\|]+/,Lt=/^\*+[^:,\|]{4}/,Dt=/^ ?\#[^:,\|]{4}/,It=/[a-z_0-9\]\}]/i,Tt=function(e){return At.test(e)||Lt.test(e)||Dt.test(e)},Pt=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 qt(e)})),e.wiki=n.join("\n")}},Ft=function(e){var t=e.wiki,i=t.split(Mt);i=(i=i.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var t={wiki:e,lists:[],sentences:[],images:[]};return Ut.list(t),Ut.image(t),Rt(t),new vt(t)})),e.wiki=t,e.paragraphs=i},Kt=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},Bt=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Wt=function(e){this._type=e.type,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Yt={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=Bt(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},Ht=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=Se(t)),t||null},Vt=/\{\{/,Jt=function(e){return{body:e,name:Ht(e),children:[]}},Qt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Gt(i),t.children=t.children.map(Jt),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Vt.test(i)?e(t):null})),t},Xt=function(e){var t=Gt(e);return t=(t=t.map(Jt)).map(Qt)},ei=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),ti=new RegExp("^(subst.)?("+C.infoboxes.join("|")+")[: \n]","i"),ii=/^infobox /i,ni=/ infobox$/i,ai=/$Year in [A-Z]/i,ri={"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,"pro hockey team":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},oi=function(e){return!0===ri.hasOwnProperty(e)||(!!ti.test(e)||(!(!ii.test(e)&&!ni.test(e))||!!ai.test(e)))},si=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(ti),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},ci=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],ui=ci.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),li=function(e){return e<10?"0"+e:String(e)},pi=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===ci.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(ci[e.month]," ").concat(e.year);else{if(t="".concat(ci[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(li(e.hour),":").concat(li(e.minute));void 0!==e.second&&(i=i+":"+li(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},mi=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},hi=mi,bi=pi,ki=function(e){return{template:"date",data:e}},wi=function(e){var t=(e=_e(e)).split("|"),i=hi(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=hi(n)}},vi={date:function(e,t){var i=Pe(e,["year","month","date","hour","minute","second","timezone"]),n=hi([i.year,i.month,i.date||i.day]);return i.text=bi(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(ki(i)),i.text},natural_date:function(e,t){var i=Pe(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(ki(n)),i.trim()},one_year:function(e,t){var i=Pe(e,["year"]),n=Number(i.year);return t.push(ki({year:n})),String(n)},two_dates:function(e,t){var i=Pe(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=hi([i.birth_year,i.birth_month,i.birth_date]);return t.push(ki(n)),bi(n)}var a=hi([i.death_year,i.death_month,i.death_date]);return t.push(ki(a)),bi(a)},age:function(e){var t=wi(e);return gi(t.from,t.to).years||0},"diff-y":function(e){var t=wi(e),i=gi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=wi(e),i=gi(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=wi(e),i=gi(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=wi(e),i=gi(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=wi(e),i=gi(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(", ")}},yi=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},xi=vi.date,$i=vi.natural_date,ji=["January","February","March","April","May","June","July","August","September","October","November","December"],zi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Oi=Object.assign({},di,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return zi[e.getDay()]},currentmonth:function(){var e=new Date;return ji[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return ji[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),ji[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),ji[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Pe(e,["date","fmt"]).date;return yi(t)},"birth date and age":function(e,t){var i=Pe(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?$i(e,t):(t.push(i),i=mi([i.year,i.month,i.day]),pi(i))},"birth year and age":function(e,t){var i=Pe(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return $i(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=mi([i.birth_year,i.birth_month]);var a=pi(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Pe(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?$i(e,t):(t.push(i),i=mi([i.death_year,i.death_month]),pi(i))},"birth date and age2":function(e,t){var i=Pe(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=mi([i.birth_year,i.birth_month,i.birth_day]),pi(i)},"birth based on age as of date":function(e,t){var i=Pe(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=Pe(e,["year","month","day","age"]);t.push(i),i=mi([i.year,i.month,i.day]);var n=pi(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=Pe(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:xi,end:xi,birth:xi,death:xi,"start date":xi,"end date":xi,"birth date":xi,"death date":xi,"start date and age":xi,"end date and age":xi,"start-date":$i,"end-date":$i,"birth-date":$i,"death-date":$i,"birth-date and age":$i,"birth-date and given age":$i,"death-date and age":$i,"death-date and given age":$i,birthdeathage:vi.two_dates,dob:xi,age:vi.age,"age nts":vi.age,"age in years":vi["diff-y"],"age in years and months":vi["diff-ym"],"age in years, months and days":vi["diff-ymd"],"age in years and days":vi["diff-yd"],"age in days":vi["diff-d"]});Oi.localday=Oi.currentday,Oi.localdayname=Oi.currentdayname,Oi.localmonth=Oi.currentmonth,Oi.localyear=Oi.currentyear,Oi.currentmonthname=Oi.currentmonth,Oi.currentmonthabbrev=Oi.currentmonth,Oi["death date and age"]=Oi["birth date and age"],Oi.bda=Oi["birth date and age"],Oi["birth date based on age at death"]=Oi["birth based on age as of date"];var Ei=Oi,_i={tag:function(e){var t=Pe(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=Pe(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=Pe(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Pe(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Pe(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=Pe(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=Pe(e);return t.push(i),i.code||""},samp:function(e,t){var i=Pe(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Pe(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Pe(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Pe(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=Pe(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}};_i.rndfrac=_i.rnd,_i.rndnear=_i.rnd,_i["unité"]=_i.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){_i[e]=function(e){return Pe(e,["text"]).text||""}}));var Si=_i,Ci={plainlist:function(e){var t=(e=_e(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=Pe(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=Pe(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=Pe(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Pe(e).list||[]).join(", ")},catlist:function(e){return(Pe(e).list||[]).join(", ")},"br separated entries":function(e){return(Pe(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Pe(e).list||[]).join(", ")},"anchored list":function(e){var t=Pe(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Pe(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=((Pe(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")}};Ci.flatlist=Ci.plainlist,Ci.ublist=Ci.plainlist,Ci["unbulleted list"]=Ci["collapsible list"],Ci.ubl=Ci["collapsible list"],Ci["bare anchored list"]=Ci["anchored list"],Ci["plain list"]=Ci.plainlist,Ci.cmn=Ci["columns-list"],Ci.collist=Ci["columns-list"],Ci["col-list"]=Ci["columns-list"],Ci.columnslist=Ci["columns-list"];var qi=Ci,Ni={convert:function(e){var t=Pe(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=Pe(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Pe(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Pe(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Pe(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=Pe(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=Pe(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Pe(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=Pe(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Pe(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Pe(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=Pe(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Pe(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Pe(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Pe(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};Ni["str left"]=Ni.trunc,Ni["str crop"]=Ni.trunc,Ni.tooltip=Ni.abbr,Ni.abbrv=Ni.abbr,Ni.define=Ni.abbr,Ni.cvt=Ni.convert;var Ai=Ni,Li=Object.assign({},Si,qi,Ai);var Di=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)},Ii=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ti={s:!0,w:!0},Pi=function(e){var i=Pe(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?(Ti[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Di(n.slice(0,3)),lon:Di(n.slice(3))}:8===n.length?{lat:Di(n.slice(0,4)),lon:Di(n.slice(4))}:{});return i.lat=Ii(r.lat),i.lon=Ii(r.lon),i.template="coord",delete i.list,i},Ri={coord:function(e,t){var i=Pi(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Ri.coor=Ri.coord,Ri["coor title dms"]=Ri.coord,Ri["coor title dec"]=Ri.coord,Ri["coor dms"]=Ri.coord,Ri["coor dm"]=Ri.coord,Ri["coor dec"]=Ri.coord;var Mi=Ri,Ui={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Pe(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){Ui[e]=function(e){var t=Pe(e,["first","second"]);return t.second||t.first}})),Ui.m=Ui.mention,Ui["m-self"]=Ui.mention,Ui.l=Ui.link,Ui.ll=Ui.link,Ui["l-self"]=Ui.link;var Fi=Ui,Ki={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"},Bi={about:function(e,t){var i=Pe(e);return t.push(i),""},main:function(e,t){var i=Pe(e);return t.push(i),""},"main list":function(e,t){var i=Pe(e);return t.push(i),""},see:function(e,t){var i=Pe(e);return t.push(i),""},for:function(e,t){var i=Pe(e);return t.push(i),""},further:function(e,t){var i=Pe(e);return t.push(i),""},"further information":function(e,t){var i=Pe(e);return t.push(i),""},listen:function(e,t){var i=Pe(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Pe(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){Qi[e]=Qi["4teambracket"]}));var Xi=Qi,en={"£":"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"},tn=function(e,t){var i=Pe(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(en[n]||"").concat(i.amount||"");return i.code&&!en[i.code.toLowerCase()]&&(a+=" "+i.code),a},nn={currency:tn,monnaie:tn,"unité":tn,nombre:tn,nb:tn,iso4217:tn,inrconvert:function(e,t){var i=Pe(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(en).forEach((function(e){nn[e]=tn}));var an=nn,rn={"election box begin":function(e,t){var i=Pe(e);return t.push(i),""},"election box candidate":function(e,t){var i=Pe(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Pe(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Pe(e);return t.push(i),""}};rn["election box begin no change"]=rn["election box begin"],rn["election box begin no party"]=rn["election box begin"],rn["election box begin no party no change"]=rn["election box begin"],rn["election box inline begin"]=rn["election box begin"],rn["election box inline begin no change"]=rn["election box begin"],rn["election box candidate for alliance"]=rn["election box candidate"],rn["election box candidate minor party"]=rn["election box candidate"],rn["election box candidate no party link no change"]=rn["election box candidate"],rn["election box candidate with party link"]=rn["election box candidate"],rn["election box candidate with party link coalition 1918"]=rn["election box candidate"],rn["election box candidate with party link no change"]=rn["election box candidate"],rn["election box inline candidate"]=rn["election box candidate"],rn["election box inline candidate no change"]=rn["election box candidate"],rn["election box inline candidate with party link"]=rn["election box candidate"],rn["election box inline candidate with party link no change"]=rn["election box candidate"],rn["election box inline incumbent"]=rn["election box candidate"];var on=rn,sn=[["🇦🇩","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"]],cn={flag:function(e){var t=Pe(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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||"","]]")}};sn.forEach((function(e){cn[e[1]]=function(){return e[0]}})),cn.cr=cn.flagcountry,cn["cr-rt"]=cn.flagcountry,cn.cricon=cn.flagicon;var un=cn,ln=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===q.hasOwnProperty(t[1])?q[t[1]].english_title:t[1]:null},pn={ipa:function(e,t){var i=Pe(e,["transcription","lang","audio"]);return i.lang=ln(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Pe(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=ln(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Pe(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){pn["ipa-"+e]=pn.ipa,pn["ipac-"+e]=pn.ipac}));var mn=pn,dn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Pe(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){dn["lang-"+e]=dn["lang-de"]})),dn.nihongo2=dn.nihongo,dn.nihongo3=dn.nihongo,dn["nihongo-s"]=dn.nihongo,dn["nihongo foot"]=dn.nihongo;var fn=dn,gn=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)},hn={math:function(e,t){var i=Pe(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Pe(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=Pe(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Pe(e,["numerator","denominator","decimals"]),i=gn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Pe(e,["done","total","digits"]),i=gn({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=Pe(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=gn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Pe(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=gn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};hn.sfrac=hn.frac,hn.sqrt=hn.radic,hn.pct=hn.percentage,hn.percent=hn.percentage,hn.winpct=hn["winning percentage"],hn.winperc=hn["winning percentage"];var bn=hn,kn=function(e,t,i){var n=Pe(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},wn={persondata:kn,taxobox:kn,citation:kn,portal:kn,reflist:kn,"cite book":kn,"cite journal":kn,"cite web":kn,"commons cat":kn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Pe(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Pe(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=Pe(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=Pe(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Wn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Yn={text:function(){return""},json:function(){return this.data}};Object.keys(Yn).forEach((function(e){Wn.prototype[e]=Yn[e]}));var Zn=Wn,Gn=new RegExp("^(cite |citation)","i"),Hn={citation:!0,refn:!0,harvnb:!0},Vn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Jn=function(e){var t=e.wiki,i=Xt(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=Bn(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===Hn[e.template]||!0===Gn.test(e.template)}(t)?(e.references.push(new Ue(t)),!1):!0!==Vn(t)||(e.infoboxes.push(new Zt(t)),!1)})),e.templates=e.templates.map((function(e){return new Zn(e)})),i.forEach((function(e){t=t.replace(e.body,e.out)})),e.wiki=t},Qn=Oe,Xn=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=Qn(a)),n}))).length>0&&e.templates.push({template:"gallery",images:a,pos:e.title}),""})),e.wiki=t},ea=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:[]};Jn(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},ta={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"]},ia=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="! "+ta[i].join(" !! "),a=ot("{|\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},na=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=ot("{|\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},aa=["res","record","opponent","method","event","date","round","time","location","notes"],ra=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="! "+aa.join(" !! "),n=ot("{|\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},oa=Oe,sa=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=oa(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},ca=function(e){ea(e),Xn(e),sa(e),na(e),ra(e),ia(e)},ua=new RegExp("^("+C.references.join("|")+"):?","i"),la=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,pa={heading:He,table:ft,paragraphs:Ft,templates:Jn,references:Ye,startEndTemplates:ca},ma=function(e,t){return pa.startEndTemplates(e),pa.references(e),pa.templates(e),pa.table(e),pa.paragraphs(e,t),e=new ae(e)},da=function(e){for(var t=[],i=e.wiki.split(la),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},fa=new RegExp("\\[\\[:?("+C.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),ga=new RegExp("^\\[\\[:?("+C.categories.join("|")+"):","ig"),ha={section:da,categories:function(e){var t=e.wiki,i=t.match(fa);i&&i.forEach((function(t){(t=(t=(t=t.replace(ga,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(fa,""),e.wiki=t}},ba=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),ha.categories(i),new S(i)):(H(i),ha.categories(i),ha.section(i),new S(i))},ka=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return ba(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},wa=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},va=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"}},ya=/^https?:\/\//,xa={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},$a=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({},xa,i)).title=t,ya.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=va(i);return wa(r,o).then((function(e){try{var t=u(e,i);return t=ka(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},ja={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},za=function(e,t){var i;t=t||{},t=Object.assign({},ja,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=va(t);return wa(n,a).then((function(e){try{var t=u(e);return ka(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},Oa={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Ea=function(e,t,i){var n;i=i||{},i=Object.assign({},Oa,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=va(i);return wa(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)}))},_a=function(e,t){return ba(e,t)},Sa={Doc:S,Section:ae,Paragraph:vt,Sentence:be,Image:z,Infobox:Zt,Link:ue,List:qt,Reference:Ue,Table:pt,Template:Zn,http:wa,wtf:_a};_a.fetch=function(e,t,i,n){return $a(e,t,i)},_a.random=function(e,t,i){return za(e,t)},_a.category=function(e,t,i,n){return Ea(e,t,i)},_a.extend=function(e){return e(Sa,Un,this),this},_a.version="8.2.0";var Ca=_a;export default Ca; +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,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),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"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=/ c\. $/,$e=new RegExp("[a-zа-яぁ-ゟ][a-zа-яぁ-ゟ゠-ヿ]","iu"),je=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 ze(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 Oe=ze,Ee=function(e){var t=je(e.wiki);(t=t.map(ze))[0]&&t[0].text()&&":"===t[0].text()[0]&&(t=t.slice(1)),e.sentences=t},_e=function(e){return e=(e=e.replace(/^\{\{/,"")).replace(/\}\}$/,"")},Se=function(e){return e=(e=(e=(e||"").trim()).toLowerCase()).replace(/_/g," ")},Ce=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},qe=/^[ '-\)\x2D\.0-9_a-z\xC0-\xFF\u0153\u017F\u1E9E\u212A\u212B]+=/i,Ne={template:!0,list:!0,prototype:!0},Ae=function(e,t){var i=0;return e.reduce((function(e,n){if(n=(n||"").trim(),!0===qe.test(n)){var a=function(e){var t=e.split("="),i=t[0]||"";i=i.toLowerCase().trim();var n=t.slice(1).join("=");return Ne.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}),{})},Le={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},De=function(e){return Object.keys(e).forEach((function(t){!0===Le[t.toLowerCase()]&&delete e[t],null!==e[t]&&""!==e[t]||delete e[t]})),e},Ie=Oe,Te=function(e,t){var i=Ie(e);return"json"===t?i.json():"raw"===t?i:i.text()},Pe=function(e,t,i){t=t||[],e=_e(e||"");var n=Ce(e),a=n.shift(),r=Ae(n,t);return(r=De(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?Te(r[e],i):r[e].map((function(e){return Te(e,i)}))})),a&&(r.template=Se(a)),r},Re=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Me={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(Me).forEach((function(e){Re.prototype[e]=Me[e]}));var Ue=Re,Fe=Oe,Ke=function(e){return/^ *?\{\{ *?(cite|citation)/i.test(e)&&/\}\} *?$/.test(e)&&!1===/citation needed/i.test(e)},Be=function(e){var t=Pe(e);return t.type=t.template.replace(/cite /,""),t.template="citation",t},We=function(e){return{template:"citation",type:"inline",data:{},inline:Fe(e)||{}}},Ye=function(e){var t=[],i=e.wiki;i=(i=(i=(i=i.replace(/ ?([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?]{0,200}?\/> ?/gi," ")).replace(/ ?]{0,200}?>([\s\S]{0,1800}?)<\/ref> ?/gi,(function(e,n){if(Ke(n)){var a=Be(n);a&&t.push(a),i=i.replace(n,"")}else t.push(We(n));return" "}))).replace(/ ?<[ \/]?[a-z0-9]{1,8}[a-z0-9=" ]{2,20}[ \/]?> ?/g," "),e.references=t.map((function(e){return new Ue(e)})),e.wiki=i},Ze=Oe,Ge=/^(={1,5})(.{1,200}?)={1,5}$/,He=function(e,t){var i=t.match(Ge);if(!i)return e.title="",e.depth=0,e;var n=i[2]||"",a={wiki:n=(n=Ze(n).text()).replace(/\{\{.+?\}\}/,"")};Ye(a),n=re(n=a.wiki);var r=0;return i[1]&&(r=i[1].length-2),e.title=n,e.depth=r,e},Ve=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},Je=/.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/,Qe=/.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/,Xe=function(e){return e=function(e){return e.forEach((function(t,i){t.forEach((function(n,a){var r=n.match(Je);if(null!==r){var o=parseInt(r[1],10);n=n.replace(Je,""),t[a]=n;for(var s=i+1;s0}))}(e))},et=Oe,tt=/^!/,it={name:!0,age:!0,born:!0,date:!0,year:!0,city:!0,country:!0,population:!0,count:!0,number:!0},nt=function(e){return(e=et(e).text()).match(/\|/)&&(e=e.replace(/.+\| ?/,"")),e=(e=(e=e.replace(/style=['"].*?["']/,"")).replace(/^!/,"")).trim()},at=function(e){return(e=e||[]).length-e.filter((function(e){return e})).length>3},rt=function(e){if(e.length<=3)return[];var t=e[0].slice(0);t=t.map((function(e){return e=e.replace(/^\! */,""),e=et(e).text(),e=(e=nt(e)).toLowerCase()}));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=[];at(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=nt(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=nt(e),!0===Boolean(e)&&(t[i]=e)})),e.shift()),t}(i=Xe(i));if(!n||n.length<=1){n=rt(i);var a=i[i.length-1]||[];n.length<=1&&a.length>2&&(n=rt(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=et(e);r.text(nt(r.text())),i[a]=r})),i}(e,n)}))},st=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}))},ct={},ut=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},lt={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,ct),st(this.data,e)},text:function(){return""}};lt.keyvalue=lt.keyValue,lt.keyval=lt.keyValue,Object.keys(lt).forEach((function(e){ut.prototype[e]=lt[e]}));var pt=ut,mt=/^\s*{\|/,dt=/^\s*\|}/,ft=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=ot(e);t&&t.length>0&&s.push(new pt(t))}})),s.length>0&&(e.tables=s),e.wiki=i},gt={sentences:!0},ht=function(e,t){var i={};return!0===(t=p(t,gt)).sentences&&(i.sentences=e.sentences().map((function(e){return e.json(t)}))),i},bt={sentences:!0,lists:!0,images:!0},kt=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},wt={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,bt);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,bt),ht(this,e)}};wt.citations=wt.references,Object.keys(wt).forEach((function(e){kt.prototype[e]=wt[e]}));var vt=kt;var yt=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},xt=Oe,$t=new RegExp("("+C.images.join("|")+"):","i"),jt="(".concat(C.images.join("|"),")"),zt=new RegExp(jt+":(.+?)[\\||\\]]","iu"),Ot={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},Et=function(e){var t=e.wiki;yt(t).forEach((function(i){if(!0===$t.test(i)){e.images=e.images||[];var n=function(e){var t=e.match(zt);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=Pe(e),o=r.list||[];return r.alt&&(a.alt=r.alt),(o=o.filter((function(e){return!1===Ot.hasOwnProperty(e)})))[o.length-1]&&(a.caption=xt(o[o.length-1])),new z(a,e)}return null}(i);n&&e.images.push(n),t=t.replace(i,"")}})),e.wiki=t},_t={},St=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Ct={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,_t),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(Ct).forEach((function(e){St.prototype[e]=Ct[e]}));var qt=St,Nt=Oe,At=/^[#\*:;\|]+/,Lt=/^\*+[^:,\|]{4}/,Dt=/^ ?\#[^:,\|]{4}/,It=/[a-z_0-9\]\}]/i,Tt=function(e){return At.test(e)||Lt.test(e)||Dt.test(e)},Pt=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 qt(e)})),e.wiki=n.join("\n")}},Ft=function(e){var t=e.wiki,i=t.split(Mt);i=(i=i.filter((function(e){return e&&e.trim().length>0}))).map((function(e){var t={wiki:e,lists:[],sentences:[],images:[]};return Ut.list(t),Ut.image(t),Rt(t),new vt(t)})),e.wiki=t,e.paragraphs=i},Kt=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},Bt=function(e){return(e=(e=e.toLowerCase()).replace(/[-_]/g," ")).trim()},Wt=function(e){this._type=e.type,Object.defineProperty(this,"data",{enumerable:!1,value:e.data})},Yt={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=Bt(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},Ht=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=Se(t)),t||null},Vt=/\{\{/,Jt=function(e){return{body:e=e.replace(/#invoke:/,""),name:Ht(e),children:[]}},Qt=function e(t){var i=t.body.substr(2);return i=i.replace(/\}\}$/,""),t.children=Gt(i),t.children=t.children.map(Jt),0===t.children.length||t.children.forEach((function(t){var i=t.body.substr(2);return Vt.test(i)?e(t):null})),t},Xt=function(e){var t=Gt(e);return t=(t=t.map(Jt)).map(Qt)},ei=["anchor","defaultsort","use list-defined references","void","pp","pp-move-indef","pp-semi-indef","pp-vandalism","r","#tag","div col","pope list end","shipwreck list end","starbox end","end box","end","s-end"].reduce((function(e,t){return e[t]=!0,e}),{}),ti=new RegExp("^(subst.)?("+C.infoboxes.join("|")+")[: \n]","i"),ii=/^infobox /i,ni=/ infobox$/i,ai=/$Year in [A-Z]/i,ri={"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,"pro hockey team":!0,"hockey team player":!0,"hockey team start":!0,mlbbioret:!0},oi=function(e){return!0===ri.hasOwnProperty(e)||(!!ti.test(e)||(!(!ii.test(e)&&!ni.test(e))||!!ai.test(e)))},si=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.template.match(ti),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},ci=[void 0,"January","February","March","April","May","June","July","August","September","October","November","December"],ui=ci.reduce((function(e,t,i){return 0===i||(e[t.toLowerCase()]=i),e}),{}),li=function(e){return e<10?"0"+e:String(e)},pi=function(e){var t=String(e.year||"");if(void 0!==e.month&&!0===ci.hasOwnProperty(e.month))if(void 0===e.date)t="".concat(ci[e.month]," ").concat(e.year);else{if(t="".concat(ci[e.month]," ").concat(e.date,", ").concat(e.year),void 0!==e.hour&&void 0!==e.minute){var i="".concat(li(e.hour),":").concat(li(e.minute));void 0!==e.second&&(i=i+":"+li(e.second)),t=i+", "+t}e.tz&&(t+=" (".concat(e.tz,")"))}return t},mi=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},hi=mi,bi=pi,ki=function(e){return{template:"date",data:e}},wi=function(e){var t=(e=_e(e)).split("|"),i=hi(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=hi(n)}},vi={date:function(e,t){var i=Pe(e,["year","month","date","hour","minute","second","timezone"]),n=hi([i.year,i.month,i.date||i.day]);return i.text=bi(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(ki(i)),i.text},natural_date:function(e,t){var i=Pe(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(ki(n)),i.trim()},one_year:function(e,t){var i=Pe(e,["year"]),n=Number(i.year);return t.push(ki({year:n})),String(n)},two_dates:function(e,t){var i=Pe(e,["b","birth_year","birth_month","birth_date","death_year","death_month","death_date"]);if(i.b&&"b"===i.b.toLowerCase()){var n=hi([i.birth_year,i.birth_month,i.birth_date]);return t.push(ki(n)),bi(n)}var a=hi([i.death_year,i.death_month,i.death_date]);return t.push(ki(a)),bi(a)},age:function(e){var t=wi(e);return gi(t.from,t.to).years||0},"diff-y":function(e){var t=wi(e),i=gi(t.from,t.to);return 1===i.years?i.years+" year":(i.years||0)+" years"},"diff-ym":function(e){var t=wi(e),i=gi(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=wi(e),i=gi(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=wi(e),i=gi(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=wi(e),i=gi(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(", ")}},yi=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},xi=vi.date,$i=vi.natural_date,ji=["January","February","March","April","May","June","July","August","September","October","November","December"],zi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Oi=Object.assign({},di,{currentday:function(){var e=new Date;return String(e.getDate())},currentdayname:function(){var e=new Date;return zi[e.getDay()]},currentmonth:function(){var e=new Date;return ji[e.getMonth()]},currentyear:function(){var e=new Date;return String(e.getFullYear())},monthyear:function(){var e=new Date;return ji[e.getMonth()]+" "+e.getFullYear()},"monthyear-1":function(){var e=new Date;return e.setMonth(e.getMonth()-1),ji[e.getMonth()]+" "+e.getFullYear()},"monthyear+1":function(){var e=new Date;return e.setMonth(e.getMonth()+1),ji[e.getMonth()]+" "+e.getFullYear()},date:0,"time ago":function(e){var t=Pe(e,["date","fmt"]).date;return yi(t)},"birth date and age":function(e,t){var i=Pe(e,["year","month","day"]);return i.year&&/[a-z]/i.test(i.year)?$i(e,t):(t.push(i),i=mi([i.year,i.month,i.day]),pi(i))},"birth year and age":function(e,t){var i=Pe(e,["birth_year","birth_month"]);if(i.death_year&&/[a-z]/i.test(i.death_year))return $i(e,t);t.push(i);var n=(new Date).getFullYear()-parseInt(i.birth_year,10);i=mi([i.birth_year,i.birth_month]);var a=pi(i);return n&&(a+=" (age ".concat(n,")")),a},"death year and age":function(e,t){var i=Pe(e,["death_year","birth_year","death_month"]);return i.death_year&&/[a-z]/i.test(i.death_year)?$i(e,t):(t.push(i),i=mi([i.death_year,i.death_month]),pi(i))},"birth date and age2":function(e,t){var i=Pe(e,["at_year","at_month","at_day","birth_year","birth_month","birth_day"]);return t.push(i),i=mi([i.birth_year,i.birth_month,i.birth_day]),pi(i)},"birth based on age as of date":function(e,t){var i=Pe(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=Pe(e,["year","month","day","age"]);t.push(i),i=mi([i.year,i.month,i.day]);var n=pi(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=Pe(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:xi,end:xi,birth:xi,death:xi,"start date":xi,"end date":xi,"birth date":xi,"death date":xi,"start date and age":xi,"end date and age":xi,"start-date":$i,"end-date":$i,"birth-date":$i,"death-date":$i,"birth-date and age":$i,"birth-date and given age":$i,"death-date and age":$i,"death-date and given age":$i,birthdeathage:vi.two_dates,dob:xi,age:vi.age,"age nts":vi.age,"age in years":vi["diff-y"],"age in years and months":vi["diff-ym"],"age in years, months and days":vi["diff-ymd"],"age in years and days":vi["diff-yd"],"age in days":vi["diff-d"]});Oi.localday=Oi.currentday,Oi.localdayname=Oi.currentdayname,Oi.localmonth=Oi.currentmonth,Oi.localyear=Oi.currentyear,Oi.currentmonthname=Oi.currentmonth,Oi.currentmonthabbrev=Oi.currentmonth,Oi["death date and age"]=Oi["birth date and age"],Oi.bda=Oi["birth date and age"],Oi["birth date based on age at death"]=Oi["birth based on age as of date"];var Ei=Oi,_i={tag:function(e){var t=Pe(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=Pe(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=Pe(e,["text"]),i=t.text;return t.sep?i.split(t.sep)[0]:i.split(" ")[0]},trunc:function(e){var t=Pe(e,["str","len"]);return t.str.substr(0,t.len)},"str mid":function(e){var t=Pe(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=Pe(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=Pe(e);return t.push(i),i.code||""},samp:function(e,t){var i=Pe(e,["1"]);return t.push(i),i[1]||""},vanchor:0,resize:1,ra:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},deg2hms:function(e){return(Pe(e,["degrees"]).degrees||"")+"°"},hms2deg:function(e){var t=Pe(e,["hours","minutes","seconds"]);return[t.hours||0,t.minutes||0,t.seconds||0].join(":")},decdeg:function(e){var t=Pe(e,["deg","min","sec","hem","rnd"]);return(t.deg||t.degrees)+"°"},rnd:0,dec:function(e){var t=Pe(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=Pe(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}};_i.rndfrac=_i.rnd,_i.rndnear=_i.rnd,_i["unité"]=_i.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){_i[e]=function(e){return Pe(e,["text"]).text||""}}));var Si=_i,Ci={plainlist:function(e){var t=(e=_e(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=Pe(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=Pe(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=Pe(e);return t.list=t.list||[],t.list.join(" · ")},pagelist:function(e){return(Pe(e).list||[]).join(", ")},catlist:function(e){return(Pe(e).list||[]).join(", ")},"br separated entries":function(e){return(Pe(e).list||[]).join("\n\n")},"comma separated entries":function(e){return(Pe(e).list||[]).join(", ")},"anchored list":function(e){var t=Pe(e).list||[];return(t=t.map((function(e,t){return"".concat(t+1,". ").concat(e)}))).join("\n\n")},"bulleted list":function(e){var t=Pe(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=((Pe(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")}};Ci.flatlist=Ci.plainlist,Ci.ublist=Ci.plainlist,Ci["unbulleted list"]=Ci["collapsible list"],Ci.ubl=Ci["collapsible list"],Ci["bare anchored list"]=Ci["anchored list"],Ci["plain list"]=Ci.plainlist,Ci.cmn=Ci["columns-list"],Ci.collist=Ci["columns-list"],Ci["col-list"]=Ci["columns-list"],Ci.columnslist=Ci["columns-list"];var qi=Ci,Ni={convert:function(e){var t=Pe(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=Pe(e,["term"]);return"".concat(t.term,":")},defn:0,lino:0,linum:function(e){var t=Pe(e,["num","text"]);return"".concat(t.num,". ").concat(t.text)},ill:function(e){return Pe(e,["text","lan1","text1","lan2","text2"]).text},frac:function(e){var t=Pe(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=Pe(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=Pe(e);return t[1]?"\n"+t[1]+"\n":""},quote:function(e,t){var i=Pe(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=Pe(e,["text"]);return"[[".concat(t.text," Lifeboat Station|").concat(t.text,"]]")},lbc:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"-class]]")},lbb:function(e){var t=Pe(e,["text"]);return"[[".concat(t.text,"-class lifeboat|").concat(t.text,"]]")},own:function(e){var t=Pe(e,["author"]),i="Own work";return t.author&&(i+=" by "+t.author),i},sic:function(e,t){var i=Pe(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=Pe(e,["number"]).number||"";return t=t.replace(/,/g,""),Number(t).toLocaleString()||""},"#dateformat":function(e){return e=e.replace(/:/,"|"),Pe(e,["date","format"]).date},lc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toLowerCase()},lcfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toLowerCase()+t.substr(1):""},uc:function(e){return e=e.replace(/:/,"|"),(Pe(e,["text"]).text||"").toUpperCase()},ucfirst:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text"]).text;return t?t[0].toUpperCase()+t.substr(1):""},padleft:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padStart(t.num,t.str||"0")},padright:function(e){e=e.replace(/:/,"|");var t=Pe(e,["text","num"]);return(t.text||"").padEnd(t.num,t.str||"0")},abbr:function(e){return Pe(e,["abbr","meaning","ipa"]).abbr},abbrlink:function(e){var t=Pe(e,["abbr","page"]);return t.page?"[[".concat(t.page,"|").concat(t.abbr,"]]"):"[[".concat(t.abbr,"]]")},h:1,finedetail:0,sort:1};Ni["str left"]=Ni.trunc,Ni["str crop"]=Ni.trunc,Ni.tooltip=Ni.abbr,Ni.abbrv=Ni.abbr,Ni.define=Ni.abbr,Ni.cvt=Ni.convert;var Ai=Ni,Li=Object.assign({},Si,qi,Ai);var Di=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)},Ii=function(e){if("number"!=typeof e)return e;return Math.round(1e5*e)/1e5},Ti={s:!0,w:!0},Pi=function(e){var i=Pe(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?(Ti[n[1].toLowerCase()]&&(n[0]*=-1),"w"===n[3].toLowerCase()&&(n[2]*=-1),{lat:n[0],lon:n[2]}):6===n.length?{lat:Di(n.slice(0,3)),lon:Di(n.slice(3))}:8===n.length?{lat:Di(n.slice(0,4)),lon:Di(n.slice(4))}:{});return i.lat=Ii(r.lat),i.lon=Ii(r.lon),i.template="coord",delete i.list,i},Ri={coord:function(e,t){var i=Pi(e);return t.push(i),i.display&&-1===i.display.indexOf("inline")?"":"".concat(i.lat||"","°N, ").concat(i.lon||"","°W")},geo:["lat","lon","zoom"]};Ri.coor=Ri.coord,Ri["coor title dms"]=Ri.coord,Ri["coor title dec"]=Ri.coord,Ri["coor dms"]=Ri.coord,Ri["coor dm"]=Ri.coord,Ri["coor dec"]=Ri.coord;var Mi=Ri,Ui={etyl:1,mention:1,link:1,"la-verb-form":0,"la-ipa":0,sortname:function(e){var t=Pe(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){Ui[e]=function(e){var t=Pe(e,["first","second"]);return t.second||t.first}})),Ui.m=Ui.mention,Ui["m-self"]=Ui.mention,Ui.l=Ui.link,Ui.ll=Ui.link,Ui["l-self"]=Ui.link;var Fi=Ui,Ki={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"},Bi={about:function(e,t){var i=Pe(e);return t.push(i),""},main:function(e,t){var i=Pe(e);return t.push(i),""},"main list":function(e,t){var i=Pe(e);return t.push(i),""},see:function(e,t){var i=Pe(e);return t.push(i),""},for:function(e,t){var i=Pe(e);return t.push(i),""},further:function(e,t){var i=Pe(e);return t.push(i),""},"further information":function(e,t){var i=Pe(e);return t.push(i),""},listen:function(e,t){var i=Pe(e);return t.push(i),""},"wide image":["file","width","caption"],redirect:function(e,t){for(var i=Pe(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){Qi[e]=Qi["4teambracket"]}));var Xi=Qi,en={"£":"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"},tn=function(e,t){var i=Pe(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(en[n]||"").concat(i.amount||"");return i.code&&!en[i.code.toLowerCase()]&&(a+=" "+i.code),a},nn={currency:tn,monnaie:tn,"unité":tn,nombre:tn,nb:tn,iso4217:tn,inrconvert:function(e,t){var i=Pe(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(en).forEach((function(e){nn[e]=tn}));var an=nn,rn={"election box begin":function(e,t){var i=Pe(e);return t.push(i),""},"election box candidate":function(e,t){var i=Pe(e);return t.push(i),""},"election box hold with party link":function(e,t){var i=Pe(e);return t.push(i),""},"election box gain with party link":function(e,t){var i=Pe(e);return t.push(i),""}};rn["election box begin no change"]=rn["election box begin"],rn["election box begin no party"]=rn["election box begin"],rn["election box begin no party no change"]=rn["election box begin"],rn["election box inline begin"]=rn["election box begin"],rn["election box inline begin no change"]=rn["election box begin"],rn["election box candidate for alliance"]=rn["election box candidate"],rn["election box candidate minor party"]=rn["election box candidate"],rn["election box candidate no party link no change"]=rn["election box candidate"],rn["election box candidate with party link"]=rn["election box candidate"],rn["election box candidate with party link coalition 1918"]=rn["election box candidate"],rn["election box candidate with party link no change"]=rn["election box candidate"],rn["election box inline candidate"]=rn["election box candidate"],rn["election box inline candidate no change"]=rn["election box candidate"],rn["election box inline candidate with party link"]=rn["election box candidate"],rn["election box inline candidate with party link no change"]=rn["election box candidate"],rn["election box inline incumbent"]=rn["election box candidate"];var on=rn,sn=[["🇦🇩","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"]],cn={flag:function(e){var t=Pe(e,["flag","variant"]),i=t.flag||"";t.flag=(t.flag||"").toLowerCase();var n=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);return t.flag=(t.flag||"").toLowerCase(),(sn.find((function(e){return t.flag===e[1]||t.flag===e[2]}))||[])[0]||""},fb:function(e){var t=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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=Pe(e,["name","flag","variant"]);t.flag=(t.flag||"").toLowerCase();var i=sn.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||"","]]")}};sn.forEach((function(e){cn[e[1]]=function(){return e[0]}})),cn.cr=cn.flagcountry,cn["cr-rt"]=cn.flagcountry,cn.cricon=cn.flagicon;var un=cn,ln=function(e){var t=e.match(/ipac?-(.+)/);return null!==t?!0===q.hasOwnProperty(t[1])?q[t[1]].english_title:t[1]:null},pn={ipa:function(e,t){var i=Pe(e,["transcription","lang","audio"]);return i.lang=ln(i.template),i.template="ipa",t.push(i),""},ipac:function(e,t){var i=Pe(e);return i.transcription=(i.list||[]).join(","),delete i.list,i.lang=ln(i.template),i.template="ipac",t.push(i),""},transl:function(e,t){var i=Pe(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){pn["ipa-"+e]=pn.ipa,pn["ipac-"+e]=pn.ipac}));var mn=pn,dn={lang:1,"lang-de":0,"rtl-lang":1,taste:0,nihongo:function(e,t){var i=Pe(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){dn["lang-"+e]=dn["lang-de"]})),dn.nihongo2=dn.nihongo,dn.nihongo3=dn.nihongo,dn["nihongo-s"]=dn.nihongo,dn["nihongo foot"]=dn.nihongo;var fn=dn,gn=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)},hn={math:function(e,t){var i=Pe(e,["formula"]);return t.push(i),"\n\n"+(i.formula||"")+"\n\n"},frac:function(e,t){var i=Pe(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=Pe(e,["after","before"]);return"".concat(t.before||"","√").concat(t.after||"")},percentage:function(e){var t=Pe(e,["numerator","denominator","decimals"]),i=gn(t);return null===i?"":i+"%"},"percent-done":function(e){var t=Pe(e,["done","total","digits"]),i=gn({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=Pe(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=gn({numerator:n,denominator:o,decimals:1});return null===s?"":".".concat(10*s)},winlosspct:function(e,t){var i=Pe(e,["wins","losses"]);t.push(i);var n=Number(i.wins),a=Number(i.losses),r=gn({numerator:n,denominator:n+a,decimals:1});return null===r?"":(r=".".concat(10*r),"".concat(n||0," || ").concat(a||0," || ").concat(r||"-"))}};hn.sfrac=hn.frac,hn.sqrt=hn.radic,hn.pct=hn.percentage,hn.percent=hn.percentage,hn.winpct=hn["winning percentage"],hn.winperc=hn["winning percentage"];var bn=hn,kn=function(e,t,i){var n=Pe(e);return i&&(n.name=n.template,n.template=i),t.push(n),""},wn={persondata:kn,taxobox:kn,citation:kn,portal:kn,reflist:kn,"cite book":kn,"cite journal":kn,"cite web":kn,"commons cat":kn,"portuguese name":["first","second","suffix"],uss:["ship","id"],isbn:function(e,t){var i=Pe(e,["id","id2","id3"]);return t.push(i),"ISBN: "+(i.id||"")},marriage:function(e,t){var i=Pe(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=Pe(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=Pe(e,i),a={template:"video game release",releases:[]},r=0;r0&&t.push(c),""},Wn=function(e){Object.defineProperty(this,"data",{enumerable:!1,value:e})},Yn={text:function(){return""},json:function(){return this.data}};Object.keys(Yn).forEach((function(e){Wn.prototype[e]=Yn[e]}));var Zn=Wn,Gn=new RegExp("^(cite |citation)","i"),Hn={citation:!0,refn:!0,harvnb:!0},Vn=function(e){return"infobox"===e.template&&e.data&&function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)}(e.data)},Jn=function(e){var t=e.wiki,i=Xt(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=Bn(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===Hn[e.template]||!0===Gn.test(e.template)}(t)?(e.references.push(new Ue(t)),!1):!0!==Vn(t)||(e.infoboxes.push(new Zt(t)),!1)})),e.templates=e.templates.map((function(e){return new Zn(e)})),i.forEach((function(e){t=t.replace(e.body,e.out)})),e.wiki=t},Qn=Oe,Xn=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=Qn(a)),n}))).length>0&&e.templates.push({template:"gallery",images:a,pos:e.title}),""})),e.wiki=t},ea=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:[]};Jn(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},ta={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"]},ia=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="! "+ta[i].join(" !! "),a=ot("{|\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},na=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=ot("{|\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},aa=["res","record","opponent","method","event","date","round","time","location","notes"],ra=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="! "+aa.join(" !! "),n=ot("{|\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},oa=Oe,sa=function(e){var t=e.wiki;t=(t=t.replace(/]*?)>([\s\S]+?)<\/math>/g,(function(t,i,n){var a=oa(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},ca=function(e){ea(e),Xn(e),sa(e),na(e),ra(e),ia(e)},ua=new RegExp("^("+C.references.join("|")+"):?","i"),la=/(?:\n|^)(={2,5}.{1,200}?={2,5})/g,pa={heading:He,table:ft,paragraphs:Ft,templates:Jn,references:Ye,startEndTemplates:ca},ma=function(e,t){return pa.startEndTemplates(e),pa.references(e),pa.templates(e),pa.table(e),pa.paragraphs(e,t),e=new ae(e)},da=function(e){for(var t=[],i=e.wiki.split(la),n=0;n0||(t.templates().length>0||(e[i+1]&&e[i+1].depth>t.depth&&(e[i+1].depth-=1),!1)))}))}(t)},fa=new RegExp("\\[\\[:?("+C.categories.join("|")+"):(.{2,178}?)]](w{0,10})","ig"),ga=new RegExp("^\\[\\[:?("+C.categories.join("|")+"):","ig"),ha={section:da,categories:function(e){var t=e.wiki,i=t.match(fa);i&&i.forEach((function(t){(t=(t=(t=t.replace(ga,"")).replace(/\|?[ \*]?\]\]$/i,"")).replace(/\|.*/,""))&&!t.match(/[\[\]]/)&&e.categories.push(t.trim())})),t=t.replace(fa,""),e.wiki=t}},ba=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),ha.categories(i),new S(i)):(H(i),ha.categories(i),ha.section(i),new S(i))},ka=function(e){var t=(e=e.filter((function(e){return e}))).map((function(e){return ba(e.wiki,e.meta)}));return 0===t.length?null:1===t.length?t[0]:t},wa=function(e,t){return fetch(e,t).then((function(e){return e.json()}))},va=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"}},ya=/^https?:\/\//,xa={lang:"en",wiki:"wikipedia",domain:null,follow_redirects:!0,path:"api.php"},$a=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({},xa,i)).title=t,ya.test(t)&&(i=Object.assign(i,e(t)));var r=c(i),o=va(i);return wa(r,o).then((function(e){try{var t=u(e,i);return t=ka(t),a&&a(null,t),t}catch(e){throw e}})).catch((function(e){return console.error(e),a&&a(e,null),null}))},ja={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},za=function(e,t){var i;t=t||{},t=Object.assign({},ja,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=va(t);return wa(n,a).then((function(e){try{var t=u(e);return ka(t)}catch(e){throw e}})).catch((function(e){return console.error(e),null}))},Oa={lang:"en",wiki:"wikipedia",domain:null,path:"w/api.php"},Ea=function(e,t,i){var n;i=i||{},i=Object.assign({},Oa,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=va(i);return wa(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)}))},_a=function(e,t){return ba(e,t)},Sa={Doc:S,Section:ae,Paragraph:vt,Sentence:be,Image:z,Infobox:Zt,Link:ue,List:qt,Reference:Ue,Table:pt,Template:Zn,http:wa,wtf:_a};_a.fetch=function(e,t,i,n){return $a(e,t,i)},_a.random=function(e,t,i){return za(e,t)},_a.category=function(e,t,i,n){return Ea(e,t,i)},_a.extend=function(e){return e(Sa,Un,this),this},_a.version="8.2.1";var Ca=_a;export default Ca; diff --git a/builds/wtf_wikipedia.js b/builds/wtf_wikipedia.js index 3318e3d3..e584c44e 100644 --- a/builds/wtf_wikipedia.js +++ b/builds/wtf_wikipedia.js @@ -1,4 +1,4 @@ -/* wtf_wikipedia 8.2.0 MIT */ +/* wtf_wikipedia 8.2.1 MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('https')) : typeof define === 'function' && define.amd ? define(['https'], factory) : @@ -699,7 +699,7 @@ title = title.replace(/ /g, '_'); title = encodeURIComponent(title); - return "https://".concat(lang, ".").concat(domain, ".org/wiki/").concat(title); + return "https://".concat(lang, ".").concat(domain, "/wiki/").concat(title); }, namespace: function namespace(ns) { if (ns !== undefined) { @@ -4786,6 +4786,8 @@ var hasTemplate = /\{\{/; var parseTemplate = function parseTemplate(tmpl) { + // this is some unexplained Lua thing + tmpl = tmpl.replace(/#invoke:/, ''); return { body: tmpl, name: _getName(tmpl), @@ -8840,7 +8842,7 @@ var category = fetchCategory; - var _version = '8.2.0'; + var _version = '8.2.1'; var wtf = function wtf(wiki, options) { return _01Document(wiki, options); diff --git a/builds/wtf_wikipedia.mjs b/builds/wtf_wikipedia.mjs index c193b189..e9b0ced2 100644 --- a/builds/wtf_wikipedia.mjs +++ b/builds/wtf_wikipedia.mjs @@ -1,4 +1,4 @@ -/* wtf_wikipedia 8.2.0 MIT */ +/* wtf_wikipedia 8.2.1 MIT */ import https from 'https'; var parseUrl = function parseUrl(url) { @@ -693,7 +693,7 @@ var methods$1 = { title = title.replace(/ /g, '_'); title = encodeURIComponent(title); - return "https://".concat(lang, ".").concat(domain, ".org/wiki/").concat(title); + return "https://".concat(lang, ".").concat(domain, "/wiki/").concat(title); }, namespace: function namespace(ns) { if (ns !== undefined) { @@ -4780,6 +4780,8 @@ var _getName = getName; var hasTemplate = /\{\{/; var parseTemplate = function parseTemplate(tmpl) { + // this is some unexplained Lua thing + tmpl = tmpl.replace(/#invoke:/, ''); return { body: tmpl, name: _getName(tmpl), @@ -8834,7 +8836,7 @@ var fetchCategory = function fetchCategory(category, lang, options) { var category = fetchCategory; -var _version = '8.2.0'; +var _version = '8.2.1'; var wtf = function wtf(wiki, options) { return _01Document(wiki, options); diff --git a/package-lock.json b/package-lock.json index 7da9261b..c064d516 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "wtf_wikipedia", - "version": "8.1.2", + "version": "8.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1060,6 +1060,21 @@ "picomatch": "^2.0.4" } }, + "array-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", + "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", + "dev": true + }, + "available-typed-arrays": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz", + "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==", + "dev": true, + "requires": { + "array-filter": "^1.0.0" + } + }, "babel-plugin-dynamic-import-node": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz", @@ -1082,9 +1097,9 @@ "dev": true }, "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -1233,17 +1248,33 @@ } }, "deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.3.tgz", + "integrity": "sha512-Spqdl4H+ky45I9ByyJtXteOm9CaIrPmnIPmOhrkKGNYWeDgCvJ8jNYVCTjChxW4FqGuZnLHADc8EKRMX6+CgvA==", "dev": true, "requires": { + "es-abstract": "^1.17.5", + "es-get-iterator": "^1.1.0", "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", + "is-date-object": "^1.0.2", + "is-regex": "^1.0.5", + "isarray": "^2.0.5", + "object-is": "^1.1.2", "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" + "object.assign": "^4.1.0", + "regexp.prototype.flags": "^1.3.0", + "side-channel": "^1.0.2", + "which-boxed-primitive": "^1.0.1", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.2" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } } }, "define-properties": { @@ -1277,9 +1308,9 @@ "dev": true }, "es-abstract": { - "version": "1.17.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz", - "integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==", + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", @@ -1295,6 +1326,29 @@ "string.prototype.trimright": "^2.1.1" } }, + "es-get-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", + "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", + "dev": true, + "requires": { + "es-abstract": "^1.17.4", + "has-symbols": "^1.0.1", + "is-arguments": "^1.0.4", + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -1351,6 +1405,12 @@ "is-callable": "^1.1.3" } }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1377,9 +1437,9 @@ "dev": true }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1443,9 +1503,9 @@ "dev": true }, "interpret": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", - "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", "dev": true }, "invariant": { @@ -1463,6 +1523,12 @@ "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", "dev": true }, + "is-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.0.tgz", + "integrity": "sha512-t5mGUXC/xRheCK431ylNiSkGGpBp8bHENBcENTkDT6ppwPzEVxNGZRvgvmOEfbWkFhA7D2GEuE2mmQTr78sl2g==", + "dev": true + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -1472,6 +1538,12 @@ "binary-extensions": "^2.0.0" } }, + "is-boolean-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.0.1.tgz", + "integrity": "sha512-TqZuVwa/sppcrhUCAYkGBk7w0yxfQQnxq28fjkO53tnK9FQXmdwz2JS5+GjsWQ6RByES1K40nI+yDic5c9/aAQ==", + "dev": true + }, "is-callable": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", @@ -1499,12 +1571,24 @@ "is-extglob": "^2.1.1" } }, + "is-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", + "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==", + "dev": true + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, + "is-number-object": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", + "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", + "dev": true + }, "is-reference": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz", @@ -1531,6 +1615,18 @@ "has": "^1.0.3" } }, + "is-set": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", + "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==", + "dev": true + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", @@ -1540,6 +1636,30 @@ "has-symbols": "^1.0.1" } }, + "is-typed-array": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.3.tgz", + "integrity": "sha512-BSYUBOK/HJibQ30wWkWold5txYwMUXQct9YHAQJr8fSwvZoiglcqB0pd7vEN23+Tsi9IUEjztdOSzl4qLVYGTQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.0", + "es-abstract": "^1.17.4", + "foreach": "^2.0.5", + "has-symbols": "^1.0.1" + } + }, + "is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "dev": true + }, + "is-weakset": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.1.tgz", + "integrity": "sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1691,10 +1811,14 @@ "dev": true }, "object-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.2.tgz", - "integrity": "sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz", + "integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } }, "object-keys": { "version": "1.1.1", @@ -1913,9 +2037,9 @@ } }, "rollup": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.6.1.tgz", - "integrity": "sha512-1RhFDRJeg027YjBO6+JxmVWkEZY0ASztHhoEUEWxOwkh4mjO58TFD6Uo7T7Y3FbmDpRTfKhM5NVxJyimCn0Elg==", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.7.2.tgz", + "integrity": "sha512-SdtTZVMMVSPe7SNv4exUyPXARe5v/p3TeeG3LRA5WabLPJt4Usi3wVrvVlyAUTG40JJmqS6zbIHt2vWTss2prw==", "dev": true, "requires": { "fsevents": "~2.1.2" @@ -2019,9 +2143,9 @@ "dev": true }, "shelljs": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", - "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", "dev": true, "requires": { "glob": "^7.0.0", @@ -2029,6 +2153,16 @@ "rechoir": "^0.6.2" } }, + "side-channel": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.2.tgz", + "integrity": "sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA==", + "dev": true, + "requires": { + "es-abstract": "^1.17.0-next.1", + "object-inspect": "^1.7.0" + } + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -2085,24 +2219,46 @@ "function-bind": "^1.1.1" } }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "string.prototype.trimleft": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", - "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", "dev": true, "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" } }, "string.prototype.trimright": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", - "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", "dev": true, "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" } }, "string_decoder": { @@ -2194,42 +2350,30 @@ } }, "tape": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.13.2.tgz", - "integrity": "sha512-waWwC/OqYVE9TS6r1IynlP2sEdk4Lfo6jazlgkuNkPTHIbuG2BTABIaKdlQWwPeB6Oo4ksZ1j33Yt0NTOAlYMQ==", - "dev": true, - "requires": { - "deep-equal": "~1.1.1", - "defined": "~1.0.0", - "dotignore": "~0.1.2", - "for-each": "~0.3.3", - "function-bind": "~1.1.1", - "glob": "~7.1.6", - "has": "~1.0.3", - "inherits": "~2.0.4", - "is-regex": "~1.0.5", - "minimist": "~1.2.0", - "object-inspect": "~1.7.0", - "resolve": "~1.15.1", - "resumer": "~0.0.0", - "string.prototype.trim": "~1.2.1", - "through": "~2.3.8" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.0.0.tgz", + "integrity": "sha512-+fi4WiHuvxpKL6GpcvnG5PXfzopgw9h1JM9CJdpEPAbyU3r3VjRgt059fD6Up2/u6BQXmmxKmUMm6mXQP+HS3w==", + "dev": true, + "requires": { + "deep-equal": "^2.0.3", + "defined": "^1.0.0", + "dotignore": "^0.1.2", + "for-each": "^0.3.3", + "function-bind": "^1.1.1", + "glob": "^7.1.6", + "has": "^1.0.3", + "inherits": "^2.0.4", + "is-regex": "^1.0.5", + "minimist": "^1.2.5", + "object-inspect": "^1.7.0", + "object-is": "^1.1.2", + "object.assign": "^4.1.0", + "resolve": "^1.17.0", + "resumer": "^0.0.0", + "string.prototype.trim": "^1.2.1", + "through": "^2.3.8" }, "dependencies": { - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -2243,9 +2387,9 @@ "dev": true }, "resolve": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", - "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -2333,6 +2477,45 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "which-boxed-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.1.tgz", + "integrity": "sha512-7BT4TwISdDGBgaemWU0N0OU7FeAEJ9Oo2P1PHRm/FCWoEi2VLWC9b6xvxAA3C/NMpxg3HXVgi0sMmGbNUbNepQ==", + "dev": true, + "requires": { + "is-bigint": "^1.0.0", + "is-boolean-object": "^1.0.0", + "is-number-object": "^1.0.3", + "is-string": "^1.0.4", + "is-symbol": "^1.0.2" + } + }, + "which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "dev": true, + "requires": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + } + }, + "which-typed-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.2.tgz", + "integrity": "sha512-KT6okrd1tE6JdZAy3o2VhMoYPh3+J6EMZLyrxBQsZflI1QCZIxMrIYLkosd8Twf+YfknVIHmYQPgJt238p8dnQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.2", + "es-abstract": "^1.17.5", + "foreach": "^2.0.5", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.1", + "is-typed-array": "^1.1.3" + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index ee6e5dd1..74c7b1e7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wtf_wikipedia", "description": "parse wikiscript into json", - "version": "8.2.0", + "version": "8.2.1", "author": "Spencer Kelly (http://spencermounta.in)", "repository": { "type": "git", @@ -56,14 +56,14 @@ "@babel/preset-env": "7.9.5", "@rollup/plugin-alias": "3.1.0", "amble": "1.0.0", - "rollup": "2.6.1", + "rollup": "2.7.2", "rollup-plugin-babel": "4.4.0", "rollup-plugin-commonjs": "10.1.0", "rollup-plugin-filesize-check": "0.0.1", "rollup-plugin-terser": "5.3.0", - "shelljs": "^0.8.3", + "shelljs": "0.8.4", "tap-dancer": "0.2.0", - "tape": "4.13.2" + "tape": "5.0.0" }, "eslintIgnore": [ "builds/*.js" diff --git a/src/_version.js b/src/_version.js index 32900651..a57509e6 100644 --- a/src/_version.js +++ b/src/_version.js @@ -1 +1 @@ -module.exports = '8.2.0' \ No newline at end of file +module.exports = '8.2.1' \ No newline at end of file From 681b8e0fb0030b62ebf13b7372ad358bf24c2df6 Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Sat, 25 Apr 2020 13:24:00 -0400 Subject: [PATCH 4/5] remove async await from category plugin 0.3.0 --- .../category/builds/wtf-plugin-category.js | 173 ++----- .../builds/wtf-plugin-category.js.map | 2 +- .../builds/wtf-plugin-category.min.js | 2 +- .../category/builds/wtf-plugin-category.mjs | 173 ++----- plugins/category/package-lock.json | 461 +++++++++++++----- plugins/category/package.json | 8 +- plugins/category/src/index.js | 37 +- 7 files changed, 438 insertions(+), 418 deletions(-) diff --git a/plugins/category/builds/wtf-plugin-category.js b/plugins/category/builds/wtf-plugin-category.js index e949265d..4ae52ebe 100644 --- a/plugins/category/builds/wtf-plugin-category.js +++ b/plugins/category/builds/wtf-plugin-category.js @@ -1,46 +1,10 @@ -/* wtf-plugin-category 0.2.0 MIT */ +/* wtf-plugin-category 0.3.0 MIT */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, global.wtfCategory = factory()); }(this, (function () { 'use strict'; - function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } - } - - function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; - } - /* slow 1.1.0 MIT */ //only do foo promises at a time. var rateLimit = function rateLimit(arr, fn) { @@ -199,111 +163,44 @@ return groups; }; - var fetchCat = /*#__PURE__*/function () { - var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(wtf, cat, lang, opts) { - var resp, pages, groups, doit; - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if (cat) { - _context.next = 2; - break; - } - - return _context.abrupt("return", { - docs: [], - categories: [] - }); - - case 2: - _context.next = 4; - return wtf.category(cat, lang); - - case 4: - resp = _context.sent; - pages = resp.pages.map(function (o) { - return o.title; - }); - groups = chunkBy(pages); - - doit = function doit(group) { - return wtf.fetch(group, opts); //returns a promise - }; //only allow three requests at a time - - - return _context.abrupt("return", slow$1.three(groups, doit).then(function (responses) { - //flatten the results - var docs = [].concat.apply([], responses); - return { - docs: docs, - categories: resp.categories - }; - })); - - case 9: - case "end": - return _context.stop(); - } - } - }, _callee); - })); + var fetchCat = function fetchCat(wtf, cat, lang, opts) { + if (!cat) { + return { + docs: [], + categories: [] + }; + } - return function fetchCat(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; - }(); + return wtf.category(cat, lang).then(function (resp) { + var pages = resp.pages.map(function (o) { + return o.title; + }); + var groups = chunkBy(pages); - var plugin = function plugin(models) { - models.wtf.parseCategory = /*#__PURE__*/function () { - var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(cat, lang, opts) { - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return fetchCat(models.wtf, cat, lang, opts); - - case 2: - return _context2.abrupt("return", _context2.sent); - - case 3: - case "end": - return _context2.stop(); - } - } - }, _callee2); - })); + var doit = function doit(group) { + return wtf.fetch(group, opts); //returns a promise + }; //only allow three requests at a time - return function (_x5, _x6, _x7) { - return _ref2.apply(this, arguments); - }; - }(); - - models.wtf.randomCategory = /*#__PURE__*/function () { - var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(lang, opts) { - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _context3.next = 2; - return random(lang, opts, models.http); - - case 2: - return _context3.abrupt("return", _context3.sent); - - case 3: - case "end": - return _context3.stop(); - } - } - }, _callee3); - })); - return function (_x8, _x9) { - return _ref3.apply(this, arguments); - }; - }(); + return slow$1.three(groups, doit).then(function (responses) { + //flatten the results + var docs = [].concat.apply([], responses); + return { + docs: docs, + categories: resp.categories + }; + }); + }); + }; + + var plugin = function plugin(models) { + models.wtf.parseCategory = function (cat, lang, opts) { + return fetchCat(models.wtf, cat, lang, opts); + }; + + models.wtf.randomCategory = function (lang, opts) { + return random(lang, opts, models.http); + }; models.wtf.fetchCategory = models.wtf.parseCategory; }; diff --git a/plugins/category/builds/wtf-plugin-category.js.map b/plugins/category/builds/wtf-plugin-category.js.map index bcd74981..5b6e1b83 100644 --- a/plugins/category/builds/wtf-plugin-category.js.map +++ b/plugins/category/builds/wtf-plugin-category.js.map @@ -1 +1 @@ -{"version":3,"file":"wtf-plugin-category.js","sources":["../node_modules/slow/builds/slow.mjs","../src/random.js","../src/index.js"],"sourcesContent":["/* slow 1.1.0 MIT */\n//only do foo promises at a time.\nvar rateLimit = function rateLimit(arr, fn) {\n var limit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;\n return new Promise(function (resolve, reject) {\n //some validation\n if (!arr || !fn) {\n reject('Error: missing required parameters to rate-limit function');\n return;\n }\n\n if (arr.length === 0) {\n resolve([]);\n return;\n }\n\n var results = [];\n var n = limit - 1;\n var pending = 0; //simple recursion, but with then/finally\n\n var go = function go(i) {\n pending += 1;\n var p = fn(arr[i]);\n\n if (!p.then) {\n reject('Error: function must return a promise');\n return;\n }\n\n p.then(function (r) {\n results[i] = r;\n });\n p[\"catch\"](function (e) {\n console.error(e);\n results[i] = null;\n });\n p[\"finally\"](function () {\n pending -= 1;\n n += 1; //should we keep going?\n\n if (arr.length >= n + 1) {\n go(n);\n } else if (pending <= 0) {\n //no more to start - are we the last to finish?\n resolve(results);\n }\n });\n }; //fire-off first-n items\n\n\n var init = arr.length < limit ? arr.length : limit;\n\n for (var i = 0; i < init; i += 1) {\n go(i);\n }\n });\n};\n\nvar rateLimit_1 = rateLimit;\n\nvar methods = {\n one: function one(arr, fn) {\n return rateLimit_1(arr, fn, 1);\n },\n two: function two(arr, fn) {\n return rateLimit_1(arr, fn, 2);\n },\n three: function three(arr, fn) {\n return rateLimit_1(arr, fn, 3);\n },\n four: function four(arr, fn) {\n return rateLimit_1(arr, fn, 4);\n },\n five: function five(arr, fn) {\n return rateLimit_1(arr, fn, 5);\n },\n ten: function ten(arr, fn) {\n return rateLimit_1(arr, fn, 10);\n },\n fifteen: function fifteen(arr, fn) {\n return rateLimit_1(arr, fn, 15);\n }\n};\nmethods.serial = methods.one;\nmethods.linear = methods.one;\nmethods.crawl = methods.three;\nmethods.walk = methods.five;\nmethods.run = methods.ten;\nmethods.sprint = methods.fifteen;\nvar src = methods;\n\nexport default src;\n","const 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, http) {\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=14&prop=revisions&grnlimit=1&origin=*`\n\n return http(url)\n .then((res) => {\n try {\n let o = res.query.pages\n let key = Object.keys(o)[0]\n return o[key].title\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 slow = require('slow')\nconst random = require('./random')\n\nconst chunkBy = function (arr, chunkSize = 5) {\n var groups = [],\n i\n for (i = 0; i < arr.length; i += chunkSize) {\n groups.push(arr.slice(i, i + chunkSize))\n }\n return groups\n}\n\nconst fetchCat = async function (wtf, cat, lang, opts) {\n if (!cat) {\n return { docs: [], categories: [] }\n }\n let resp = await wtf.category(cat, lang)\n let pages = resp.pages.map((o) => o.title)\n let groups = chunkBy(pages)\n\n const doit = function (group) {\n return wtf.fetch(group, opts) //returns a promise\n }\n //only allow three requests at a time\n return slow.three(groups, doit).then((responses) => {\n //flatten the results\n let docs = [].concat.apply([], responses)\n return {\n docs: docs,\n categories: resp.categories\n }\n })\n}\n\nconst plugin = function (models) {\n models.wtf.parseCategory = async function (cat, lang, opts) {\n return await fetchCat(models.wtf, cat, lang, opts)\n }\n models.wtf.randomCategory = async function (lang, opts) {\n return await random(lang, opts, models.http)\n }\n models.wtf.fetchCategory = models.wtf.parseCategory\n}\nmodule.exports = plugin\n"],"names":["rateLimit","arr","fn","limit","arguments","length","undefined","Promise","resolve","reject","results","n","pending","go","i","p","then","r","e","console","error","init","rateLimit_1","methods","one","two","three","four","five","ten","fifteen","serial","linear","crawl","walk","run","sprint","src","defaults","lang","wiki","domain","path","isObject","obj","Object","prototype","toString","call","fetchRandom","options","http","assign","url","res","o","query","pages","key","keys","title","chunkBy","chunkSize","groups","push","slice","fetchCat","wtf","cat","opts","docs","categories","category","resp","map","doit","group","fetch","slow","responses","concat","apply","plugin","models","parseCategory","randomCategory","random","fetchCategory"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA,IAAIA,SAAS,GAAG,SAASA,SAAT,CAAmBC,GAAnB,EAAwBC,EAAxB,EAA4B;EAC1C,MAAIC,KAAK,GAAGC,SAAS,CAACC,MAAV,GAAmB,CAAnB,IAAwBD,SAAS,CAAC,CAAD,CAAT,KAAiBE,SAAzC,GAAqDF,SAAS,CAAC,CAAD,CAA9D,GAAoE,CAAhF;EACA,SAAO,IAAIG,OAAJ,CAAY,UAAUC,OAAV,EAAmBC,MAAnB,EAA2B;EAC5C;EACA,QAAI,CAACR,GAAD,IAAQ,CAACC,EAAb,EAAiB;EACfO,MAAAA,MAAM,CAAC,2DAAD,CAAN;EACA;EACD;;EAED,QAAIR,GAAG,CAACI,MAAJ,KAAe,CAAnB,EAAsB;EACpBG,MAAAA,OAAO,CAAC,EAAD,CAAP;EACA;EACD;;EAED,QAAIE,OAAO,GAAG,EAAd;EACA,QAAIC,CAAC,GAAGR,KAAK,GAAG,CAAhB;EACA,QAAIS,OAAO,GAAG,CAAd,CAd4C;;EAgB5C,QAAIC,EAAE,GAAG,SAASA,EAAT,CAAYC,CAAZ,EAAe;EACtBF,MAAAA,OAAO,IAAI,CAAX;EACA,UAAIG,CAAC,GAAGb,EAAE,CAACD,GAAG,CAACa,CAAD,CAAJ,CAAV;;EAEA,UAAI,CAACC,CAAC,CAACC,IAAP,EAAa;EACXP,QAAAA,MAAM,CAAC,uCAAD,CAAN;EACA;EACD;;EAEDM,MAAAA,CAAC,CAACC,IAAF,CAAO,UAAUC,CAAV,EAAa;EAClBP,QAAAA,OAAO,CAACI,CAAD,CAAP,GAAaG,CAAb;EACD,OAFD;EAGAF,MAAAA,CAAC,CAAC,OAAD,CAAD,CAAW,UAAUG,CAAV,EAAa;EACtBC,QAAAA,OAAO,CAACC,KAAR,CAAcF,CAAd;EACAR,QAAAA,OAAO,CAACI,CAAD,CAAP,GAAa,IAAb;EACD,OAHD;EAIAC,MAAAA,CAAC,CAAC,SAAD,CAAD,CAAa,YAAY;EACvBH,QAAAA,OAAO,IAAI,CAAX;EACAD,QAAAA,CAAC,IAAI,CAAL,CAFuB;;EAIvB,YAAIV,GAAG,CAACI,MAAJ,IAAcM,CAAC,GAAG,CAAtB,EAAyB;EACvBE,UAAAA,EAAE,CAACF,CAAD,CAAF;EACD,SAFD,MAEO,IAAIC,OAAO,IAAI,CAAf,EAAkB;EACvB;EACAJ,UAAAA,OAAO,CAACE,OAAD,CAAP;EACD;EACF,OAVD;EAWD,KA3BD,CAhB4C;;;EA8C5C,QAAIW,IAAI,GAAGpB,GAAG,CAACI,MAAJ,GAAaF,KAAb,GAAqBF,GAAG,CAACI,MAAzB,GAAkCF,KAA7C;;EAEA,SAAK,IAAIW,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGO,IAApB,EAA0BP,CAAC,IAAI,CAA/B,EAAkC;EAChCD,MAAAA,EAAE,CAACC,CAAD,CAAF;EACD;EACF,GAnDM,CAAP;EAoDD,CAtDD;;EAwDA,IAAIQ,WAAW,GAAGtB,SAAlB;EAEA,IAAIuB,OAAO,GAAG;EACZC,EAAAA,GAAG,EAAE,SAASA,GAAT,CAAavB,GAAb,EAAkBC,EAAlB,EAAsB;EACzB,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,CAAV,CAAlB;EACD,GAHW;EAIZuB,EAAAA,GAAG,EAAE,SAASA,GAAT,CAAaxB,GAAb,EAAkBC,EAAlB,EAAsB;EACzB,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,CAAV,CAAlB;EACD,GANW;EAOZwB,EAAAA,KAAK,EAAE,SAASA,KAAT,CAAezB,GAAf,EAAoBC,EAApB,EAAwB;EAC7B,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,CAAV,CAAlB;EACD,GATW;EAUZyB,EAAAA,IAAI,EAAE,SAASA,IAAT,CAAc1B,GAAd,EAAmBC,EAAnB,EAAuB;EAC3B,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,CAAV,CAAlB;EACD,GAZW;EAaZ0B,EAAAA,IAAI,EAAE,SAASA,IAAT,CAAc3B,GAAd,EAAmBC,EAAnB,EAAuB;EAC3B,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,CAAV,CAAlB;EACD,GAfW;EAgBZ2B,EAAAA,GAAG,EAAE,SAASA,GAAT,CAAa5B,GAAb,EAAkBC,EAAlB,EAAsB;EACzB,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,EAAV,CAAlB;EACD,GAlBW;EAmBZ4B,EAAAA,OAAO,EAAE,SAASA,OAAT,CAAiB7B,GAAjB,EAAsBC,EAAtB,EAA0B;EACjC,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,EAAV,CAAlB;EACD;EArBW,CAAd;EAuBAqB,OAAO,CAACQ,MAAR,GAAiBR,OAAO,CAACC,GAAzB;EACAD,OAAO,CAACS,MAAR,GAAiBT,OAAO,CAACC,GAAzB;EACAD,OAAO,CAACU,KAAR,GAAgBV,OAAO,CAACG,KAAxB;EACAH,OAAO,CAACW,IAAR,GAAeX,OAAO,CAACK,IAAvB;EACAL,OAAO,CAACY,GAAR,GAAcZ,OAAO,CAACM,GAAtB;EACAN,OAAO,CAACa,MAAR,GAAiBb,OAAO,CAACO,OAAzB;EACA,IAAIO,GAAG,GAAGd,OAAV;;;;;;;ECzFA,IAAMe,QAAQ,GAAG;EACfC,EAAAA,IAAI,EAAE,IADS;EAEfC,EAAAA,IAAI,EAAE,WAFS;EAGfC,EAAAA,MAAM,EAAE,IAHO;EAIfC,EAAAA,IAAI,EAAE,WAJS;;EAAA,CAAjB;;EAMA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAAUC,GAAV,EAAe;EAC9B,SAAOA,GAAG,IAAIC,MAAM,CAACC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,GAA/B,MAAwC,iBAAtD;EACD,CAFD;;EAIA,IAAMK,WAAW,GAAG,SAAdA,WAAc,CAAUV,IAAV,EAAgBW,OAAhB,EAAyBC,IAAzB,EAA+B;EACjDD,EAAAA,OAAO,GAAGA,OAAO,IAAI,EAArB;EACAA,EAAAA,OAAO,GAAGL,MAAM,CAACO,MAAP,CAAc,EAAd,EAAkBd,QAAlB,EAA4BY,OAA5B,CAAV,CAFiD;;EAIjD,MAAI,OAAOX,IAAP,KAAgB,QAApB,EAA8B;EAC5BW,IAAAA,OAAO,CAACX,IAAR,GAAeA,IAAf;EACD,GAFD,MAEO,IAAII,QAAQ,CAACJ,IAAD,CAAZ,EAAoB;EACzBW,IAAAA,OAAO,GAAGL,MAAM,CAACO,MAAP,CAAcF,OAAd,EAAuBX,IAAvB,CAAV;EACD;;EAED,MAAIc,GAAG,qBAAcH,OAAO,CAACX,IAAtB,4BAA4CW,OAAO,CAACR,IAApD,MAAP;;EACA,MAAIQ,OAAO,CAACT,MAAZ,EAAoB;EAClBY,IAAAA,GAAG,qBAAcH,OAAO,CAACT,MAAtB,cAAgCS,OAAO,CAACR,IAAxC,MAAH;EACD;;EACDW,EAAAA,GAAG,kGAAH;EAEA,SAAOF,IAAI,CAACE,GAAD,CAAJ,CACJrC,IADI,CACC,UAACsC,GAAD,EAAS;EACb,QAAI;EACF,UAAIC,CAAC,GAAGD,GAAG,CAACE,KAAJ,CAAUC,KAAlB;EACA,UAAIC,GAAG,GAAGb,MAAM,CAACc,IAAP,CAAYJ,CAAZ,EAAe,CAAf,CAAV;EACA,aAAOA,CAAC,CAACG,GAAD,CAAD,CAAOE,KAAd;EACD,KAJD,CAIE,OAAO1C,CAAP,EAAU;EACV,YAAMA,CAAN;EACD;EACF,GATI,WAUE,UAACA,CAAD,EAAO;EACZC,IAAAA,OAAO,CAACC,KAAR,CAAcF,CAAd;EACA,WAAO,IAAP;EACD,GAbI,CAAP;EAcD,CA9BD;;EA+BA,UAAc,GAAG+B,WAAjB;;;;;;;;ECtCA,IAAMY,OAAO,GAAG,SAAVA,OAAU,CAAU5D,GAAV,EAA8B;EAAA,MAAf6D,SAAe,uEAAH,CAAG;EAC5C,MAAIC,MAAM,GAAG,EAAb;EAAA,MACEjD,CADF;;EAEA,OAAKA,CAAC,GAAG,CAAT,EAAYA,CAAC,GAAGb,GAAG,CAACI,MAApB,EAA4BS,CAAC,IAAIgD,SAAjC,EAA4C;EAC1CC,IAAAA,MAAM,CAACC,IAAP,CAAY/D,GAAG,CAACgE,KAAJ,CAAUnD,CAAV,EAAaA,CAAC,GAAGgD,SAAjB,CAAZ;EACD;;EACD,SAAOC,MAAP;EACD,CAPD;;EASA,IAAMG,QAAQ;EAAA,qEAAG,iBAAgBC,GAAhB,EAAqBC,GAArB,EAA0B7B,IAA1B,EAAgC8B,IAAhC;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,gBACVD,GADU;EAAA;EAAA;EAAA;;EAAA,6CAEN;EAAEE,cAAAA,IAAI,EAAE,EAAR;EAAYC,cAAAA,UAAU,EAAE;EAAxB,aAFM;;EAAA;EAAA;EAAA,mBAIEJ,GAAG,CAACK,QAAJ,CAAaJ,GAAb,EAAkB7B,IAAlB,CAJF;;EAAA;EAIXkC,YAAAA,IAJW;EAKXhB,YAAAA,KALW,GAKHgB,IAAI,CAAChB,KAAL,CAAWiB,GAAX,CAAe,UAACnB,CAAD;EAAA,qBAAOA,CAAC,CAACK,KAAT;EAAA,aAAf,CALG;EAMXG,YAAAA,MANW,GAMFF,OAAO,CAACJ,KAAD,CANL;;EAQTkB,YAAAA,IARS,GAQF,SAAPA,IAAO,CAAUC,KAAV,EAAiB;EAC5B,qBAAOT,GAAG,CAACU,KAAJ,CAAUD,KAAV,EAAiBP,IAAjB,CAAP,CAD4B;EAE7B,aAVc;;;EAAA,6CAYRS,MAAI,CAACpD,KAAL,CAAWqC,MAAX,EAAmBY,IAAnB,EAAyB3D,IAAzB,CAA8B,UAAC+D,SAAD,EAAe;;EAElD,kBAAIT,IAAI,GAAG,GAAGU,MAAH,CAAUC,KAAV,CAAgB,EAAhB,EAAoBF,SAApB,CAAX;EACA,qBAAO;EACLT,gBAAAA,IAAI,EAAEA,IADD;EAELC,gBAAAA,UAAU,EAAEE,IAAI,CAACF;EAFZ,eAAP;EAID,aAPM,CAZQ;;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,GAAH;;EAAA,kBAARL,QAAQ;EAAA;EAAA;EAAA,GAAd;;EAsBA,IAAMgB,MAAM,GAAG,SAATA,MAAS,CAAUC,MAAV,EAAkB;EAC/BA,EAAAA,MAAM,CAAChB,GAAP,CAAWiB,aAAX;EAAA,wEAA2B,kBAAgBhB,GAAhB,EAAqB7B,IAArB,EAA2B8B,IAA3B;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,qBACZH,QAAQ,CAACiB,MAAM,CAAChB,GAAR,EAAaC,GAAb,EAAkB7B,IAAlB,EAAwB8B,IAAxB,CADI;;EAAA;EAAA;;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,KAA3B;;EAAA;EAAA;EAAA;EAAA;;EAGAc,EAAAA,MAAM,CAAChB,GAAP,CAAWkB,cAAX;EAAA,wEAA4B,kBAAgB9C,IAAhB,EAAsB8B,IAAtB;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,qBACbiB,MAAM,CAAC/C,IAAD,EAAO8B,IAAP,EAAac,MAAM,CAAChC,IAApB,CADO;;EAAA;EAAA;;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,KAA5B;;EAAA;EAAA;EAAA;EAAA;;EAGAgC,EAAAA,MAAM,CAAChB,GAAP,CAAWoB,aAAX,GAA2BJ,MAAM,CAAChB,GAAP,CAAWiB,aAAtC;EACD,CARD;;EASA,SAAc,GAAGF,MAAjB;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"wtf-plugin-category.js","sources":["../node_modules/slow/builds/slow.mjs","../src/random.js","../src/index.js"],"sourcesContent":["/* slow 1.1.0 MIT */\n//only do foo promises at a time.\nvar rateLimit = function rateLimit(arr, fn) {\n var limit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;\n return new Promise(function (resolve, reject) {\n //some validation\n if (!arr || !fn) {\n reject('Error: missing required parameters to rate-limit function');\n return;\n }\n\n if (arr.length === 0) {\n resolve([]);\n return;\n }\n\n var results = [];\n var n = limit - 1;\n var pending = 0; //simple recursion, but with then/finally\n\n var go = function go(i) {\n pending += 1;\n var p = fn(arr[i]);\n\n if (!p.then) {\n reject('Error: function must return a promise');\n return;\n }\n\n p.then(function (r) {\n results[i] = r;\n });\n p[\"catch\"](function (e) {\n console.error(e);\n results[i] = null;\n });\n p[\"finally\"](function () {\n pending -= 1;\n n += 1; //should we keep going?\n\n if (arr.length >= n + 1) {\n go(n);\n } else if (pending <= 0) {\n //no more to start - are we the last to finish?\n resolve(results);\n }\n });\n }; //fire-off first-n items\n\n\n var init = arr.length < limit ? arr.length : limit;\n\n for (var i = 0; i < init; i += 1) {\n go(i);\n }\n });\n};\n\nvar rateLimit_1 = rateLimit;\n\nvar methods = {\n one: function one(arr, fn) {\n return rateLimit_1(arr, fn, 1);\n },\n two: function two(arr, fn) {\n return rateLimit_1(arr, fn, 2);\n },\n three: function three(arr, fn) {\n return rateLimit_1(arr, fn, 3);\n },\n four: function four(arr, fn) {\n return rateLimit_1(arr, fn, 4);\n },\n five: function five(arr, fn) {\n return rateLimit_1(arr, fn, 5);\n },\n ten: function ten(arr, fn) {\n return rateLimit_1(arr, fn, 10);\n },\n fifteen: function fifteen(arr, fn) {\n return rateLimit_1(arr, fn, 15);\n }\n};\nmethods.serial = methods.one;\nmethods.linear = methods.one;\nmethods.crawl = methods.three;\nmethods.walk = methods.five;\nmethods.run = methods.ten;\nmethods.sprint = methods.fifteen;\nvar src = methods;\n\nexport default src;\n","const 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, http) {\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=14&prop=revisions&grnlimit=1&origin=*`\n\n return http(url)\n .then((res) => {\n try {\n let o = res.query.pages\n let key = Object.keys(o)[0]\n return o[key].title\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 slow = require('slow')\nconst random = require('./random')\n\nconst chunkBy = function (arr, chunkSize = 5) {\n var groups = [],\n i\n for (i = 0; i < arr.length; i += chunkSize) {\n groups.push(arr.slice(i, i + chunkSize))\n }\n return groups\n}\n\nconst fetchCat = function (wtf, cat, lang, opts) {\n if (!cat) {\n return { docs: [], categories: [] }\n }\n return wtf.category(cat, lang).then((resp) => {\n let pages = resp.pages.map((o) => o.title)\n let groups = chunkBy(pages)\n\n const doit = function (group) {\n return wtf.fetch(group, opts) //returns a promise\n }\n //only allow three requests at a time\n return slow.three(groups, doit).then((responses) => {\n //flatten the results\n let docs = [].concat.apply([], responses)\n return {\n docs: docs,\n categories: resp.categories\n }\n })\n })\n}\n\nconst plugin = function (models) {\n models.wtf.parseCategory = function (cat, lang, opts) {\n return fetchCat(models.wtf, cat, lang, opts)\n }\n models.wtf.randomCategory = function (lang, opts) {\n return random(lang, opts, models.http)\n }\n models.wtf.fetchCategory = models.wtf.parseCategory\n}\nmodule.exports = plugin\n"],"names":["rateLimit","arr","fn","limit","arguments","length","undefined","Promise","resolve","reject","results","n","pending","go","i","p","then","r","e","console","error","init","rateLimit_1","methods","one","two","three","four","five","ten","fifteen","serial","linear","crawl","walk","run","sprint","src","defaults","lang","wiki","domain","path","isObject","obj","Object","prototype","toString","call","fetchRandom","options","http","assign","url","res","o","query","pages","key","keys","title","chunkBy","chunkSize","groups","push","slice","fetchCat","wtf","cat","opts","docs","categories","category","resp","map","doit","group","fetch","slow","responses","concat","apply","plugin","models","parseCategory","randomCategory","random","fetchCategory"],"mappings":";;;;;;;EAAA;EACA;EACA,IAAIA,SAAS,GAAG,SAASA,SAAT,CAAmBC,GAAnB,EAAwBC,EAAxB,EAA4B;EAC1C,MAAIC,KAAK,GAAGC,SAAS,CAACC,MAAV,GAAmB,CAAnB,IAAwBD,SAAS,CAAC,CAAD,CAAT,KAAiBE,SAAzC,GAAqDF,SAAS,CAAC,CAAD,CAA9D,GAAoE,CAAhF;EACA,SAAO,IAAIG,OAAJ,CAAY,UAAUC,OAAV,EAAmBC,MAAnB,EAA2B;EAC5C;EACA,QAAI,CAACR,GAAD,IAAQ,CAACC,EAAb,EAAiB;EACfO,MAAAA,MAAM,CAAC,2DAAD,CAAN;EACA;EACD;;EAED,QAAIR,GAAG,CAACI,MAAJ,KAAe,CAAnB,EAAsB;EACpBG,MAAAA,OAAO,CAAC,EAAD,CAAP;EACA;EACD;;EAED,QAAIE,OAAO,GAAG,EAAd;EACA,QAAIC,CAAC,GAAGR,KAAK,GAAG,CAAhB;EACA,QAAIS,OAAO,GAAG,CAAd,CAd4C;;EAgB5C,QAAIC,EAAE,GAAG,SAASA,EAAT,CAAYC,CAAZ,EAAe;EACtBF,MAAAA,OAAO,IAAI,CAAX;EACA,UAAIG,CAAC,GAAGb,EAAE,CAACD,GAAG,CAACa,CAAD,CAAJ,CAAV;;EAEA,UAAI,CAACC,CAAC,CAACC,IAAP,EAAa;EACXP,QAAAA,MAAM,CAAC,uCAAD,CAAN;EACA;EACD;;EAEDM,MAAAA,CAAC,CAACC,IAAF,CAAO,UAAUC,CAAV,EAAa;EAClBP,QAAAA,OAAO,CAACI,CAAD,CAAP,GAAaG,CAAb;EACD,OAFD;EAGAF,MAAAA,CAAC,CAAC,OAAD,CAAD,CAAW,UAAUG,CAAV,EAAa;EACtBC,QAAAA,OAAO,CAACC,KAAR,CAAcF,CAAd;EACAR,QAAAA,OAAO,CAACI,CAAD,CAAP,GAAa,IAAb;EACD,OAHD;EAIAC,MAAAA,CAAC,CAAC,SAAD,CAAD,CAAa,YAAY;EACvBH,QAAAA,OAAO,IAAI,CAAX;EACAD,QAAAA,CAAC,IAAI,CAAL,CAFuB;;EAIvB,YAAIV,GAAG,CAACI,MAAJ,IAAcM,CAAC,GAAG,CAAtB,EAAyB;EACvBE,UAAAA,EAAE,CAACF,CAAD,CAAF;EACD,SAFD,MAEO,IAAIC,OAAO,IAAI,CAAf,EAAkB;EACvB;EACAJ,UAAAA,OAAO,CAACE,OAAD,CAAP;EACD;EACF,OAVD;EAWD,KA3BD,CAhB4C;;;EA8C5C,QAAIW,IAAI,GAAGpB,GAAG,CAACI,MAAJ,GAAaF,KAAb,GAAqBF,GAAG,CAACI,MAAzB,GAAkCF,KAA7C;;EAEA,SAAK,IAAIW,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGO,IAApB,EAA0BP,CAAC,IAAI,CAA/B,EAAkC;EAChCD,MAAAA,EAAE,CAACC,CAAD,CAAF;EACD;EACF,GAnDM,CAAP;EAoDD,CAtDD;;EAwDA,IAAIQ,WAAW,GAAGtB,SAAlB;EAEA,IAAIuB,OAAO,GAAG;EACZC,EAAAA,GAAG,EAAE,SAASA,GAAT,CAAavB,GAAb,EAAkBC,EAAlB,EAAsB;EACzB,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,CAAV,CAAlB;EACD,GAHW;EAIZuB,EAAAA,GAAG,EAAE,SAASA,GAAT,CAAaxB,GAAb,EAAkBC,EAAlB,EAAsB;EACzB,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,CAAV,CAAlB;EACD,GANW;EAOZwB,EAAAA,KAAK,EAAE,SAASA,KAAT,CAAezB,GAAf,EAAoBC,EAApB,EAAwB;EAC7B,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,CAAV,CAAlB;EACD,GATW;EAUZyB,EAAAA,IAAI,EAAE,SAASA,IAAT,CAAc1B,GAAd,EAAmBC,EAAnB,EAAuB;EAC3B,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,CAAV,CAAlB;EACD,GAZW;EAaZ0B,EAAAA,IAAI,EAAE,SAASA,IAAT,CAAc3B,GAAd,EAAmBC,EAAnB,EAAuB;EAC3B,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,CAAV,CAAlB;EACD,GAfW;EAgBZ2B,EAAAA,GAAG,EAAE,SAASA,GAAT,CAAa5B,GAAb,EAAkBC,EAAlB,EAAsB;EACzB,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,EAAV,CAAlB;EACD,GAlBW;EAmBZ4B,EAAAA,OAAO,EAAE,SAASA,OAAT,CAAiB7B,GAAjB,EAAsBC,EAAtB,EAA0B;EACjC,WAAOoB,WAAW,CAACrB,GAAD,EAAMC,EAAN,EAAU,EAAV,CAAlB;EACD;EArBW,CAAd;EAuBAqB,OAAO,CAACQ,MAAR,GAAiBR,OAAO,CAACC,GAAzB;EACAD,OAAO,CAACS,MAAR,GAAiBT,OAAO,CAACC,GAAzB;EACAD,OAAO,CAACU,KAAR,GAAgBV,OAAO,CAACG,KAAxB;EACAH,OAAO,CAACW,IAAR,GAAeX,OAAO,CAACK,IAAvB;EACAL,OAAO,CAACY,GAAR,GAAcZ,OAAO,CAACM,GAAtB;EACAN,OAAO,CAACa,MAAR,GAAiBb,OAAO,CAACO,OAAzB;EACA,IAAIO,GAAG,GAAGd,OAAV;;;;;;;ECzFA,IAAMe,QAAQ,GAAG;EACfC,EAAAA,IAAI,EAAE,IADS;EAEfC,EAAAA,IAAI,EAAE,WAFS;EAGfC,EAAAA,MAAM,EAAE,IAHO;EAIfC,EAAAA,IAAI,EAAE,WAJS;;EAAA,CAAjB;;EAMA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAAUC,GAAV,EAAe;EAC9B,SAAOA,GAAG,IAAIC,MAAM,CAACC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,GAA/B,MAAwC,iBAAtD;EACD,CAFD;;EAIA,IAAMK,WAAW,GAAG,SAAdA,WAAc,CAAUV,IAAV,EAAgBW,OAAhB,EAAyBC,IAAzB,EAA+B;EACjDD,EAAAA,OAAO,GAAGA,OAAO,IAAI,EAArB;EACAA,EAAAA,OAAO,GAAGL,MAAM,CAACO,MAAP,CAAc,EAAd,EAAkBd,QAAlB,EAA4BY,OAA5B,CAAV,CAFiD;;EAIjD,MAAI,OAAOX,IAAP,KAAgB,QAApB,EAA8B;EAC5BW,IAAAA,OAAO,CAACX,IAAR,GAAeA,IAAf;EACD,GAFD,MAEO,IAAII,QAAQ,CAACJ,IAAD,CAAZ,EAAoB;EACzBW,IAAAA,OAAO,GAAGL,MAAM,CAACO,MAAP,CAAcF,OAAd,EAAuBX,IAAvB,CAAV;EACD;;EAED,MAAIc,GAAG,qBAAcH,OAAO,CAACX,IAAtB,4BAA4CW,OAAO,CAACR,IAApD,MAAP;;EACA,MAAIQ,OAAO,CAACT,MAAZ,EAAoB;EAClBY,IAAAA,GAAG,qBAAcH,OAAO,CAACT,MAAtB,cAAgCS,OAAO,CAACR,IAAxC,MAAH;EACD;;EACDW,EAAAA,GAAG,kGAAH;EAEA,SAAOF,IAAI,CAACE,GAAD,CAAJ,CACJrC,IADI,CACC,UAACsC,GAAD,EAAS;EACb,QAAI;EACF,UAAIC,CAAC,GAAGD,GAAG,CAACE,KAAJ,CAAUC,KAAlB;EACA,UAAIC,GAAG,GAAGb,MAAM,CAACc,IAAP,CAAYJ,CAAZ,EAAe,CAAf,CAAV;EACA,aAAOA,CAAC,CAACG,GAAD,CAAD,CAAOE,KAAd;EACD,KAJD,CAIE,OAAO1C,CAAP,EAAU;EACV,YAAMA,CAAN;EACD;EACF,GATI,WAUE,UAACA,CAAD,EAAO;EACZC,IAAAA,OAAO,CAACC,KAAR,CAAcF,CAAd;EACA,WAAO,IAAP;EACD,GAbI,CAAP;EAcD,CA9BD;;EA+BA,UAAc,GAAG+B,WAAjB;;;;;;;;ECtCA,IAAMY,OAAO,GAAG,SAAVA,OAAU,CAAU5D,GAAV,EAA8B;EAAA,MAAf6D,SAAe,uEAAH,CAAG;EAC5C,MAAIC,MAAM,GAAG,EAAb;EAAA,MACEjD,CADF;;EAEA,OAAKA,CAAC,GAAG,CAAT,EAAYA,CAAC,GAAGb,GAAG,CAACI,MAApB,EAA4BS,CAAC,IAAIgD,SAAjC,EAA4C;EAC1CC,IAAAA,MAAM,CAACC,IAAP,CAAY/D,GAAG,CAACgE,KAAJ,CAAUnD,CAAV,EAAaA,CAAC,GAAGgD,SAAjB,CAAZ;EACD;;EACD,SAAOC,MAAP;EACD,CAPD;;EASA,IAAMG,QAAQ,GAAG,SAAXA,QAAW,CAAUC,GAAV,EAAeC,GAAf,EAAoB7B,IAApB,EAA0B8B,IAA1B,EAAgC;EAC/C,MAAI,CAACD,GAAL,EAAU;EACR,WAAO;EAAEE,MAAAA,IAAI,EAAE,EAAR;EAAYC,MAAAA,UAAU,EAAE;EAAxB,KAAP;EACD;;EACD,SAAOJ,GAAG,CAACK,QAAJ,CAAaJ,GAAb,EAAkB7B,IAAlB,EAAwBvB,IAAxB,CAA6B,UAACyD,IAAD,EAAU;EAC5C,QAAIhB,KAAK,GAAGgB,IAAI,CAAChB,KAAL,CAAWiB,GAAX,CAAe,UAACnB,CAAD;EAAA,aAAOA,CAAC,CAACK,KAAT;EAAA,KAAf,CAAZ;EACA,QAAIG,MAAM,GAAGF,OAAO,CAACJ,KAAD,CAApB;;EAEA,QAAMkB,IAAI,GAAG,SAAPA,IAAO,CAAUC,KAAV,EAAiB;EAC5B,aAAOT,GAAG,CAACU,KAAJ,CAAUD,KAAV,EAAiBP,IAAjB,CAAP,CAD4B;EAE7B,KAFD,CAJ4C;;;EAQ5C,WAAOS,MAAI,CAACpD,KAAL,CAAWqC,MAAX,EAAmBY,IAAnB,EAAyB3D,IAAzB,CAA8B,UAAC+D,SAAD,EAAe;;EAElD,UAAIT,IAAI,GAAG,GAAGU,MAAH,CAAUC,KAAV,CAAgB,EAAhB,EAAoBF,SAApB,CAAX;EACA,aAAO;EACLT,QAAAA,IAAI,EAAEA,IADD;EAELC,QAAAA,UAAU,EAAEE,IAAI,CAACF;EAFZ,OAAP;EAID,KAPM,CAAP;EAQD,GAhBM,CAAP;EAiBD,CArBD;;EAuBA,IAAMW,MAAM,GAAG,SAATA,MAAS,CAAUC,MAAV,EAAkB;EAC/BA,EAAAA,MAAM,CAAChB,GAAP,CAAWiB,aAAX,GAA2B,UAAUhB,GAAV,EAAe7B,IAAf,EAAqB8B,IAArB,EAA2B;EACpD,WAAOH,QAAQ,CAACiB,MAAM,CAAChB,GAAR,EAAaC,GAAb,EAAkB7B,IAAlB,EAAwB8B,IAAxB,CAAf;EACD,GAFD;;EAGAc,EAAAA,MAAM,CAAChB,GAAP,CAAWkB,cAAX,GAA4B,UAAU9C,IAAV,EAAgB8B,IAAhB,EAAsB;EAChD,WAAOiB,MAAM,CAAC/C,IAAD,EAAO8B,IAAP,EAAac,MAAM,CAAChC,IAApB,CAAb;EACD,GAFD;;EAGAgC,EAAAA,MAAM,CAAChB,GAAP,CAAWoB,aAAX,GAA2BJ,MAAM,CAAChB,GAAP,CAAWiB,aAAtC;EACD,CARD;;EASA,SAAc,GAAGF,MAAjB;;;;;;;;"} \ No newline at end of file diff --git a/plugins/category/builds/wtf-plugin-category.min.js b/plugins/category/builds/wtf-plugin-category.min.js index 51021f68..16d2001e 100644 --- a/plugins/category/builds/wtf-plugin-category.min.js +++ b/plugins/category/builds/wtf-plugin-category.min.js @@ -1 +1 @@ -!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).wtfCategory=n()}(this,(function(){"use strict";function t(t,n,e,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){return void e(t)}a.done?n(c):Promise.resolve(c).then(r,o)}function n(n){return function(){var e=this,r=arguments;return new Promise((function(o,i){var u=n.apply(e,r);function a(n){t(u,o,i,a,c,"next",n)}function c(n){t(u,o,i,a,c,"throw",n)}a(void 0)}))}}var e=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;return new Promise((function(r,o){if(t&&n)if(0!==t.length)for(var i=[],u=e-1,a=0,c=function e(c){a+=1;var f=n(t[c]);f.then?(f.then((function(t){i[c]=t})),f.catch((function(t){console.error(t),i[c]=null})),f.finally((function(){a-=1,u+=1,t.length>=u+1?e(u):a<=0&&r(i)}))):o("Error: function must return a promise")},f=t.length1&&void 0!==arguments[1]?arguments[1]:5,r=[];for(n=0;n2&&void 0!==arguments[2]?arguments[2]:5;return new Promise((function(r,o){if(t&&n)if(0!==t.length)for(var i=[],c=e-1,a=0,u=function e(u){a+=1;var f=n(t[u]);f.then?(f.then((function(t){i[u]=t})),f.catch((function(t){console.error(t),i[u]=null})),f.finally((function(){a-=1,c+=1,t.length>=c+1?e(c):a<=0&&r(i)}))):o("Error: function must return a promise")},f=t.length1&&void 0!==arguments[1]?arguments[1]:5,r=[];for(n=0;n o.title) - let groups = chunkBy(pages) + return wtf.category(cat, lang).then((resp) => { + let pages = resp.pages.map((o) => o.title) + let groups = chunkBy(pages) - const doit = function (group) { - return wtf.fetch(group, opts) //returns a promise - } - //only allow three requests at a time - return slow.three(groups, doit).then((responses) => { - //flatten the results - let docs = [].concat.apply([], responses) - return { - docs: docs, - categories: resp.categories + const doit = function (group) { + return wtf.fetch(group, opts) //returns a promise } + //only allow three requests at a time + return slow.three(groups, doit).then((responses) => { + //flatten the results + let docs = [].concat.apply([], responses) + return { + docs: docs, + categories: resp.categories + } + }) }) } const plugin = function (models) { - models.wtf.parseCategory = async function (cat, lang, opts) { - return await fetchCat(models.wtf, cat, lang, opts) + models.wtf.parseCategory = function (cat, lang, opts) { + return fetchCat(models.wtf, cat, lang, opts) } - models.wtf.randomCategory = async function (lang, opts) { - return await random(lang, opts, models.http) + models.wtf.randomCategory = function (lang, opts) { + return random(lang, opts, models.http) } models.wtf.fetchCategory = models.wtf.parseCategory } From 9d86342d976c5cb78c3a53e58874de210b368ec4 Mon Sep 17 00:00:00 2001 From: spencer kelly Date: Sat, 25 Apr 2020 13:25:22 -0400 Subject: [PATCH 5/5] remove async await from image test --- plugins/image/tests/image.test.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/image/tests/image.test.js b/plugins/image/tests/image.test.js index 44afd4fc..3836b449 100644 --- a/plugins/image/tests/image.test.js +++ b/plugins/image/tests/image.test.js @@ -1,19 +1,20 @@ const test = require('tape') const wtf = require('./_lib') -test('image-methods', async function(t) { +test('image-methods', function (t) { wtf .fetch('casa', 'it', { wiki: `wiktionary` }) - .then(async function(doc) { + .then(function (doc) { let img = doc.images(0) - const bool = await img.exists() - t.equal(bool, true, 'img exists') + img.exists().then((bool) => { + t.equal(bool, true, 'img exists') - let url = img.commonsURL() - t.ok(url, 'commons-url') + let url = img.commonsURL() + t.ok(url, 'commons-url') - t.end() + t.end() + }) }) })