跳转到内容

MediaWiki:Gadget-popups.js:修订间差异

来自萌娘共享
代码变动:103d1a56 - feat: rename (#594) by U:AnnAngela, co-authored-by: GH:github-actions[bot]
标签由机器人或全自动脚本执行的操作
标签由机器人或全自动脚本执行的操作
 
(未显示同一用户的1个中间版本)
第4行: 第4行:
  * -------------------------------------------------------------------------
  * -------------------------------------------------------------------------
  */
  */
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/Navigation_popups/Gadget-popups.js|user=[[U:AnnAngela]]|co-authors=GH:github-actions[bot]|longId=103d1a563ea4ccc8ff29fb55c9bcd88329a56eb5|shortId=103d1a56|summary=feat: rename (#594)|body=<nowiki>Co-authored-by: github-actions[bot] <41898282+github-actions[bot]📧users.noreply.github.com></nowiki>}}';  
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/Navigation_popups/Gadget-popups.js|user=[[U:星海子]]|co-authors=|longId=168b702dde16bcbf184e95908f72ee4114d46c94|shortId=168b702d|summary=feat: rename `名字空间` to `命名空间`}}';  


/* <pre> */
/* <pre> */
第12行: 第12行:
function popupFilterStubDetect(e,i,n){const o=function stubCount(e,i){if(!getValueOf("popupAllDabsStubs")&&i.namespace())return!1;let n=0,o=0;if(t.re.stub.test(e)){const i=e.parenSplit(t.re.stub);for(let e=1;e<i.length;e+=2)i[e]?++n:++o}return{real:o,sect:n}}(e,n);return o.real?popupString("stub"):o.sect?popupString("section stub"):""}function popupFilterDisambigDetect(e,t,i){return!getValueOf("popupAllDabsStubs")&&i.namespace()?"":isDisambig(e,i)?popupString("disambig"):""}function parseParams(e){let i=e;const n=t.re.specialdiff.exec(i);if(n){const e=n[1].split("/");if(1===e.length)return{oldid:e[0],diff:"prev"};if(2===e.length)return{oldid:e[0],diff:e[1]}}const o={};if(-1===i.indexOf("?"))return o;i=i.split("#")[0];const s=i.split("?").slice(1).join().split("&");for(let e=0;e<s.length;++e){const t=s[e].split("=");t.push(null),o[t[0]]=t[1]}if(o.diff&&void 0===o.oldid&&(o.oldid="prev"),o.oldid&&("prev"===o.oldid||"next"===o.oldid||"cur"===o.oldid)){const e=o.diff;o.diff=o.oldid,o.oldid=e}return o}function myDecodeURI(e){let i;try{i=decodeURI(e.toString())}catch(t){return e}for(let e=0;e<t.misc.decodeExtras.length;++e){const n=t.misc.decodeExtras[e].from,o=t.misc.decodeExtras[e].to;i=i.split(n).join(o)}return i}function safeDecodeURI(e){return myDecodeURI(e)||e}function isDisambig(e,i){return!(!getValueOf("popupAllDabsStubs")&&i.namespace())&&!i.isTalkPage()&&t.re.disambig.test(e)}function isValidImageName(e){return-1===e.indexOf("{")}function isInMainNamespace(e){return 0===e.namespaceId()}function markNopopupSpanLinks(){getValueOf("popupOnlyArticleLinks")||function fixVectorMenuPopups(){$("div.vectorMenu h3:first a:first, div.vector-menu h3:first a:first, nav.vector-menu h3:first a:first").prop("inNopopupSpan",!0)}();const e=$(".nopopups").toArray();for(let t=0;t<e.length;++t){const i=e[t].getElementsByTagName("a");for(let e=0;e<i.length;++e)i[e].inNopopupSpan=!0}markNopopupSpanLinks.done=!0}function getPageWithCaching(e,i,n){log(`getPageWithCaching, url=${e}`);const o=function findInPageCache(e){for(let i=0;i<t.cache.pages.length;++i)if(e===t.cache.pages[i].url)return i;return-1}(e);let s;o>-1?s=function fakeDownload(e,t,i,n,o,s){const r=newDownload(e,i);return r.owner=s,r.id=t,r.data=n,r.lastModified=o,i(r)}(e,n.idNumber,i,t.cache.pages[o].data,t.cache.pages[o].lastModified,n):(s=function getPage(e,i,n){return log("getPage"),startDownload(e,n.idNumber,function(e){e.aborted||(function addPageToCache(e){log(`addPageToCache ${e.url}`);const i={url:e.url,data:e.data,lastModified:e.lastModified};t.cache.pages.push(i)}(e),i(e))})}(e,i,n),s&&n&&n.addDownload&&(n.addDownload(s),s.owner=n))}function getJsObj(e){try{const t=JSON.parse(e);if(t.warnings)for(let e=0;e<t.warnings.length;e++)t.warnings[e]["*"]?log(t.warnings[e]["*"]):log(t.warnings[e].warnings);else t.error&&errlog(`${t.error.code}: ${t.error.info}`);return t}catch(t){return errlog(`Something went wrong with getJsObj, json=${e}`),1}}function anyChild(e){for(const t in e)return e[t];return null}function upcaseFirst(e){return"string"!=typeof e||""===e?"":e.charAt(0).toUpperCase()+e.substring(1)}function literalizeRegex(e){return mw.util.escapeRegExp(e)}function removeNulls(e){return null!==e}function simplePrintf(e,t){if(!e||!t)return e;const i=[],n=e.parenSplit(/(%s|\$[0-9]+)/);let o=0;do{if(i.push(n.shift()),!n.length)break;const e=n.shift();if("%s"===e)o<t.length?i.push(t[o]):i.push(e),++o;else{const n=parseInt(e.replace("$",""),10)-1;n>-1&&n<t.length?i.push(t[n]):i.push(e)}}while(n.length>0);return i.join("")}function isString(e){return"string"==typeof e||e instanceof String}function zeroFill(e,t=2){return`${e}`.padStart(t,"0")}function map(e,t){return function isArray(e){return Array.isArray(e)}(t)?function map_array(e,t){const i=[];for(let n=0;n<t.length;++n)i.push(e(t[n]));return i}(e,t):function map_object(e,t){const i={};for(const n in t)i[t]=e(t[n]);return i}(e,t)}function retargetDab(e,t,i,n){return log(`retargetDab: newTarget=${e} oldTarget=${t}`),changeLinkTargetLink({newTarget:e,text:e.split(" ").join("&nbsp;"),hint:tprintf("disambigHint",[e]),summary:simplePrintf(getValueOf("popupFixDabsSummary"),[i,e]),clickButton:getValueOf("popupDabsAutoClick"),minor:!0,oldTarget:t,watch:getValueOf("popupWatchDisambiggedPages"),title:n})}function setPopupHTML(e,i,n,o,s){let r=n;void 0===r&&(r=t.idNumber);const p=document.getElementById(i+r);return p?(s||(p.innerHTML=""),isString(e)?p.innerHTML+=e:p.appendChild(e),o&&o(),setTimeout(checkPopupPosition,100),!0):(setTimeout(()=>{setPopupHTML(e,i,r,o)},600),null)}function setPopupTrailer(e,t){return setPopupHTML(e,"popupData",t)}function fillEmptySpans(e){let i,n=!0;"object"==typeof e&&void 0!==e.redir&&e.redir||(n=!1);const o=e.navpopup.parentAnchor;let s,r=null,p=null,a={};n&&"object"==typeof e.redirTarget?s=e.redirTarget:(s=(new Title).fromAnchor(o),r=o.originalTitle||s.hintValue(),a=parseParams(o.href),p=getValueOf("popupHistoricalLinks")?a.oldid:null,i=a.rcid);const u={article:s,hint:r,oldid:p,rcid:i,navpop:e.navpopup,params:a},l=t.structures[getValueOf("popupStructure")];if("object"!=typeof l)return void setPopupHTML("popupError",`Unknown structure (this should never happen): ${t.option.popupStructure}`,e.navpopup.idNumber);const c=flatten(t.misc.layout),g=c.length,d=t.misc.redirSpans;for(let t=0;t<g;++t){const i=d&&-1!==d.indexOf(c[t]);if(i&&!n||!i&&n)continue;const o=l[c[t]];if(void 0===o)continue;let s=setPopupHTML;switch(!getValueOf("popupActiveNavlinks")||0!==c[t].indexOf("popupTopLinks")&&0!==c[t].indexOf("popupRedirTopLinks")||(s=setPopupTipsAndHTML),typeof o){case"function":log(`running ${c[t]}({article:${u.article}, hint:${u.hint}, oldid: ${u.oldid}})`),s(o(u),c[t],e.navpopup.idNumber);break;case"string":s(o,c[t],e.navpopup.idNumber);break;default:errlog(`unknown thing with label ${c[t]} (span index was ${t})`)}}}function flatten(e,t){let i=t;const n=[];void 0===i&&(i=0);for(let t=i;t<e.length;++t){if("object"==typeof e[t])return n.concat(flatten(e[t])).concat(flatten(e,t+1));n.push(e[t])}return n}function popupHTML(e){getValueOf("popupStructure");const i=t.structures[t.option.popupStructure];return"object"!=typeof i?(t.option.popupStructure=t.optionDefault.popupStructure,popupHTML(e)):"function"!=typeof i.popupLayout?"Bad layout":(t.misc.layout=i.popupLayout(),"function"==typeof i.popupRedirSpans?t.misc.redirSpans=i.popupRedirSpans():t.misc.redirSpans=[],makeEmptySpans(t.misc.layout,e.navpopup))}function makeEmptySpans(e,t){let i="";for(let n=0;n<e.length;++n)"string"==typeof e[n]?i+=emptySpanHTML(e[n],t.idNumber,"div"):"object"==typeof e[n]&&e[n].length>0?i=i.parenSplit(RegExp("(</[^>]*?>$)")).join(makeEmptySpans(e[n],t)):"object"==typeof e[n]&&e[n].nodeType&&(i+=emptySpanHTML(e[n].name,t.idNumber,e[n].nodeType));return i}function emptySpanHTML(e,t,i,n){let o=n;const s=i||"span";return o||(o=emptySpanHTML.classAliases[e]),o||(o=e),e===getValueOf("popupDragHandle")&&(o+=" popupDragHandle"),simplePrintf('<%s id="%s" class="%s"></%s>',[s,e+t,o,s])}function popTipsSoonFn(e,t,i){let n=t;n||(n=250);const popTips=function(){setupTooltips(document.getElementById(e),!1,!0,i)};return function(){setTimeout(popTips,n,i)}}function setPopupTipsAndHTML(e,t,i,n){setPopupHTML(e,t,i,getValueOf("popupSubpopups")?popTipsSoonFn(t+i,null,n):null)}function checkPopupPosition(){t.current.link&&t.current.link.navpopup&&t.current.link.navpopup.limitHorizontalPosition()}function mouseOutWikiLink(){const e=this;removeModifierKeyHandler(e),null!==e.navpopup&&void 0!==e.navpopup&&(e.navpopup.isVisible()?(restoreTitle(e),Navpopup.tracker.addHook(posCheckerHook(e.navpopup))):e.navpopup.banish())}function posCheckerHook(e){return function(){if(!e.isVisible())return!0;if(Navpopup.tracker.dirty)return!1;const t=Navpopup.tracker.x,i=Navpopup.tracker.y,n=e.isWithin(t,i,e.fuzz,e.mainDiv)||!function fuzzyCursorOffMenus(e,t,i,n){if(!n)return null;const o=n.getElementsByTagName("ul");for(let e=0;e<o.length;++e)if("popup_menu"===o[e].className&&o[e].offsetWidth>0)return!1;return!0}(0,0,e.fuzz,e.mainDiv);let o=getValueOf("popupHideDelay");if(o&&(o*=1e3),!o)return!n&&(e.parentAnchor&&restoreTitle(e.parentAnchor),e.banish(),!0);const s=+new Date;return e.mouseLeavingTime?n?(e.mouseLeavingTime=null,!1):s-e.mouseLeavingTime>o&&(e.mouseLeavingTime=null,e.banish(),!0):(e.mouseLeavingTime=s,!1)}}function loadAPIPreview(e,i,n){const o=new Title(i).urlString();let s=`${t.wiki.apiwikibase}?format=json&formatversion=2&action=query&`,htmlGenerator=function(){alert("invalid html generator")},r="";switch(e){case"history":s+=`titles=${o}&prop=revisions&rvlimit=${getValueOf("popupHistoryPreviewLimit")}`,htmlGenerator=APIhistoryPreviewHTML;break;case"category":s+=`list=categorymembers&cmtitle=${o}`,htmlGenerator=APIcategoryPreviewHTML;break;case"userinfo":{const e=new Title(i).userName();r=encodeURIComponent(e),t.re.ipUser.test(e)?s+=`list=blocks&bkprop=range|restrictions&bkip=${r}`:s+=`list=users|usercontribs&usprop=blockinfo|groups|editcount|registration|gender&ususers=${r}&meta=globaluserinfo&guiprop=groups|unattached&guiuser=${r}&uclimit=1&ucprop=timestamp&ucuser=${r}`,htmlGenerator=APIuserInfoPreviewHTML;break}case"contribs":r=encodeURIComponent(new Title(i).userName()),s+=`list=usercontribs&ucuser=${r}&uclimit=${getValueOf("popupContribsPreviewLimit")}`,htmlGenerator=APIcontribsPreviewHTML;break;case"imagepagepreview":{let e="";getValueOf("popupImageLinks")&&(e=`&list=imageusage&iutitle=${o}`),s+=`titles=${o}&prop=revisions|imageinfo&rvprop=content${e}`,htmlGenerator=APIimagepagePreviewHTML;break}case"backlinks":s+=`list=backlinks&bltitle=${o}`,htmlGenerator=APIbacklinksPreviewHTML;break;case"revision":i.oldid?s+=`revids=${i.oldid}`:s+=`titles=${i.removeAnchor().urlString()}`,s+="&prop=revisions|pageprops|info|images|categories&rvprop=ids|timestamp|comment|user|content&cllimit=max&imlimit=max",htmlGenerator=APIrevisionPreviewHTML}pendingNavpopTask(n);const callback=async t=>{if(log("callback of API functions was hit"),"userinfo"===e)return await function fetchUserGroupNames(e){const t=getJsObj(e).query,i=anyChild(t.users),n=[];return i.groups&&i.groups.forEach(e=>{n.push(`group-${e}-member`)}),t.globaluserinfo&&t.globaluserinfo.groups&&t.globaluserinfo.groups.forEach(e=>{
function popupFilterStubDetect(e,i,n){const o=function stubCount(e,i){if(!getValueOf("popupAllDabsStubs")&&i.namespace())return!1;let n=0,o=0;if(t.re.stub.test(e)){const i=e.parenSplit(t.re.stub);for(let e=1;e<i.length;e+=2)i[e]?++n:++o}return{real:o,sect:n}}(e,n);return o.real?popupString("stub"):o.sect?popupString("section stub"):""}function popupFilterDisambigDetect(e,t,i){return!getValueOf("popupAllDabsStubs")&&i.namespace()?"":isDisambig(e,i)?popupString("disambig"):""}function parseParams(e){let i=e;const n=t.re.specialdiff.exec(i);if(n){const e=n[1].split("/");if(1===e.length)return{oldid:e[0],diff:"prev"};if(2===e.length)return{oldid:e[0],diff:e[1]}}const o={};if(-1===i.indexOf("?"))return o;i=i.split("#")[0];const s=i.split("?").slice(1).join().split("&");for(let e=0;e<s.length;++e){const t=s[e].split("=");t.push(null),o[t[0]]=t[1]}if(o.diff&&void 0===o.oldid&&(o.oldid="prev"),o.oldid&&("prev"===o.oldid||"next"===o.oldid||"cur"===o.oldid)){const e=o.diff;o.diff=o.oldid,o.oldid=e}return o}function myDecodeURI(e){let i;try{i=decodeURI(e.toString())}catch(t){return e}for(let e=0;e<t.misc.decodeExtras.length;++e){const n=t.misc.decodeExtras[e].from,o=t.misc.decodeExtras[e].to;i=i.split(n).join(o)}return i}function safeDecodeURI(e){return myDecodeURI(e)||e}function isDisambig(e,i){return!(!getValueOf("popupAllDabsStubs")&&i.namespace())&&!i.isTalkPage()&&t.re.disambig.test(e)}function isValidImageName(e){return-1===e.indexOf("{")}function isInMainNamespace(e){return 0===e.namespaceId()}function markNopopupSpanLinks(){getValueOf("popupOnlyArticleLinks")||function fixVectorMenuPopups(){$("div.vectorMenu h3:first a:first, div.vector-menu h3:first a:first, nav.vector-menu h3:first a:first").prop("inNopopupSpan",!0)}();const e=$(".nopopups").toArray();for(let t=0;t<e.length;++t){const i=e[t].getElementsByTagName("a");for(let e=0;e<i.length;++e)i[e].inNopopupSpan=!0}markNopopupSpanLinks.done=!0}function getPageWithCaching(e,i,n){log(`getPageWithCaching, url=${e}`);const o=function findInPageCache(e){for(let i=0;i<t.cache.pages.length;++i)if(e===t.cache.pages[i].url)return i;return-1}(e);let s;o>-1?s=function fakeDownload(e,t,i,n,o,s){const r=newDownload(e,i);return r.owner=s,r.id=t,r.data=n,r.lastModified=o,i(r)}(e,n.idNumber,i,t.cache.pages[o].data,t.cache.pages[o].lastModified,n):(s=function getPage(e,i,n){return log("getPage"),startDownload(e,n.idNumber,function(e){e.aborted||(function addPageToCache(e){log(`addPageToCache ${e.url}`);const i={url:e.url,data:e.data,lastModified:e.lastModified};t.cache.pages.push(i)}(e),i(e))})}(e,i,n),s&&n&&n.addDownload&&(n.addDownload(s),s.owner=n))}function getJsObj(e){try{const t=JSON.parse(e);if(t.warnings)for(let e=0;e<t.warnings.length;e++)t.warnings[e]["*"]?log(t.warnings[e]["*"]):log(t.warnings[e].warnings);else t.error&&errlog(`${t.error.code}: ${t.error.info}`);return t}catch(t){return errlog(`Something went wrong with getJsObj, json=${e}`),1}}function anyChild(e){for(const t in e)return e[t];return null}function upcaseFirst(e){return"string"!=typeof e||""===e?"":e.charAt(0).toUpperCase()+e.substring(1)}function literalizeRegex(e){return mw.util.escapeRegExp(e)}function removeNulls(e){return null!==e}function simplePrintf(e,t){if(!e||!t)return e;const i=[],n=e.parenSplit(/(%s|\$[0-9]+)/);let o=0;do{if(i.push(n.shift()),!n.length)break;const e=n.shift();if("%s"===e)o<t.length?i.push(t[o]):i.push(e),++o;else{const n=parseInt(e.replace("$",""),10)-1;n>-1&&n<t.length?i.push(t[n]):i.push(e)}}while(n.length>0);return i.join("")}function isString(e){return"string"==typeof e||e instanceof String}function zeroFill(e,t=2){return`${e}`.padStart(t,"0")}function map(e,t){return function isArray(e){return Array.isArray(e)}(t)?function map_array(e,t){const i=[];for(let n=0;n<t.length;++n)i.push(e(t[n]));return i}(e,t):function map_object(e,t){const i={};for(const n in t)i[t]=e(t[n]);return i}(e,t)}function retargetDab(e,t,i,n){return log(`retargetDab: newTarget=${e} oldTarget=${t}`),changeLinkTargetLink({newTarget:e,text:e.split(" ").join("&nbsp;"),hint:tprintf("disambigHint",[e]),summary:simplePrintf(getValueOf("popupFixDabsSummary"),[i,e]),clickButton:getValueOf("popupDabsAutoClick"),minor:!0,oldTarget:t,watch:getValueOf("popupWatchDisambiggedPages"),title:n})}function setPopupHTML(e,i,n,o,s){let r=n;void 0===r&&(r=t.idNumber);const p=document.getElementById(i+r);return p?(s||(p.innerHTML=""),isString(e)?p.innerHTML+=e:p.appendChild(e),o&&o(),setTimeout(checkPopupPosition,100),!0):(setTimeout(()=>{setPopupHTML(e,i,r,o)},600),null)}function setPopupTrailer(e,t){return setPopupHTML(e,"popupData",t)}function fillEmptySpans(e){let i,n=!0;"object"==typeof e&&void 0!==e.redir&&e.redir||(n=!1);const o=e.navpopup.parentAnchor;let s,r=null,p=null,a={};n&&"object"==typeof e.redirTarget?s=e.redirTarget:(s=(new Title).fromAnchor(o),r=o.originalTitle||s.hintValue(),a=parseParams(o.href),p=getValueOf("popupHistoricalLinks")?a.oldid:null,i=a.rcid);const u={article:s,hint:r,oldid:p,rcid:i,navpop:e.navpopup,params:a},l=t.structures[getValueOf("popupStructure")];if("object"!=typeof l)return void setPopupHTML("popupError",`Unknown structure (this should never happen): ${t.option.popupStructure}`,e.navpopup.idNumber);const c=flatten(t.misc.layout),g=c.length,d=t.misc.redirSpans;for(let t=0;t<g;++t){const i=d&&-1!==d.indexOf(c[t]);if(i&&!n||!i&&n)continue;const o=l[c[t]];if(void 0===o)continue;let s=setPopupHTML;switch(!getValueOf("popupActiveNavlinks")||0!==c[t].indexOf("popupTopLinks")&&0!==c[t].indexOf("popupRedirTopLinks")||(s=setPopupTipsAndHTML),typeof o){case"function":log(`running ${c[t]}({article:${u.article}, hint:${u.hint}, oldid: ${u.oldid}})`),s(o(u),c[t],e.navpopup.idNumber);break;case"string":s(o,c[t],e.navpopup.idNumber);break;default:errlog(`unknown thing with label ${c[t]} (span index was ${t})`)}}}function flatten(e,t){let i=t;const n=[];void 0===i&&(i=0);for(let t=i;t<e.length;++t){if("object"==typeof e[t])return n.concat(flatten(e[t])).concat(flatten(e,t+1));n.push(e[t])}return n}function popupHTML(e){getValueOf("popupStructure");const i=t.structures[t.option.popupStructure];return"object"!=typeof i?(t.option.popupStructure=t.optionDefault.popupStructure,popupHTML(e)):"function"!=typeof i.popupLayout?"Bad layout":(t.misc.layout=i.popupLayout(),"function"==typeof i.popupRedirSpans?t.misc.redirSpans=i.popupRedirSpans():t.misc.redirSpans=[],makeEmptySpans(t.misc.layout,e.navpopup))}function makeEmptySpans(e,t){let i="";for(let n=0;n<e.length;++n)"string"==typeof e[n]?i+=emptySpanHTML(e[n],t.idNumber,"div"):"object"==typeof e[n]&&e[n].length>0?i=i.parenSplit(RegExp("(</[^>]*?>$)")).join(makeEmptySpans(e[n],t)):"object"==typeof e[n]&&e[n].nodeType&&(i+=emptySpanHTML(e[n].name,t.idNumber,e[n].nodeType));return i}function emptySpanHTML(e,t,i,n){let o=n;const s=i||"span";return o||(o=emptySpanHTML.classAliases[e]),o||(o=e),e===getValueOf("popupDragHandle")&&(o+=" popupDragHandle"),simplePrintf('<%s id="%s" class="%s"></%s>',[s,e+t,o,s])}function popTipsSoonFn(e,t,i){let n=t;n||(n=250);const popTips=function(){setupTooltips(document.getElementById(e),!1,!0,i)};return function(){setTimeout(popTips,n,i)}}function setPopupTipsAndHTML(e,t,i,n){setPopupHTML(e,t,i,getValueOf("popupSubpopups")?popTipsSoonFn(t+i,null,n):null)}function checkPopupPosition(){t.current.link&&t.current.link.navpopup&&t.current.link.navpopup.limitHorizontalPosition()}function mouseOutWikiLink(){const e=this;removeModifierKeyHandler(e),null!==e.navpopup&&void 0!==e.navpopup&&(e.navpopup.isVisible()?(restoreTitle(e),Navpopup.tracker.addHook(posCheckerHook(e.navpopup))):e.navpopup.banish())}function posCheckerHook(e){return function(){if(!e.isVisible())return!0;if(Navpopup.tracker.dirty)return!1;const t=Navpopup.tracker.x,i=Navpopup.tracker.y,n=e.isWithin(t,i,e.fuzz,e.mainDiv)||!function fuzzyCursorOffMenus(e,t,i,n){if(!n)return null;const o=n.getElementsByTagName("ul");for(let e=0;e<o.length;++e)if("popup_menu"===o[e].className&&o[e].offsetWidth>0)return!1;return!0}(0,0,e.fuzz,e.mainDiv);let o=getValueOf("popupHideDelay");if(o&&(o*=1e3),!o)return!n&&(e.parentAnchor&&restoreTitle(e.parentAnchor),e.banish(),!0);const s=+new Date;return e.mouseLeavingTime?n?(e.mouseLeavingTime=null,!1):s-e.mouseLeavingTime>o&&(e.mouseLeavingTime=null,e.banish(),!0):(e.mouseLeavingTime=s,!1)}}function loadAPIPreview(e,i,n){const o=new Title(i).urlString();let s=`${t.wiki.apiwikibase}?format=json&formatversion=2&action=query&`,htmlGenerator=function(){alert("invalid html generator")},r="";switch(e){case"history":s+=`titles=${o}&prop=revisions&rvlimit=${getValueOf("popupHistoryPreviewLimit")}`,htmlGenerator=APIhistoryPreviewHTML;break;case"category":s+=`list=categorymembers&cmtitle=${o}`,htmlGenerator=APIcategoryPreviewHTML;break;case"userinfo":{const e=new Title(i).userName();r=encodeURIComponent(e),t.re.ipUser.test(e)?s+=`list=blocks&bkprop=range|restrictions&bkip=${r}`:s+=`list=users|usercontribs&usprop=blockinfo|groups|editcount|registration|gender&ususers=${r}&meta=globaluserinfo&guiprop=groups|unattached&guiuser=${r}&uclimit=1&ucprop=timestamp&ucuser=${r}`,htmlGenerator=APIuserInfoPreviewHTML;break}case"contribs":r=encodeURIComponent(new Title(i).userName()),s+=`list=usercontribs&ucuser=${r}&uclimit=${getValueOf("popupContribsPreviewLimit")}`,htmlGenerator=APIcontribsPreviewHTML;break;case"imagepagepreview":{let e="";getValueOf("popupImageLinks")&&(e=`&list=imageusage&iutitle=${o}`),s+=`titles=${o}&prop=revisions|imageinfo&rvprop=content${e}`,htmlGenerator=APIimagepagePreviewHTML;break}case"backlinks":s+=`list=backlinks&bltitle=${o}`,htmlGenerator=APIbacklinksPreviewHTML;break;case"revision":i.oldid?s+=`revids=${i.oldid}`:s+=`titles=${i.removeAnchor().urlString()}`,s+="&prop=revisions|pageprops|info|images|categories&rvprop=ids|timestamp|comment|user|content&cllimit=max&imlimit=max",htmlGenerator=APIrevisionPreviewHTML}pendingNavpopTask(n);const callback=async t=>{if(log("callback of API functions was hit"),"userinfo"===e)return await function fetchUserGroupNames(e){const t=getJsObj(e).query,i=anyChild(t.users),n=[];return i.groups&&i.groups.forEach(e=>{n.push(`group-${e}-member`)}),t.globaluserinfo&&t.globaluserinfo.groups&&t.globaluserinfo.groups.forEach(e=>{
n.push(`group-${e}-member`)}),getMwApi().loadMessagesIfMissing(n)}(t.data),void showAPIPreview(e,htmlGenerator(i,t,n),n.idNumber,n,t);showAPIPreview(e,htmlGenerator(i,t,n),n.idNumber,n,t)},go=function(){return getPageWithCaching(s,callback,n),!0};n.visible||!getValueOf("popupLazyDownloads")?go():n.addHook(go,"unhide","before",`DOWNLOAD_${e}_QUERY_DATA`)}function linkList(e){e.sort((e,t)=>e===t?0:e<t?-1:1);const t=[];for(let i=0;i<e.length;++i)t.push(wikiLink({article:new Title(e[i]),text:e[i].split(" ").join("&nbsp;"),action:"view"}));return t.join(popupString("separator"))}function getTimeOffset(){const e=mw.user.options.get("timecorrection");return e&&e.indexOf("|")>-1?parseInt(e.split("|")[1],10):0}function getTimeZone(){if(!t.user.timeZone){const e=mw.user.options.get("timecorrection");if(t.user.timeZone="UTC",e){const i=e.split("|");3===i.length&&"ZoneInfo"===i[0]?t.user.timeZone=i[2]:errlog(`Unexpected timezone information: ${e}`)}}return t.user.timeZone}function useTimeOffset(){if(void 0===Intl.DateTimeFormat.prototype.formatToParts)return!0;const e=mw.user.options.get("timecorrection");return!(!e||-1!==e.indexOf("ZoneInfo|"))}function getLocales(){if(!t.user.locales){let e=document.querySelector("html").getAttribute("lang");getValueOf("popupLocale")?e=getValueOf("popupLocale"):"en"===e&&(e="mdy"===getMWDateFormat()?"en-US":"en-GB"),t.user.locales=Intl.DateTimeFormat.supportedLocalesOf([e,navigator.language])}return t.user.locales}function getMWDateFormat(){return mw.user.options.get("date")}function adjustDate(e,t){return new Date(+e+60*t*1e3)}function convertTimeZone(e,t){return new Date(e.toLocaleString("en-US",{timeZone:t}))}function formattedDate(e){if(useTimeOffset()){const t=adjustDate(e,getTimeOffset());return map(zeroFill,[t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate()]).join("-")}if("ISO 8601"===getMWDateFormat()){const t=convertTimeZone(e,getTimeZone());return map(zeroFill,[t.getFullYear(),t.getMonth()+1,t.getDate()]).join("-")}const t=getValueOf("popupDateFormatterOptions");return t.timeZone=getTimeZone(),e.toLocaleDateString(getLocales(),t)}function formattedTime(e){if(useTimeOffset()){const t=adjustDate(e,getTimeOffset());return map(zeroFill,[t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds()]).join(":")}if("ISO 8601"===getMWDateFormat()){const t=convertTimeZone(e,getTimeZone());return map(zeroFill,[t.getHours(),t.getMinutes(),t.getSeconds()]).join(":")}const t=getValueOf("popupTimeFormatterOptions");return t.timeZone=getTimeZone(),e.toLocaleTimeString(getLocales(),t)}function showAPIPreview(e,i,n,o,s){let r="popupPreview";switch(completedNavpopTask(o),e){case"imagelinks":case"category":r="popupPostPreview";break;case"userinfo":r="popupUserData";break;case"revision":return void function insertPreview(e){if(!e.owner)return;const i=t.re.redirect.exec(e.data);if(0===e.owner.redir&&i)!function loadPreviewFromRedir(e,t){const i=(new Title).fromWikiText(e[2]);t.article.anchor&&(i.anchor=t.article.anchor),t.redir++,t.redirTarget=i;const n=function redirLink(e,t){let i="";return getValueOf("popupAppendRedirNavLinks")&&getValueOf("popupNavLinks")?(i+="<hr />",getValueOf("popupFixRedirs")&&autoEdit?(i+=popupString("Redirects to: (Fix "),log(`redirLink: newTarget=${e}`),i+=addPopupShortcut(changeLinkTargetLink({newTarget:e,text:popupString("target"),hint:popupString("Fix this redirect, changing just the link target"),summary:simplePrintf(getValueOf("popupFixRedirsSummary"),[t.toString(),e]),oldTarget:t.toString(),clickButton:getValueOf("popupRedirAutoClick"),minor:!0,watch:getValueOf("popupWatchRedirredPages")}),"R"),i+=popupString(" or "),i+=addPopupShortcut(changeLinkTargetLink({newTarget:e,text:popupString("target & label"),hint:popupString("Fix this redirect, changing the link target and label"),summary:simplePrintf(getValueOf("popupFixRedirsSummary"),[t.toString(),e]),oldTarget:t.toString(),clickButton:getValueOf("popupRedirAutoClick"),minor:!0,watch:getValueOf("popupWatchRedirredPages"),alsoChangeLabel:!0}),"R"),i+=popupString(")")):i+=popupString("Redirects")+popupString(" to "),i):`<br> ${popupString("Redirects")}${popupString(" to ")}${titledWikiLink({article:(new Title).fromWikiText(e),action:"view",text:safeDecodeURI(e),title:popupString("Bypass redirect")})}`}(i,t.article);setPopupHTML(n,"popupWarnRedir",t.idNumber),t.article=i,fillEmptySpans({redir:!0,redirTarget:i,navpopup:t}),loadPreview(i,null,t)}(i,e.owner);else if(e.owner.visible||!getValueOf("popupLazyPreviews"))insertPreviewNow(e);else{const t=e.owner.redir?"PREVIEW_REDIR_HOOK":"PREVIEW_HOOK";e.owner.addHook(()=>(insertPreviewNow(e),!0),"unhide","after",t)}}(s)}setPopupTipsAndHTML(i,r,n)}function APIrevisionPreviewHTML(e,t){try{const e=anyChild(getJsObj(t.data).query.pages);if(e.missing)return void(t.owner=null);const i=e&&e.revisions&&"wikitext"===e.revisions[0].contentmodel?e.revisions[0].content:null;"string"==typeof i&&(t.data=i,t.lastModified=new Date(e.revisions[0].timestamp))}catch(e){return"Revision preview failed :("}}function APIbacklinksPreviewHTML(e,i){try{const e=getJsObj(i.data),n=e.query.backlinks;let o=[];if(!n)return popupString("No backlinks found");for(let e=0;e<n.length;e++){const i=new Title(n[e].title);o.push(`<a href="${t.wiki.titlebase}${i.urlString()}">${i.toString().entify()}</a>`)}return o=o.join(popupString("separator")),e.continue&&e.continue.blcontinue&&(o+=popupString(" and more")),o}catch(e){return"backlinksPreviewHTML went wonky"}}function APIimagepagePreviewHTML(e,i,n){try{const o=anyChild(getJsObj(i.data).query.pages),s=o&&o.revisions&&"wikitext"===o.revisions[0].contentmodel?o.revisions[0].content:null;let r="",p="";try{p=n.parentAnchor.childNodes[0].alt}catch{}if(p&&(r=`${r}<hr /><b>${popupString("Alt text:")}</b> ${t.escapeQuotesHTML(p)}`),"string"==typeof s){const t=prepPreviewmaker(s,e,n);if(t.makePreview(),t.html&&(r+=`<hr />${t.html}`),getValueOf("popupSummaryData")){const e=getPageInfo(s,i);log(e),setPopupTrailer(e,n.idNumber)}}if(o&&"shared"===o.imagerepository){const i=new Title(e),o=encodeURIComponent(`File:${i.stripNamespace()}`),s=`${t.wiki.apicommonsbase}?format=json&formatversion=2&callback=pg.fn.APIsharedImagePagePreviewHTML&requestid=${n.idNumber}&action=query&prop=revisions&rvprop=content&titles=${o}`;r=`${r}<hr />${popupString("Image from Commons")}: <a href="${t.wiki.commonsbase}?title=${o}">${popupString("Description page")}</a>`,mw.loader.load(s)}return showAPIPreview("imagelinks",function APIimagelinksPreviewHTML(e,t){try{const e=getJsObj(t.data).query.imageusage;if(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].title);return 0===t.length?popupString("No image links found"):`<h2>${popupString("File links")}</h2>${linkList(t)}`}return popupString("No image links found")}catch(e){return"Image links preview generation failed :("}}(0,i),n.idNumber,i),r}catch(e){return"API imagepage preview failed :("}}function APIcategoryPreviewHTML(e,t){try{const e=getJsObj(t.data),i=e.query.categorymembers;let n=[];for(let e=0;e<i.length;e++)n.push(i[e].title);return 0===n.length?popupString("Empty category"):(n=`<h2>${tprintf("Category members (%s shown)",[n.length])}</h2>${linkList(n)}`,e.continue&&e.continue.cmcontinue&&(n+=popupString(" and more")),n)}catch(e){return"Category preview failed :("}}function APIuserInfoPreviewHTML(e,i){let n=[],o={};try{o=getJsObj(i.data).query}catch(e){return"Userinfo preview failed :("}const s=anyChild(o.users);if(s){const e=o.globaluserinfo;if(""===s.invalid?n.push(popupString("Invalid user")):""===s.missing&&n.push(popupString("Not a registered username")),s.blockedby&&(s.blockpartial?n.push(`<b>${popupString("Has blocks")}</b>`):n.push(`<b>${popupString("BLOCKED")}</b>`)),e&&(Reflect.has(e,"locked")||Reflect.has(e,"hidden"))){let t=!0;for(let i=0;e.unattached&&i<e.unattached.length;i++)if(e.unattached[i].wiki===mw.config.get("wgDBname")){t=!1;break}t&&(Reflect.has(e,"locked")&&n.push(`<b><i>${popupString("LOCKED")}</i></b>`),Reflect.has(e,"hidden")&&n.push(`<b><i>${popupString("HIDDEN")}</i></b>`))}if(getValueOf("popupShowGender")&&s.gender)switch(s.gender){case"male":n.push(popupString("♂"));break;case"female":n.push(popupString("♀"))}if(s.groups){const e=[];s.groups.forEach(i=>{-1===["*","user","autoconfirmed"].indexOf(i)&&e.push(t.escapeQuotesHTML(mw.message(`group-${i}-member`,s.gender).text()))}),-1===s.groups.indexOf("autoconfirmed")&&e.push(`<b>${t.escapeQuotesHTML(popupString("group-no-autoconfirmed"))}</b>`),0===e.length&&e.push(t.escapeQuotesHTML(mw.message("group-user-member",s.gender).text())),n.push(e.join(popupString("separator")))}if(e&&e.groups){const i=[];e.groups.forEach(e=>{i.push(`<i>${t.escapeQuotesHTML(mw.message(`group-${e}-member`,s.gender).text())}</i>`)}),n.push(i.join(popupString("separator")))}s.registration&&n.push(t.escapeQuotesHTML((s.editcount?s.editcount:"0")+popupString(" edits since: ")+(s.registration?formattedDate(new Date(s.registration)):"")))}if(o.usercontribs&&o.usercontribs.length&&n.push(popupString("last edit on ")+formattedDate(new Date(o.usercontribs[0].timestamp))),o.blocks){n.push(popupString("IP user"));for(let e=0;e<o.blocks.length;e++){let t=o.blocks[e].rangestart===o.blocks[e].rangeend?"BLOCK":"RANGEBLOCK";t=Array.isArray(o.blocks[e].restrictions)?`${t}ED`:`Has ${t.toLowerCase()}s`,n.push(`<b>${popupString(t)}</b>`)}}return n=`<hr />${n.join(popupString("comma"))}`,n}function APIcontribsPreviewHTML(e,t,i){return APIhistoryPreviewHTML(e,t,0,!0)}function APIhistoryPreviewHTML(e,i,n,o){try{const n=getJsObj(i.data);let s=[];s=o?n.query.usercontribs:anyChild(n.query.pages).revisions;const r=function editPreviewTable(e,i,n){let o,s=["<table>"],r=null,p=e,a=null;if(n)o=function(e){let i="(";return i+=`<a href="${t.wiki.titlebase}${new Title(e.title).urlString()}&diff=prev&oldid=${e.revid}">${popupString("diff")}</a>`,i+="&nbsp;|&nbsp;",i+=`<a href="${t.wiki.titlebase}${new Title(e.title).urlString()}&action=history">${popupString("hist")}</a>`,i+=")",i};else{const e=i[0].revid;o=function(i){let n="(";return n+=`<a href="${t.wiki.titlebase}${new Title(p).urlString()}&diff=${e}&oldid=${i.revid}">${popupString("cur")}</a>`,n+="&nbsp;|&nbsp;",
n.push(`group-${e}-member`)}),getMwApi().loadMessagesIfMissing(n)}(t.data),void showAPIPreview(e,htmlGenerator(i,t,n),n.idNumber,n,t);showAPIPreview(e,htmlGenerator(i,t,n),n.idNumber,n,t)},go=function(){return getPageWithCaching(s,callback,n),!0};n.visible||!getValueOf("popupLazyDownloads")?go():n.addHook(go,"unhide","before",`DOWNLOAD_${e}_QUERY_DATA`)}function linkList(e){e.sort((e,t)=>e===t?0:e<t?-1:1);const t=[];for(let i=0;i<e.length;++i)t.push(wikiLink({article:new Title(e[i]),text:e[i].split(" ").join("&nbsp;"),action:"view"}));return t.join(popupString("separator"))}function getTimeOffset(){const e=mw.user.options.get("timecorrection");return e&&e.indexOf("|")>-1?parseInt(e.split("|")[1],10):0}function getTimeZone(){if(!t.user.timeZone){const e=mw.user.options.get("timecorrection");if(t.user.timeZone="UTC",e){const i=e.split("|");3===i.length&&"ZoneInfo"===i[0]?t.user.timeZone=i[2]:errlog(`Unexpected timezone information: ${e}`)}}return t.user.timeZone}function useTimeOffset(){if(void 0===Intl.DateTimeFormat.prototype.formatToParts)return!0;const e=mw.user.options.get("timecorrection");return!(!e||-1!==e.indexOf("ZoneInfo|"))}function getLocales(){if(!t.user.locales){let e=document.querySelector("html").getAttribute("lang");getValueOf("popupLocale")?e=getValueOf("popupLocale"):"en"===e&&(e="mdy"===getMWDateFormat()?"en-US":"en-GB"),t.user.locales=Intl.DateTimeFormat.supportedLocalesOf([e,navigator.language])}return t.user.locales}function getMWDateFormat(){return mw.user.options.get("date")}function adjustDate(e,t){return new Date(+e+60*t*1e3)}function convertTimeZone(e,t){return new Date(e.toLocaleString("en-US",{timeZone:t}))}function formattedDate(e){if(useTimeOffset()){const t=adjustDate(e,getTimeOffset());return map(zeroFill,[t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate()]).join("-")}if("ISO 8601"===getMWDateFormat()){const t=convertTimeZone(e,getTimeZone());return map(zeroFill,[t.getFullYear(),t.getMonth()+1,t.getDate()]).join("-")}const t=getValueOf("popupDateFormatterOptions");return t.timeZone=getTimeZone(),e.toLocaleDateString(getLocales(),t)}function formattedTime(e){if(useTimeOffset()){const t=adjustDate(e,getTimeOffset());return map(zeroFill,[t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds()]).join(":")}if("ISO 8601"===getMWDateFormat()){const t=convertTimeZone(e,getTimeZone());return map(zeroFill,[t.getHours(),t.getMinutes(),t.getSeconds()]).join(":")}const t=getValueOf("popupTimeFormatterOptions");return t.timeZone=getTimeZone(),e.toLocaleTimeString(getLocales(),t)}function showAPIPreview(e,i,n,o,s){let r="popupPreview";switch(completedNavpopTask(o),e){case"imagelinks":case"category":r="popupPostPreview";break;case"userinfo":r="popupUserData";break;case"revision":return void function insertPreview(e){if(!e.owner)return;const i=t.re.redirect.exec(e.data);if(0===e.owner.redir&&i)!function loadPreviewFromRedir(e,t){const i=(new Title).fromWikiText(e[2]);t.article.anchor&&(i.anchor=t.article.anchor),t.redir++,t.redirTarget=i;const n=function redirLink(e,t){let i="";return getValueOf("popupAppendRedirNavLinks")&&getValueOf("popupNavLinks")?(i+="<hr />",getValueOf("popupFixRedirs")&&autoEdit?(i+=popupString("Redirects to: (Fix "),log(`redirLink: newTarget=${e}`),i+=addPopupShortcut(changeLinkTargetLink({newTarget:e,text:popupString("target"),hint:popupString("Fix this redirect, changing just the link target"),summary:simplePrintf(getValueOf("popupFixRedirsSummary"),[t.toString(),e]),oldTarget:t.toString(),clickButton:getValueOf("popupRedirAutoClick"),minor:!0,watch:getValueOf("popupWatchRedirredPages")}),"R"),i+=popupString(" or "),i+=addPopupShortcut(changeLinkTargetLink({newTarget:e,text:popupString("target & label"),hint:popupString("Fix this redirect, changing the link target and label"),summary:simplePrintf(getValueOf("popupFixRedirsSummary"),[t.toString(),e]),oldTarget:t.toString(),clickButton:getValueOf("popupRedirAutoClick"),minor:!0,watch:getValueOf("popupWatchRedirredPages"),alsoChangeLabel:!0}),"R"),i+=popupString(")")):i+=popupString("Redirects")+popupString(" to "),i):`<br> ${popupString("Redirects")}${popupString(" to ")}${titledWikiLink({article:(new Title).fromWikiText(e),action:"view",text:safeDecodeURI(e),title:popupString("Bypass redirect")})}`}(i,t.article);setPopupHTML(n,"popupWarnRedir",t.idNumber),t.article=i,fillEmptySpans({redir:!0,redirTarget:i,navpopup:t}),loadPreview(i,null,t)}(i,e.owner);else if(e.owner.visible||!getValueOf("popupLazyPreviews"))insertPreviewNow(e);else{const t=e.owner.redir?"PREVIEW_REDIR_HOOK":"PREVIEW_HOOK";e.owner.addHook(()=>(insertPreviewNow(e),!0),"unhide","after",t)}}(s)}setPopupTipsAndHTML(i,r,n)}function APIrevisionPreviewHTML(e,t){try{const e=anyChild(getJsObj(t.data).query.pages);if(e.missing)return void(t.owner=null);const i=e&&e.revisions&&"wikitext"===e.revisions[0].contentmodel?e.revisions[0].content:null;"string"==typeof i&&(t.data=i,t.lastModified=new Date(e.revisions[0].timestamp))}catch(e){return"Revision preview failed :("}}function APIbacklinksPreviewHTML(e,i){try{const e=getJsObj(i.data),n=e.query.backlinks;let o=[];if(!n)return popupString("No backlinks found");for(let e=0;e<n.length;e++){const i=new Title(n[e].title);o.push(`<a href="${t.wiki.titlebase}${i.urlString()}">${i.toString().entify()}</a>`)}return o=o.join(popupString("separator")),e.continue&&e.continue.blcontinue&&(o+=popupString(" and more")),o}catch(e){return"backlinksPreviewHTML went wonky"}}function APIimagepagePreviewHTML(e,i,n){try{const o=anyChild(getJsObj(i.data).query.pages),s=o&&o.revisions&&"wikitext"===o.revisions[0].contentmodel?o.revisions[0].content:null;let r="",p="";try{p=n.parentAnchor.childNodes[0].alt}catch{}if(p&&(r=`${r}<hr /><b>${popupString("Alt text:")}</b> ${t.escapeQuotesHTML(p)}`),"string"==typeof s){const t=prepPreviewmaker(s,e,n);if(t.makePreview(),t.html&&(r+=`<hr />${t.html}`),getValueOf("popupSummaryData")){const e=getPageInfo(s,i);log(e),setPopupTrailer(e,n.idNumber)}}if(o&&"shared"===o.imagerepository){const i=new Title(e),o=encodeURIComponent(`File:${i.stripNamespace()}`),s=`${t.wiki.apicommonsbase}?format=json&formatversion=2&callback=pg.fn.APIsharedImagePagePreviewHTML&requestid=${n.idNumber}&action=query&prop=revisions&rvprop=content&titles=${o}`;r=`${r}<hr />${popupString("Image from Commons")}: <a href="${t.wiki.commonsbase}?title=${o}">${popupString("Description page")}</a>`,mw.loader.load(s)}return showAPIPreview("imagelinks",function APIimagelinksPreviewHTML(e,t){try{const e=getJsObj(t.data).query.imageusage;if(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].title);return 0===t.length?popupString("No image links found"):`<h2>${popupString("File links")}</h2>${linkList(t)}`}return popupString("No image links found")}catch(e){return"Image links preview generation failed :("}}(0,i),n.idNumber,i),r}catch(e){return"API imagepage preview failed :("}}function APIcategoryPreviewHTML(e,t){try{const e=getJsObj(t.data),i=e.query.categorymembers;let n=[];for(let e=0;e<i.length;e++)n.push(i[e].title);return 0===n.length?popupString("Empty category"):(n=`<h2>${tprintf("Category members (%s shown)",[n.length])}</h2>${linkList(n)}`,e.continue&&e.continue.cmcontinue&&(n+=popupString(" and more")),n)}catch(e){return"Category preview failed :("}}function APIuserInfoPreviewHTML(e,i){let n=[],o={};try{o=getJsObj(i.data).query}catch(e){return"Userinfo preview failed :("}const s=anyChild(o.users);if(s){const e=o.globaluserinfo;if(""===s.invalid?n.push(popupString("Invalid user")):""===s.missing&&n.push(popupString("Not a registered username")),s.blockedby&&(s.blockpartial?n.push(`<b>${popupString("Has blocks")}</b>`):n.push(`<b>${popupString("BLOCKED")}</b>`)),e&&(Reflect.has(e,"locked")||Reflect.has(e,"hidden"))){let t=!0;for(let i=0;e.unattached&&i<e.unattached.length;i++)if(e.unattached[i].wiki===mw.config.get("wgDBname")){t=!1;break}t&&(Reflect.has(e,"locked")&&n.push(`<b><i>${popupString("LOCKED")}</i></b>`),Reflect.has(e,"hidden")&&n.push(`<b><i>${popupString("HIDDEN")}</i></b>`))}if(getValueOf("popupShowGender")&&s.gender)switch(s.gender){case"male":n.push(popupString("♂"));break;case"female":n.push(popupString("♀"))}if(s.groups){const e=[];s.groups.forEach(i=>{-1===["*","user","autoconfirmed"].indexOf(i)&&e.push(t.escapeQuotesHTML(mw.message(`group-${i}-member`,s.gender).text()))}),-1===s.groups.indexOf("autoconfirmed")&&e.push(`<b>${t.escapeQuotesHTML(popupString("group-no-autoconfirmed"))}</b>`),0===e.length&&e.push(t.escapeQuotesHTML(mw.message("group-user-member",s.gender).text())),n.push(e.join(popupString("separator")))}if(e&&e.groups){const i=[];e.groups.forEach(e=>{i.push(`<i>${t.escapeQuotesHTML(mw.message(`group-${e}-member`,s.gender).text())}</i>`)}),n.push(i.join(popupString("separator")))}s.registration&&n.push(t.escapeQuotesHTML((s.editcount?s.editcount:"0")+popupString(" edits since: ")+(s.registration?formattedDate(new Date(s.registration)):"")))}if(o.usercontribs&&o.usercontribs.length&&n.push(popupString("last edit on ")+formattedDate(new Date(o.usercontribs[0].timestamp))),o.blocks){n.push(popupString("IP user"));for(let e=0;e<o.blocks.length;e++){let t=o.blocks[e].rangestart===o.blocks[e].rangeend?"BLOCK":"RANGEBLOCK";t=Array.isArray(o.blocks[e].restrictions)?`${t}ED`:`Has ${t.toLowerCase()}s`,n.push(`<b>${popupString(t)}</b>`)}}return n=`<hr />${n.join(popupString("comma"))}`,n}function APIcontribsPreviewHTML(e,t,i){return APIhistoryPreviewHTML(e,t,0,!0)}function APIhistoryPreviewHTML(e,i,n,o){try{const n=getJsObj(i.data);let s=[];s=o?n.query.usercontribs:anyChild(n.query.pages).revisions;const r=function editPreviewTable(e,i,n){let o,s=["<table>"],r=null,p=e,a=null;if(n)o=function(e){let i="(";return i+=`<a href="${t.wiki.titlebase}${new Title(e.title).urlString()}&diff=prev&oldid=${e.revid}">${popupString("diff")}</a>`,i+="&nbsp;|&nbsp;",i+=`<a href="${t.wiki.titlebase}${new Title(e.title).urlString()}&action=history">${popupString("hist")}</a>`,i+=")",i};else{const e=i[0].revid;o=function(i){let n="(";return n+=`<a href="${t.wiki.titlebase}${new Title(p).urlString()}&diff=${e}&oldid=${i.revid}">${popupString("cur")}</a>`,n+="&nbsp;|&nbsp;",
n+=`<a href="${t.wiki.titlebase}${new Title(p).urlString()}&diff=prev&oldid=${i.revid}">${popupString("last")}</a>`,n+=")",n}}for(let e=0;e<i.length;++e){n&&(a=i[e].title,p=new Title(a));const u=i[e].minor?"<b>m </b>":"",l=new Date(i[e].timestamp);let c=formattedDate(l);const g=formattedTime(l);c===r?c="":r=c,c&&s.push(`<tr><td colspan=3><span class="popup_history_date">${c}</span></td></tr>`),s.push(`<tr class="popup_history_row_${e%2?"odd":"even"}">`),s.push(`<td>${o(i[e])}</td>`),s.push(`<td><a href="${t.wiki.titlebase}${new Title(p).urlString()}&oldid=${i[e].revid}">${g}</a></td>`);let d="",h="";if(n)d=t.wiki.titlebase+p.urlString(),h=t.escapeQuotesHTML(a);else{const n=i[e].user;i[e].userhidden?(d=getValueOf("popupRevDelUrl"),h=t.escapeQuotesHTML(popupString("revdel"))):(d=t.re.ipUser.test(n)?`${t.wiki.titlebase+mw.config.get("wgFormattedNamespaces")[t.nsSpecialId]}:Contributions&target=${new Title(n).urlString()}`:`${t.wiki.titlebase+mw.config.get("wgFormattedNamespaces")[t.nsUserId]}:${new Title(n).urlString()}`,h=t.escapeQuotesHTML(n))}s.push(`<td>${n?u:""}<a href="${d}">${h}</a></td>`);let m="";const w=i[e].comment||(void 0!==i[e].slots?i[e].slots.main.content:null);w?m=new Previewmaker(w,new Title(p).toUrl()).editSummaryPreview():i[e].commenthidden&&(m=popupString("revdel")),s.push(`<td>${n?"":u}${m}</td>`),s.push("</tr>"),s=[s.join("")]}return s.push("</table>"),s.join("")}(e,s,o);return r}catch(e){return"History preview failed :-("}}function loadImage(e,i){if("function"!=typeof e.stripNamespace&&alert("loadImages bad"),!getValueOf("popupImages"))return;if(!isValidImageName(e))return!1;const n=e.urlString();let o=`${t.wiki.apiwikibase}?format=json&formatversion=2&action=query`;o+=`&prop=imageinfo&iiprop=url|mime&iiurlwidth=${getValueOf("popupImageSizeLarge")}`,o+=`&titles=${n}`,pendingNavpopTask(i);const callback=function(e){!function popupsInsertImage(e,i,n){let o;log("popupsInsertImage");try{const e=anyChild(getJsObj(n.data).query.pages);if(void 0===e.imageinfo)return;o=e.imageinfo[0]}catch(e){return void log("popupsInsertImage failed :(")}const s=document.getElementById(`popupImg${e}`);if(!s)return void log("could not find insertion point for image");s.width=getValueOf("popupImageSize"),s.style.display="inline",o.thumburl?s.src=o.thumburl:0===o.mime.indexOf("image")?(s.src=o.url,log("a thumb could not be found, using original image")):log("fullsize imagethumb, but not sure if it's an image");const r=document.getElementById(`popupImageLink${e}`);if(null===r)return null;switch(getValueOf("popupThumbAction")){case"imagepage":if(t.current.article.namespaceId()!==t.nsImageId){r.href=o.descriptionurl,popTipsSoonFn(`popupImage${e}`)();break}case"sizetoggle":return r.onclick=toggleSize,void(r.title=popupString("Toggle image size"));case"linkfull":r.href=o.url,r.title=popupString("Open full-size image")}}(i.idNumber,0,e)},go=function(){return getPageWithCaching(o,callback,i),!0};i.visible||!getValueOf("popupLazyDownloads")?go():i.addHook(go,"unhide","after","DOWNLOAD_IMAGE_QUERY_DATA")}function toggleSize(){if(!this)return void alert("imgContainer is null :/");const e=this.firstChild;e?e.style.width&&""!==e.style.width?e.style.width="":e.style.width="100%":alert("img is null :/")}function nsRe(e){const t=[];return jQuery.each(mw.config.get("wgNamespaceIds"),(i,n)=>{const o=upcaseFirst(i);n===e&&(t.push(mw.util.escapeRegExp(o).split(" ").join("[ _]")),t.push(mw.util.escapeRegExp(encodeURI(o))))}),`(?:${t.join("|")})`}function doSelectionPopup(){const e=function getEditboxSelection(){let e;try{e=document.editform.wpTextbox1}catch(e){return}if(document.selection)return document.selection.createRange().text;const t=e.selectionStart,i=e.selectionEnd;return e.value.substring(t,i)}(),i=e.indexOf("[["),n=e.indexOf("|"),o=e.indexOf("]]");if(-1===i||-1===n&&-1===o)return;if(-1!==n&&i>n||-1!==o&&i>o)return;const s=new Title(e.substring(i+2,n<0?o:n));if("boxpreview"===getValueOf("popupOnEditSelection"))return function doSeparateSelectionPopup(e){let t=document.getElementById("selectionPreview");if(!t){t=document.createElement("div"),t.id="selectionPreview";try{const e=document.editform.wpTextbox1;e.parentNode.insertBefore(t,e)}catch(e){return}}t.innerHTML=wiki2html(e),t.ranSetupTooltipsAlready=!1,popTipsSoonFn("selectionPreview")()}(e);if(o>0&&e.substring(o+2).indexOf("[[")>=0)return;const r=document.createElement("a");r.href=t.wiki.titlebase+s.urlString(),mouseOverWikiLink2(r),r.navpopup&&r.navpopup.addHook(()=>{!function runStopPopupTimer(e){e.stopPopupTimer||(e.stopPopupTimer=setInterval(posCheckerHook(e),500),e.addHook(()=>{clearInterval(e.stopPopupTimer)},"hide","before"))}(r.navpopup)},"unhide","after")}function delFmt(e){return e.length?`<del class='popupDiff'>${e.join("")}</del>`:""}function insFmt(e){return e.length?`<ins class='popupDiff'>${e.join("")}</ins>`:""}function countCrossings(e,t,i,n){if(!t[i].row&&0!==t[i].row)return-1;let o=0;for(let s=0;s<e.length;++s)if((e[s].row||0===e[s].row)&&(s-t[i].row)*(i-e[s].row)>0){if(n)return!0;o++}return o}function diffBugAlert(e){diffBugAlert.list[e]||(diffBugAlert.list[e]=1,alert(`Bad word: ${e}\n\nPlease report this bug.`))}function makeDiffHashtable(e){const t={};for(let i=0;i<e.length;i++){n.test(e[i])&&(e[i]+="\x3c!-- --\x3e"),t[e[i]]||(t[e[i]]=[]);try{t[e[i]].push(i)}catch(t){diffBugAlert(e[i])}}return t}function diff(e,t){const i=makeDiffHashtable(t),n=makeDiffHashtable(e);let o;for(o in i)1===i[o].length&&n[o]&&1===n[o].length&&(t[i[o][0]]={text:t[i[o][0]],row:n[o][0],paired:!0},e[n[o][0]]={text:e[n[o][0]],row:i[o][0],paired:!0});for(o=0;o<t.length-1;o++)t[o].paired&&!t[o+1].paired&&t[o].row+1<e.length&&!e[t[o].row+1].paired&&t[o+1]===e[t[o].row+1]&&(t[o+1]={text:t[o+1],row:t[o].row+1,paired:!0},e[t[o].row+1]={text:e[t[o].row+1],row:o+1,paired:!0});for(o=t.length-1;o>0;o--)t[o].paired&&!t[o-1].paired&&t[o].row>0&&!e[t[o].row-1].paired&&t[o-1]===e[t[o].row-1]&&(t[o-1]={text:t[o-1],row:t[o].row-1,paired:!0},e[t[o].row-1]={text:e[t[o].row-1],row:o-1,paired:!0});return{o:e,n:t}}function buildSpecialPageGroup(e){const t=[];return t.push(mw.util.escapeRegExp(e.realname)),t.push(mw.util.escapeRegExp(encodeURI(e.realname))),e.aliases.forEach(e=>{t.push(mw.util.escapeRegExp(e)),t.push(mw.util.escapeRegExp(encodeURI(e)))}),t.join("|")}function setupCache(){t.cache.pages=[]}function getMwApi(){return t.api.client||(t.api.userAgent=`Navigation popups/1.0 (${mw.config.get("wgServerName")})`,t.api.client=new mw.Api({ajax:{headers:{"Api-User-Agent":t.api.userAgent}}})),t.api.client}async function setupPopups(e){setupPopups.completed||(await async function fetchSpecialPageNames(){const e=await getMwApi().get({action:"query",meta:"siteinfo",siprop:"specialpagealiases",formatversion:2,uselang:"content",maxage:3600});t.wiki.specialpagealiases=e.query.specialpagealiases}(),function setupDebugging(){log("Initializing logger")}(),function setSiteInfo(){window.popupLocalDebug?t.wiki.hostname="en.wikipedia.org":t.wiki.hostname=location.hostname,t.wiki.wikimedia=RegExp("(wiki([pm]edia|source|books|news|quote|versity|species|voyage|data)|metawiki|wiktionary|mediawiki)[.]org").test(t.wiki.hostname),t.wiki.wikia=RegExp("[.]wikia[.]com$","i").test(t.wiki.hostname),t.wiki.isLocal=RegExp("^localhost").test(t.wiki.hostname),t.wiki.commons=t.wiki.wikimedia&&"commons.wikimedia.org"!==t.wiki.hostname?"commons.wikimedia.org":null,t.wiki.lang=mw.config.get("wgContentLanguage");const e=location.port?`:${location.port}`:"";t.wiki.sitebase=t.wiki.hostname+e}(),function setTitleBase(){const e=window.popupLocalDebug?"http:":location.protocol;t.wiki.articlePath=mw.config.get("wgArticlePath").replace(/\/\$1/,""),t.wiki.botInterfacePath=mw.config.get("wgScript"),t.wiki.APIPath=`${mw.config.get("wgScriptPath")}/api.php`;const i=`${t.wiki.botInterfacePath}?title=`;t.wiki.titlebase=`${e}//${t.wiki.sitebase}${i}`,t.wiki.wikibase=`${e}//${t.wiki.sitebase}${t.wiki.botInterfacePath}`,t.wiki.apiwikibase=`${e}//${t.wiki.sitebase}${t.wiki.APIPath}`,t.wiki.articlebase=`${e}//${t.wiki.sitebase}${t.wiki.articlePath}`,t.wiki.commonsbase=`${e}//${t.wiki.commons}${t.wiki.botInterfacePath}`,t.wiki.apicommonsbase=`${e}//${t.wiki.commons}${t.wiki.APIPath}`,t.re.basenames=RegExp(`^(${map(literalizeRegex,[t.wiki.titlebase,t.wiki.articlebase]).join("|")})`)}(),function setOptions(){let e=!1;if(mw.config.get("wgUserGroups"))for(let t=0;t<mw.config.get("wgUserGroups").length;++t)"sysop"===mw.config.get("wgUserGroups")[t]&&(e=!0);newOption("popupDelay",.5),newOption("popupHideDelay",.5),newOption("simplePopups",!1),newOption("popupStructure","shortmenus"),newOption("popupActionsMenu",!0),newOption("popupSetupMenu",!0),newOption("popupAdminLinks",e),newOption("popupShortcutKeys",!1),newOption("popupHistoricalLinks",!0),newOption("popupOnlyArticleLinks",!0),newOption("removeTitles",!0),newOption("popupMaxWidth",350),newOption("popupSimplifyMainLink",!0),newOption("popupAppendRedirNavLinks",!0),newOption("popupTocLinks",!1),newOption("popupSubpopups",!0),newOption("popupDragHandle",!1),newOption("popupLazyPreviews",!0),newOption("popupLazyDownloads",!0),newOption("popupAllDabsStubs",!1),newOption("popupDebugging",!1),newOption("popupActiveNavlinks",!0),newOption("popupModifier",!1),newOption("popupModifierAction","enable"),newOption("popupDraggable",!0),newOption("popupReview",!1),newOption("popupLocale",!1),newOption("popupDateTimeFormatterOptions",{year:"numeric",month:"2-digit",day:"2-digit",hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),newOption("popupDateFormatterOptions",{year:"numeric",month:"2-digit",day:"2-digit"}),newOption("popupTimeFormatterOptions",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),newOption("popupImages",!0),newOption("imagePopupsForImages",!0),newOption("popupNeverGetThumbs",!1),newOption("popupThumbAction","imagepage"),newOption("popupImageSize",60),newOption("popupImageSizeLarge",200),newOption("popupFixRedirs",!1),newOption("popupRedirAutoClick","wpDiff"),newOption("popupFixDabs",!1),newOption("popupDabsAutoClick","wpDiff"),newOption("popupRevertSummaryPrompt",!1),newOption("popupMinorReverts",!1),newOption("popupRedlinkRemoval",!1),newOption("popupRedlinkAutoClick","wpDiff"),
n+=`<a href="${t.wiki.titlebase}${new Title(p).urlString()}&diff=prev&oldid=${i.revid}">${popupString("last")}</a>`,n+=")",n}}for(let e=0;e<i.length;++e){n&&(a=i[e].title,p=new Title(a));const u=i[e].minor?"<b></b>":"",l=new Date(i[e].timestamp);let c=formattedDate(l);const g=formattedTime(l);c===r?c="":r=c,c&&s.push(`<tr><td colspan=3><span class="popup_history_date">${c}</span></td></tr>`),s.push(`<tr class="popup_history_row_${e%2?"odd":"even"}">`),s.push(`<td>${o(i[e])}</td>`),s.push(`<td><a href="${t.wiki.titlebase}${new Title(p).urlString()}&oldid=${i[e].revid}">${g}</a></td>`);let d="",h="";if(n)d=t.wiki.titlebase+p.urlString(),h=t.escapeQuotesHTML(a);else{const n=i[e].user;i[e].userhidden?(d=getValueOf("popupRevDelUrl"),h=t.escapeQuotesHTML(popupString("revdel"))):(d=t.re.ipUser.test(n)?`${t.wiki.titlebase+mw.config.get("wgFormattedNamespaces")[t.nsSpecialId]}:Contributions&target=${new Title(n).urlString()}`:`${t.wiki.titlebase+mw.config.get("wgFormattedNamespaces")[t.nsUserId]}:${new Title(n).urlString()}`,h=t.escapeQuotesHTML(n))}s.push(`<td>${n?u:""}<a href="${d}">${h}</a></td>`);let m="";const w=i[e].comment||(void 0!==i[e].slots?i[e].slots.main.content:null);w?m=new Previewmaker(w,new Title(p).toUrl()).editSummaryPreview():i[e].commenthidden&&(m=popupString("revdel")),s.push(`<td>${n?"":u}${m}</td>`),s.push("</tr>"),s=[s.join("")]}return s.push("</table>"),s.join("")}(e,s,o);return r}catch(e){return"History preview failed :-("}}function loadImage(e,i){if("function"!=typeof e.stripNamespace&&alert("loadImages bad"),!getValueOf("popupImages"))return;if(!isValidImageName(e))return!1;const n=e.urlString();let o=`${t.wiki.apiwikibase}?format=json&formatversion=2&action=query`;o+=`&prop=imageinfo&iiprop=url|mime&iiurlwidth=${getValueOf("popupImageSizeLarge")}`,o+=`&titles=${n}`,pendingNavpopTask(i);const callback=function(e){!function popupsInsertImage(e,i,n){let o;log("popupsInsertImage");try{const e=anyChild(getJsObj(n.data).query.pages);if(void 0===e.imageinfo)return;o=e.imageinfo[0]}catch(e){return void log("popupsInsertImage failed :(")}const s=document.getElementById(`popupImg${e}`);if(!s)return void log("could not find insertion point for image");s.width=getValueOf("popupImageSize"),s.style.display="inline",o.thumburl?s.src=o.thumburl:0===o.mime.indexOf("image")?(s.src=o.url,log("a thumb could not be found, using original image")):log("fullsize imagethumb, but not sure if it's an image");const r=document.getElementById(`popupImageLink${e}`);if(null===r)return null;switch(getValueOf("popupThumbAction")){case"imagepage":if(t.current.article.namespaceId()!==t.nsImageId){r.href=o.descriptionurl,popTipsSoonFn(`popupImage${e}`)();break}case"sizetoggle":return r.onclick=toggleSize,void(r.title=popupString("Toggle image size"));case"linkfull":r.href=o.url,r.title=popupString("Open full-size image")}}(i.idNumber,0,e)},go=function(){return getPageWithCaching(o,callback,i),!0};i.visible||!getValueOf("popupLazyDownloads")?go():i.addHook(go,"unhide","after","DOWNLOAD_IMAGE_QUERY_DATA")}function toggleSize(){if(!this)return void alert("imgContainer is null :/");const e=this.firstChild;e?e.style.width&&""!==e.style.width?e.style.width="":e.style.width="100%":alert("img is null :/")}function nsRe(e){const t=[];return jQuery.each(mw.config.get("wgNamespaceIds"),(i,n)=>{const o=upcaseFirst(i);n===e&&(t.push(mw.util.escapeRegExp(o).split(" ").join("[ _]")),t.push(mw.util.escapeRegExp(encodeURI(o))))}),`(?:${t.join("|")})`}function doSelectionPopup(){const e=function getEditboxSelection(){let e;try{e=document.editform.wpTextbox1}catch(e){return}if(document.selection)return document.selection.createRange().text;const t=e.selectionStart,i=e.selectionEnd;return e.value.substring(t,i)}(),i=e.indexOf("[["),n=e.indexOf("|"),o=e.indexOf("]]");if(-1===i||-1===n&&-1===o)return;if(-1!==n&&i>n||-1!==o&&i>o)return;const s=new Title(e.substring(i+2,n<0?o:n));if("boxpreview"===getValueOf("popupOnEditSelection"))return function doSeparateSelectionPopup(e){let t=document.getElementById("selectionPreview");if(!t){t=document.createElement("div"),t.id="selectionPreview";try{const e=document.editform.wpTextbox1;e.parentNode.insertBefore(t,e)}catch(e){return}}t.innerHTML=wiki2html(e),t.ranSetupTooltipsAlready=!1,popTipsSoonFn("selectionPreview")()}(e);if(o>0&&e.substring(o+2).indexOf("[[")>=0)return;const r=document.createElement("a");r.href=t.wiki.titlebase+s.urlString(),mouseOverWikiLink2(r),r.navpopup&&r.navpopup.addHook(()=>{!function runStopPopupTimer(e){e.stopPopupTimer||(e.stopPopupTimer=setInterval(posCheckerHook(e),500),e.addHook(()=>{clearInterval(e.stopPopupTimer)},"hide","before"))}(r.navpopup)},"unhide","after")}function delFmt(e){return e.length?`<del class='popupDiff'>${e.join("")}</del>`:""}function insFmt(e){return e.length?`<ins class='popupDiff'>${e.join("")}</ins>`:""}function countCrossings(e,t,i,n){if(!t[i].row&&0!==t[i].row)return-1;let o=0;for(let s=0;s<e.length;++s)if((e[s].row||0===e[s].row)&&(s-t[i].row)*(i-e[s].row)>0){if(n)return!0;o++}return o}function diffBugAlert(e){diffBugAlert.list[e]||(diffBugAlert.list[e]=1,alert(`Bad word: ${e}\n\nPlease report this bug.`))}function makeDiffHashtable(e){const t={};for(let i=0;i<e.length;i++){n.test(e[i])&&(e[i]+="\x3c!-- --\x3e"),t[e[i]]||(t[e[i]]=[]);try{t[e[i]].push(i)}catch(t){diffBugAlert(e[i])}}return t}function diff(e,t){const i=makeDiffHashtable(t),n=makeDiffHashtable(e);let o;for(o in i)1===i[o].length&&n[o]&&1===n[o].length&&(t[i[o][0]]={text:t[i[o][0]],row:n[o][0],paired:!0},e[n[o][0]]={text:e[n[o][0]],row:i[o][0],paired:!0});for(o=0;o<t.length-1;o++)t[o].paired&&!t[o+1].paired&&t[o].row+1<e.length&&!e[t[o].row+1].paired&&t[o+1]===e[t[o].row+1]&&(t[o+1]={text:t[o+1],row:t[o].row+1,paired:!0},e[t[o].row+1]={text:e[t[o].row+1],row:o+1,paired:!0});for(o=t.length-1;o>0;o--)t[o].paired&&!t[o-1].paired&&t[o].row>0&&!e[t[o].row-1].paired&&t[o-1]===e[t[o].row-1]&&(t[o-1]={text:t[o-1],row:t[o].row-1,paired:!0},e[t[o].row-1]={text:e[t[o].row-1],row:o-1,paired:!0});return{o:e,n:t}}function buildSpecialPageGroup(e){const t=[];return t.push(mw.util.escapeRegExp(e.realname)),t.push(mw.util.escapeRegExp(encodeURI(e.realname))),e.aliases.forEach(e=>{t.push(mw.util.escapeRegExp(e)),t.push(mw.util.escapeRegExp(encodeURI(e)))}),t.join("|")}function setupCache(){t.cache.pages=[]}function getMwApi(){return t.api.client||(t.api.userAgent=`Navigation popups/1.0 (${mw.config.get("wgServerName")})`,t.api.client=new mw.Api({ajax:{headers:{"Api-User-Agent":t.api.userAgent}}})),t.api.client}async function setupPopups(e){setupPopups.completed||(await async function fetchSpecialPageNames(){const e=await getMwApi().get({action:"query",meta:"siteinfo",siprop:"specialpagealiases",formatversion:2,uselang:"content",maxage:3600});t.wiki.specialpagealiases=e.query.specialpagealiases}(),function setupDebugging(){log("Initializing logger")}(),function setSiteInfo(){window.popupLocalDebug?t.wiki.hostname="en.wikipedia.org":t.wiki.hostname=location.hostname,t.wiki.wikimedia=RegExp("(wiki([pm]edia|source|books|news|quote|versity|species|voyage|data)|metawiki|wiktionary|mediawiki)[.]org").test(t.wiki.hostname),t.wiki.wikia=RegExp("[.]wikia[.]com$","i").test(t.wiki.hostname),t.wiki.isLocal=RegExp("^localhost").test(t.wiki.hostname),t.wiki.commons=t.wiki.wikimedia&&"commons.wikimedia.org"!==t.wiki.hostname?"commons.wikimedia.org":null,t.wiki.lang=mw.config.get("wgContentLanguage");const e=location.port?`:${location.port}`:"";t.wiki.sitebase=t.wiki.hostname+e}(),function setTitleBase(){const e=window.popupLocalDebug?"http:":location.protocol;t.wiki.articlePath=mw.config.get("wgArticlePath").replace(/\/\$1/,""),t.wiki.botInterfacePath=mw.config.get("wgScript"),t.wiki.APIPath=`${mw.config.get("wgScriptPath")}/api.php`;const i=`${t.wiki.botInterfacePath}?title=`;t.wiki.titlebase=`${e}//${t.wiki.sitebase}${i}`,t.wiki.wikibase=`${e}//${t.wiki.sitebase}${t.wiki.botInterfacePath}`,t.wiki.apiwikibase=`${e}//${t.wiki.sitebase}${t.wiki.APIPath}`,t.wiki.articlebase=`${e}//${t.wiki.sitebase}${t.wiki.articlePath}`,t.wiki.commonsbase=`${e}//${t.wiki.commons}${t.wiki.botInterfacePath}`,t.wiki.apicommonsbase=`${e}//${t.wiki.commons}${t.wiki.APIPath}`,t.re.basenames=RegExp(`^(${map(literalizeRegex,[t.wiki.titlebase,t.wiki.articlebase]).join("|")})`)}(),function setOptions(){let e=!1;if(mw.config.get("wgUserGroups"))for(let t=0;t<mw.config.get("wgUserGroups").length;++t)"sysop"===mw.config.get("wgUserGroups")[t]&&(e=!0);newOption("popupDelay",.5),newOption("popupHideDelay",.5),newOption("simplePopups",!1),newOption("popupStructure","shortmenus"),newOption("popupActionsMenu",!0),newOption("popupSetupMenu",!0),newOption("popupAdminLinks",e),newOption("popupShortcutKeys",!1),newOption("popupHistoricalLinks",!0),newOption("popupOnlyArticleLinks",!0),newOption("removeTitles",!0),newOption("popupMaxWidth",350),newOption("popupSimplifyMainLink",!0),newOption("popupAppendRedirNavLinks",!0),newOption("popupTocLinks",!1),newOption("popupSubpopups",!0),newOption("popupDragHandle",!1),newOption("popupLazyPreviews",!0),newOption("popupLazyDownloads",!0),newOption("popupAllDabsStubs",!1),newOption("popupDebugging",!1),newOption("popupActiveNavlinks",!0),newOption("popupModifier",!1),newOption("popupModifierAction","enable"),newOption("popupDraggable",!0),newOption("popupReview",!1),newOption("popupLocale",!1),newOption("popupDateTimeFormatterOptions",{year:"numeric",month:"2-digit",day:"2-digit",hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),newOption("popupDateFormatterOptions",{year:"numeric",month:"2-digit",day:"2-digit"}),newOption("popupTimeFormatterOptions",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),newOption("popupImages",!0),newOption("imagePopupsForImages",!0),newOption("popupNeverGetThumbs",!1),newOption("popupThumbAction","imagepage"),newOption("popupImageSize",60),newOption("popupImageSizeLarge",200),newOption("popupFixRedirs",!1),newOption("popupRedirAutoClick","wpDiff"),newOption("popupFixDabs",!1),newOption("popupDabsAutoClick","wpDiff"),newOption("popupRevertSummaryPrompt",!1),newOption("popupMinorReverts",!1),newOption("popupRedlinkRemoval",!1),newOption("popupRedlinkAutoClick","wpDiff"),
newOption("popupWatchDisambiggedPages",null),newOption("popupWatchRedirredPages",null),newOption("popupDabWiktionary","last"),newOption("popupNavLinks",!0),newOption("popupNavLinkSeparator"," &sdot; "),newOption("popupLastEditLink",!0),newOption("popupEditCounterTool","supercount"),newOption("popupEditCounterUrl",""),newOption("popupPreviews",!0),newOption("popupSummaryData",!0),newOption("popupMaxPreviewSentences",5),newOption("popupMaxPreviewCharacters",600),newOption("popupLastModified",!0),newOption("popupPreviewKillTemplates",!0),newOption("popupPreviewRawTemplates",!0),newOption("popupPreviewFirstParOnly",!0),newOption("popupPreviewCutHeadings",!0),newOption("popupPreviewButton",!1),newOption("popupPreviewButtonEvent","click"),newOption("popupPreviewDiffs",!0),newOption("popupDiffMaxLines",100),newOption("popupDiffContextLines",2),newOption("popupDiffContextCharacters",40),newOption("popupDiffDates",!0),newOption("popupDiffDatePrinter","toLocaleString"),newOption("popupReviewedSummary",popupString("defaultpopupReviewedSummary")),newOption("popupFixDabsSummary",popupString("defaultpopupFixDabsSummary")),newOption("popupExtendedRevertSummary",popupString("defaultpopupExtendedRevertSummary")),newOption("popupRevertSummary",popupString("defaultpopupRevertSummary")),newOption("popupRevertToPreviousSummary",popupString("defaultpopupRevertToPreviousSummary")),newOption("popupQueriedRevertSummary",popupString("defaultpopupQueriedRevertSummary")),newOption("popupQueriedRevertToPreviousSummary",popupString("defaultpopupQueriedRevertToPreviousSummary")),newOption("popupFixRedirsSummary",popupString("defaultpopupFixRedirsSummary")),newOption("popupRedlinkSummary",popupString("defaultpopupRedlinkSummary")),newOption("popupRmDabLinkSummary",popupString("defaultpopupRmDabLinkSummary")),newOption("popupHistoryLimit",50),newOption("popupFilters",[popupFilterStubDetect,popupFilterDisambigDetect,popupFilterPageSize,popupFilterCountLinks,popupFilterCountImages,popupFilterCountCategories,popupFilterLastModified]),newOption("extraPopupFilters",[]),newOption("popupOnEditSelection","cursor"),newOption("popupPreviewHistory",!0),newOption("popupImageLinks",!0),newOption("popupCategoryMembers",!0),newOption("popupUserInfo",!0),newOption("popupHistoryPreviewLimit",25),newOption("popupContribsPreviewLimit",25),newOption("popupRevDelUrl","//en.wikipedia.org/wiki/Wikipedia:Revision_deletion"),newOption("popupShowGender",!0),newOption("popupNewWindows",!1),newOption("popupLinksNewWindow",{lastContrib:!0,sinceMe:!0}),newOption("popupDabRegexp","\\{\\{\\s*(d(ab|isamb(ig(uation)?)?)|(((geo|hn|road?|school|number)dis)|[234][lc][acw]|(road|ship)index))\\s*(\\|[^}]*)?\\}\\}|is a .*disambiguation.*page"),newOption("popupAnchorRegexp","anchors?"),newOption("popupStubRegexp","(sect)?stub[}][}]|This .*-related article is a .*stub"),newOption("popupImageVarsRegexp","image|image_(?:file|skyline|name|flag|seal)|cover|badge|logo")}(),async function setUserInfo(){const e={action:"query",list:"users",ususers:mw.config.get("wgUserName"),usprop:"rights"};if(t.user.canReview=!1,getValueOf("popupReview")){const i=(await getMwApi().get(e)).query.users[0].rights;t.user.canReview=-1!==i.indexOf("review")}}(),function setNamespaces(){t.nsSpecialId=-1,t.nsMainspaceId=0,t.nsImageId=6,t.nsUserId=2,t.nsUsertalkId=3,t.nsCategoryId=14,t.nsTemplateId=10}(),function setInterwiki(){"zh"===t.wiki.lang?t.wiki.interwiki="en|ja":"en"===t.wiki.lang?t.wiki.interwiki="zh|ja":"ja"===t.wiki.lang&&(t.wiki.interwiki="zh|en"),t.re.interwiki=RegExp(`^${t.wiki.interwiki}:`)}(),function setRegexps(){!function setMainRegex(){let e=`${literalizeRegex(mw.config.get("wgScriptPath"))}/(?:index[.]php|wiki[.]phtml)[?]title=`;e+=`|${literalizeRegex(`${t.wiki.articlePath}/`)}`;const i=`(${e})([^&?#]*)[^#]*(?:#(.+))?`;t.re.main=RegExp("[^:]*://"+literalizeRegex(t.wiki.sitebase)+i)}();const e=nsRe(t.nsSpecialId);t.re.urlNoPopup=RegExp(`((title=|/)${e}(?:%3A|:)|section=[0-9]|^#$)`),t.wiki.specialpagealiases.forEach(i=>{"Contributions"===i.realname?t.re.contribs=RegExp(`(title=|/)${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})(&target=|/|/${nsRe(t.nsUserId)}:)(.*)`,"i"):"Diff"===i.realname?t.re.specialdiff=RegExp(`/${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})/([^?#]*)`,"i"):"Emailuser"===i.realname?t.re.email=RegExp(`(title=|/)${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})(&target=|/|/(?:${nsRe(t.nsUserId)}:)?)(.*)`,"i"):"Whatlinkshere"===i.realname&&(t.re.backlinks=RegExp(`(title=|/)${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})(&target=|/)([^&]*)`,"i"))});const i=function nsReImage(){return nsRe(t.nsImageId)}();t.re.image=RegExp(`(^|\\[\\[)${i}: *([^|\\]]*[^|\\] ])([^0-9\\]]*([0-9]+) *px)?|(?:\\n *[|]?|[|]) *(${getValueOf("popupImageVarsRegexp")}) *= *(?:\\[\\[ *)?(?:${i}:)?([^|]*?)(?:\\]\\])? *[|]? *\\n`,"img"),t.re.imageBracketCount=6,t.re.category=RegExp(`\\[\\[${nsRe(t.nsCategoryId)}: *([^|\\]]*[^|\\] ]) *`,"i"),t.re.categoryBracketCount=1,t.re.ipUser=RegExp("^(?::(?::|(?::[0-9A-Fa-f]{1,4}){1,7})|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6}::|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){7})|(((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))$"),t.re.stub=RegExp(getValueOf("popupStubRegexp"),"im"),t.re.disambig=RegExp(getValueOf("popupDabRegexp"),"im"),t.re.oldid=RegExp("[?&]oldid=([^&]*)"),t.re.diff=RegExp("[?&]diff=([^&]*)")}(),function setRedirs(){const e="redirect",i="REDIRECT",n={ar:[i,"تحويل"],be:[e,"перанакіраваньне"],bg:[e,"пренасочване","виж"],bs:[e,"Preusmjeri","preusmjeri","PREUSMJERI"],bn:[i,"পুনর্নির্দেশ"],cs:[i,"PŘESMĚRUJ"],cy:[e,"ail-cyfeirio"],de:[i,"WEITERLEITUNG"],el:[i,"ΑΝΑΚΑΤΕΥΘΥΝΣΗ"],eo:[i,"ALIDIREKTU","ALIDIREKTI"],es:[i,"REDIRECCIÓN"],et:[e,"suuna"],ga:[e,"athsheoladh"],gl:[e,"REDIRECCIÓN","REDIRECIONAMENTO"],he:[i,"הפניה"],hu:[i,"ÁTIRÁNYÍTÁS"],is:[e,"tilvísun","TILVÍSUN"],it:[i,"RINVIA","Rinvia"],ja:[i,"転送"],mk:[e,"пренасочување","види"],nds:[e,"wiederleiden"],"nds-nl":[i,"DEURVERWIEZING","DUURVERWIEZING"],nl:[i,"DOORVERWIJZING"],nn:[e,"omdiriger"],pl:[i,"PATRZ","PRZEKIERUJ","TAM"],pt:[i,"redir"],ru:[i,"ПЕРЕНАПРАВЛЕНИЕ","ПЕРЕНАПР"],sk:[e,"presmeruj"],sr:[e,"Преусмери","преусмери","ПРЕУСМЕРИ","Preusmeri","preusmeri","PREUSMERI"],tt:[i,"yünältü","перенаправление","перенапр"],uk:[i,"ПЕРЕНАПРАВЛЕННЯ","ПЕРЕНАПР"],vi:[e,"đổi"],yi:[i,"ווייטערפירן"],zh:[i,"重定向"]}[t.wiki.lang]||[e,i];t.re.redirect=RegExp(`^\\s*[#](${n.join("|")}).*?\\[{2}([^\\|\\]]*)(|[^\\]]*)?\\]{2}\\s*(.*)`,"i")}(),function setMisc(){t.current.link=null,t.current.links=[],t.current.linksHash={},setupCache(),t.timer.checkPopupPosition=null,t.counter.loop=0,t.idNumber=0,t.misc.decodeExtras=[{from:"%2C",to:","},{from:"_",to:" "},{from:"%24",to:"$"},{from:"%26",to:"&"}]}(),function setupLivePreview(){var e;i.conf={baseUrl:"",user:{},wiki:{lang:t.wiki.lang,interwiki:t.wiki.interwiki,default_thumb_width:180},paths:{articles:`${t.wiki.articlePath}/`,math:"/math/",images:"//upload.wikimedia.org/wikipedia/en/",images_fallback:"//upload.wikimedia.org/wikipedia/commons/"},locale:{user:mw.config.get("wgFormattedNamespaces")[t.nsUserId],image:mw.config.get("wgFormattedNamespaces")[t.nsImageId],category:mw.config.get("wgFormattedNamespaces")[t.nsCategoryId],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}},(e=i.conf.user).name||(e.name="Wikipedian"),i.conf.user.signature=`[[${i.conf.locale.user}:${i.conf.user.name}|${i.conf.user.name}]]`,i.BLOCK_IMAGE=new RegExp(`^\\[\\[(?:File|Image|${i.conf.locale.image}):.*?\\|.*?(?:frame|thumbnail|thumb|none|right|left|center)`,"i")}(),setupTooltips(),log("In setupPopups(), just called setupTooltips()"),Navpopup.tracker.enable(),setupPopups.completed=!0),"function"==typeof e&&e()}function expandConditionalNavlinkString(e,i,n,o){const s=n.oldid,r=n.rcid,p=n.diff;let a=o;"number"!=typeof a&&(a=0);const u=RegExp("(;?\\s*if\\s*\\(\\s*([\\w]*)\\s*\\)\\s*\\{([^{}]*)\\}(\\s*else\\s*\\{([^{}]*?)\\}|))","i"),l=e.parenSplit(u);let c=l[0];for(let e=1;e<l.length;e=e+5+1){const n=l[e+2-1],o=l[e+3-1];let a=l[e+5-1];void 0!==a&&a||(a="");let u=null;switch(n){case"user":u=!!i.userName();break;case"talk":u=!i.talkPage();break;case"admin":u=!!getValueOf("popupAdminLinks");break;case"oldid":u=!(void 0===s||!s);break;case"rcid":u=!(void 0===r||!r);break;case"ipuser":u=!!i.isIpUser();break;case"mainspace_en":u=isInMainNamespace(i)&&"en.wikipedia.org"===t.wiki.hostname;break;case"wikimedia":u=!!t.wiki.wikimedia;break;case"diff":u=!(void 0===p||!p)}switch(u){case null:c+=l[e];break;case!0:c+=o;break;case!1:c+=a}c+=l[e+5]}return u.test(c)&&a<10?expandConditionalNavlinkString(c,i,n,a+1):c}function navlinkStringToArray(e,t,i){const n=expandConditionalNavlinkString(e,t,i).parenSplit(RegExp("<<(.*?)>>")),o=[];for(let e=0;e<n.length;++e)if(e%2){const s=new NavlinkTag,r=n[e].split("|");s.id=r[0];for(let e=1;e<r.length;++e){const t=r[e].split("=");t.length>1?s[t[0]]=t[1]:s.text=popupString(t[0])}s.article=t;const p=i.oldid,a=i.rcid,u=i.diff;null!=p&&(s.oldid=p),null!=a&&(s.rcid=a),null!=u&&(s.diff=u),s.text||"mainlink"===s.id||(s.text=popupString(s.id)),o.push(s)}else o.push(n[e]);return o}function navlinkSubstituteHTML(e){return e.split("*").join(getValueOf("popupNavLinkSeparator")).split("<menurow>").join('<li class="popup_menu_row">').split("</menurow>").join("</li>").split("<menu>").join('<ul class="popup_menu">').split("</menu>").join("</ul>")}function navlinkDepth(e,t){return t.split(`<${e}>`).length-t.split(`</${e}>`).length}function navlinkStringToHTML(e,t,i){const n=navlinkStringToArray(e,t,i);let o="",s=0,r=0;for(let e=0;e<n.length;++e)"string"==typeof n[e]?(o+=navlinkSubstituteHTML(n[e]),s+=navlinkDepth("menu",n[e]),r+=navlinkDepth("menurow",n[e])):void 0!==n[e].type&&"navlinkTag"===n[e].type&&(o+=s>0&&0===r?`<li class="popup_menu_item">${n[e].html()}</li>`:n[e].html());return o}function popupHandleKeypress(e){const i=window.event?window.event.keyCode:e.keyCode?e.keyCode:e.which;if(!i||!t.current.link||!t.current.link.navpopup)return;if(27===i)return killPopup(),!1;const n=String.fromCharCode(i),o=t.current.link.navpopup.mainDiv.getElementsByTagName("A");let s,r,p=0
newOption("popupWatchDisambiggedPages",null),newOption("popupWatchRedirredPages",null),newOption("popupDabWiktionary","last"),newOption("popupNavLinks",!0),newOption("popupNavLinkSeparator"," &sdot; "),newOption("popupLastEditLink",!0),newOption("popupEditCounterTool","supercount"),newOption("popupEditCounterUrl",""),newOption("popupPreviews",!0),newOption("popupSummaryData",!0),newOption("popupMaxPreviewSentences",5),newOption("popupMaxPreviewCharacters",600),newOption("popupLastModified",!0),newOption("popupPreviewKillTemplates",!0),newOption("popupPreviewRawTemplates",!0),newOption("popupPreviewFirstParOnly",!0),newOption("popupPreviewCutHeadings",!0),newOption("popupPreviewButton",!1),newOption("popupPreviewButtonEvent","click"),newOption("popupPreviewDiffs",!0),newOption("popupDiffMaxLines",100),newOption("popupDiffContextLines",2),newOption("popupDiffContextCharacters",40),newOption("popupDiffDates",!0),newOption("popupDiffDatePrinter","toLocaleString"),newOption("popupReviewedSummary",popupString("defaultpopupReviewedSummary")),newOption("popupFixDabsSummary",popupString("defaultpopupFixDabsSummary")),newOption("popupExtendedRevertSummary",popupString("defaultpopupExtendedRevertSummary")),newOption("popupRevertSummary",popupString("defaultpopupRevertSummary")),newOption("popupRevertToPreviousSummary",popupString("defaultpopupRevertToPreviousSummary")),newOption("popupQueriedRevertSummary",popupString("defaultpopupQueriedRevertSummary")),newOption("popupQueriedRevertToPreviousSummary",popupString("defaultpopupQueriedRevertToPreviousSummary")),newOption("popupFixRedirsSummary",popupString("defaultpopupFixRedirsSummary")),newOption("popupRedlinkSummary",popupString("defaultpopupRedlinkSummary")),newOption("popupRmDabLinkSummary",popupString("defaultpopupRmDabLinkSummary")),newOption("popupHistoryLimit",50),newOption("popupFilters",[popupFilterStubDetect,popupFilterDisambigDetect,popupFilterPageSize,popupFilterCountLinks,popupFilterCountImages,popupFilterCountCategories,popupFilterLastModified]),newOption("extraPopupFilters",[]),newOption("popupOnEditSelection","cursor"),newOption("popupPreviewHistory",!0),newOption("popupImageLinks",!0),newOption("popupCategoryMembers",!0),newOption("popupUserInfo",!0),newOption("popupHistoryPreviewLimit",25),newOption("popupContribsPreviewLimit",25),newOption("popupRevDelUrl","//en.wikipedia.org/wiki/Wikipedia:Revision_deletion"),newOption("popupShowGender",!0),newOption("popupNewWindows",!1),newOption("popupLinksNewWindow",{lastContrib:!0,sinceMe:!0}),newOption("popupDabRegexp","\\{\\{\\s*(d(ab|isamb(ig(uation)?)?)|(((geo|hn|road?|school|number)dis)|[234][lc][acw]|(road|ship)index))\\s*(\\|[^}]*)?\\}\\}|is a .*disambiguation.*page"),newOption("popupAnchorRegexp","anchors?"),newOption("popupStubRegexp","(sect)?stub[}][}]|This .*-related article is a .*stub"),newOption("popupImageVarsRegexp","image|image_(?:file|skyline|name|flag|seal)|cover|badge|logo")}(),async function setUserInfo(){const e={action:"query",list:"users",ususers:mw.config.get("wgUserName"),usprop:"rights"};if(t.user.canReview=!1,getValueOf("popupReview")){const i=(await getMwApi().get(e)).query.users[0].rights;t.user.canReview=-1!==i.indexOf("review")}}(),function setNamespaces(){t.nsSpecialId=-1,t.nsMainspaceId=0,t.nsImageId=6,t.nsUserId=2,t.nsUsertalkId=3,t.nsCategoryId=14,t.nsTemplateId=10}(),function setInterwiki(){"zh"===t.wiki.lang?t.wiki.interwiki="en|ja":"en"===t.wiki.lang?t.wiki.interwiki="zh|ja":"ja"===t.wiki.lang&&(t.wiki.interwiki="zh|en"),t.re.interwiki=RegExp(`^${t.wiki.interwiki}:`)}(),function setRegexps(){!function setMainRegex(){let e=`${literalizeRegex(mw.config.get("wgScriptPath"))}/(?:index[.]php|wiki[.]phtml)[?]title=`;e+=`|${literalizeRegex(`${t.wiki.articlePath}/`)}`;const i=`(${e})([^&?#]*)[^#]*(?:#(.+))?`;t.re.main=RegExp("[^:]*://"+literalizeRegex(t.wiki.sitebase)+i)}();const e=nsRe(t.nsSpecialId);t.re.urlNoPopup=RegExp(`((title=|/)${e}(?:%3A|:)|section=[0-9]|^#$)`),t.wiki.specialpagealiases.forEach(i=>{"Contributions"===i.realname?t.re.contribs=RegExp(`(title=|/)${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})(&target=|/|/${nsRe(t.nsUserId)}:)(.*)`,"i"):"Diff"===i.realname?t.re.specialdiff=RegExp(`/${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})/([^?#]*)`,"i"):"Emailuser"===i.realname?t.re.email=RegExp(`(title=|/)${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})(&target=|/|/(?:${nsRe(t.nsUserId)}:)?)(.*)`,"i"):"Whatlinkshere"===i.realname&&(t.re.backlinks=RegExp(`(title=|/)${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})(&target=|/)([^&]*)`,"i"))});const i=function nsReImage(){return nsRe(t.nsImageId)}();t.re.image=RegExp(`(^|\\[\\[)${i}: *([^|\\]]*[^|\\] ])([^0-9\\]]*([0-9]+) *px)?|(?:\\n *[|]?|[|]) *(${getValueOf("popupImageVarsRegexp")}) *= *(?:\\[\\[ *)?(?:${i}:)?([^|]*?)(?:\\]\\])? *[|]? *\\n`,"img"),t.re.imageBracketCount=6,t.re.category=RegExp(`\\[\\[${nsRe(t.nsCategoryId)}: *([^|\\]]*[^|\\] ]) *`,"i"),t.re.categoryBracketCount=1,t.re.ipUser=RegExp("^(?::(?::|(?::[0-9A-Fa-f]{1,4}){1,7})|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6}::|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){7})|(((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))$"),t.re.stub=RegExp(getValueOf("popupStubRegexp"),"im"),t.re.disambig=RegExp(getValueOf("popupDabRegexp"),"im"),t.re.oldid=RegExp("[?&]oldid=([^&]*)"),t.re.diff=RegExp("[?&]diff=([^&]*)")}(),function setRedirs(){const e="redirect",i="REDIRECT",n={ar:[i,"تحويل"],be:[e,"перанакіраваньне"],bg:[e,"пренасочване","виж"],bs:[e,"Preusmjeri","preusmjeri","PREUSMJERI"],bn:[i,"পুনর্নির্দেশ"],cs:[i,"PŘESMĚRUJ"],cy:[e,"ail-cyfeirio"],de:[i,"WEITERLEITUNG"],el:[i,"ΑΝΑΚΑΤΕΥΘΥΝΣΗ"],eo:[i,"ALIDIREKTU","ALIDIREKTI"],es:[i,"REDIRECCIÓN"],et:[e,"suuna"],ga:[e,"athsheoladh"],gl:[e,"REDIRECCIÓN","REDIRECIONAMENTO"],he:[i,"הפניה"],hu:[i,"ÁTIRÁNYÍTÁS"],is:[e,"tilvísun","TILVÍSUN"],it:[i,"RINVIA","Rinvia"],ja:[i,"転送"],mk:[e,"пренасочување","види"],nds:[e,"wiederleiden"],"nds-nl":[i,"DEURVERWIEZING","DUURVERWIEZING"],nl:[i,"DOORVERWIJZING"],nn:[e,"omdiriger"],pl:[i,"PATRZ","PRZEKIERUJ","TAM"],pt:[i,"redir"],ru:[i,"ПЕРЕНАПРАВЛЕНИЕ","ПЕРЕНАПР"],sk:[e,"presmeruj"],sr:[e,"Преусмери","преусмери","ПРЕУСМЕРИ","Preusmeri","preusmeri","PREUSMERI"],tt:[i,"yünältü","перенаправление","перенапр"],uk:[i,"ПЕРЕНАПРАВЛЕННЯ","ПЕРЕНАПР"],vi:[e,"đổi"],yi:[i,"ווייטערפירן"],zh:[i,"重定向"]}[t.wiki.lang]||[e,i];t.re.redirect=RegExp(`^\\s*[#](${n.join("|")}).*?\\[{2}([^\\|\\]]*)(|[^\\]]*)?\\]{2}\\s*(.*)`,"i")}(),function setMisc(){t.current.link=null,t.current.links=[],t.current.linksHash={},setupCache(),t.timer.checkPopupPosition=null,t.counter.loop=0,t.idNumber=0,t.misc.decodeExtras=[{from:"%2C",to:","},{from:"_",to:" "},{from:"%24",to:"$"},{from:"%26",to:"&"}]}(),function setupLivePreview(){var e;i.conf={baseUrl:"",user:{},wiki:{lang:t.wiki.lang,interwiki:t.wiki.interwiki,default_thumb_width:180},paths:{articles:`${t.wiki.articlePath}/`,math:"/math/",images:"//upload.wikimedia.org/wikipedia/en/",images_fallback:"//upload.wikimedia.org/wikipedia/commons/"},locale:{user:mw.config.get("wgFormattedNamespaces")[t.nsUserId],image:mw.config.get("wgFormattedNamespaces")[t.nsImageId],category:mw.config.get("wgFormattedNamespaces")[t.nsCategoryId],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}},(e=i.conf.user).name||(e.name="Wikipedian"),i.conf.user.signature=`[[${i.conf.locale.user}:${i.conf.user.name}|${i.conf.user.name}]]`,i.BLOCK_IMAGE=new RegExp(`^\\[\\[(?:File|Image|${i.conf.locale.image}):.*?\\|.*?(?:frame|thumbnail|thumb|none|right|left|center)`,"i")}(),setupTooltips(),log("In setupPopups(), just called setupTooltips()"),Navpopup.tracker.enable(),setupPopups.completed=!0),"function"==typeof e&&e()}function expandConditionalNavlinkString(e,i,n,o){const s=n.oldid,r=n.rcid,p=n.diff;let a=o;"number"!=typeof a&&(a=0);const u=RegExp("(;?\\s*if\\s*\\(\\s*([\\w]*)\\s*\\)\\s*\\{([^{}]*)\\}(\\s*else\\s*\\{([^{}]*?)\\}|))","i"),l=e.parenSplit(u);let c=l[0];for(let e=1;e<l.length;e=e+5+1){const n=l[e+2-1],o=l[e+3-1];let a=l[e+5-1];void 0!==a&&a||(a="");let u=null;switch(n){case"user":u=!!i.userName();break;case"talk":u=!i.talkPage();break;case"admin":u=!!getValueOf("popupAdminLinks");break;case"oldid":u=!(void 0===s||!s);break;case"rcid":u=!(void 0===r||!r);break;case"ipuser":u=!!i.isIpUser();break;case"mainspace_en":u=isInMainNamespace(i)&&"en.wikipedia.org"===t.wiki.hostname;break;case"wikimedia":u=!!t.wiki.wikimedia;break;case"diff":u=!(void 0===p||!p)}switch(u){case null:c+=l[e];break;case!0:c+=o;break;case!1:c+=a}c+=l[e+5]}return u.test(c)&&a<10?expandConditionalNavlinkString(c,i,n,a+1):c}function navlinkStringToArray(e,t,i){const n=expandConditionalNavlinkString(e,t,i).parenSplit(RegExp("<<(.*?)>>")),o=[];for(let e=0;e<n.length;++e)if(e%2){const s=new NavlinkTag,r=n[e].split("|");s.id=r[0];for(let e=1;e<r.length;++e){const t=r[e].split("=");t.length>1?s[t[0]]=t[1]:s.text=popupString(t[0])}s.article=t;const p=i.oldid,a=i.rcid,u=i.diff;null!=p&&(s.oldid=p),null!=a&&(s.rcid=a),null!=u&&(s.diff=u),s.text||"mainlink"===s.id||(s.text=popupString(s.id)),o.push(s)}else o.push(n[e]);return o}function navlinkSubstituteHTML(e){return e.split("*").join(getValueOf("popupNavLinkSeparator")).split("<menurow>").join('<li class="popup_menu_row">').split("</menurow>").join("</li>").split("<menu>").join('<ul class="popup_menu">').split("</menu>").join("</ul>")}function navlinkDepth(e,t){return t.split(`<${e}>`).length-t.split(`</${e}>`).length}function navlinkStringToHTML(e,t,i){const n=navlinkStringToArray(e,t,i);let o="",s=0,r=0;for(let e=0;e<n.length;++e)"string"==typeof n[e]?(o+=navlinkSubstituteHTML(n[e]),s+=navlinkDepth("menu",n[e]),r+=navlinkDepth("menurow",n[e])):void 0!==n[e].type&&"navlinkTag"===n[e].type&&(o+=s>0&&0===r?`<li class="popup_menu_item">${n[e].html()}</li>`:n[e].html());return o}function popupHandleKeypress(e){const i=window.event?window.event.keyCode:e.keyCode?e.keyCode:e.which;if(!i||!t.current.link||!t.current.link.navpopup)return;if(27===i)return killPopup(),!1;const n=String.fromCharCode(i),o=t.current.link.navpopup.mainDiv.getElementsByTagName("A");let s,r,p=0
;if(popupHandleKeypress.lastPopupLinkSelected)for(s=0;s<o.length;++s)o[s]===popupHandleKeypress.lastPopupLinkSelected&&(p=s);for(r=0;r<o.length;++r)if(s=(p+r+1)%o.length,o[s].getAttribute("popupkey")===n)return e&&e.preventDefault&&e.preventDefault(),o[s].trigger("focus"),popupHandleKeypress.lastPopupLinkSelected=o[s],!1;return!document.oldPopupOnkeypress||document.oldPopupOnkeypress(e)}function addPopupShortcuts(){document.onkeypress!==popupHandleKeypress&&(document.oldPopupOnkeypress=document.onkeypress),document.onkeypress=popupHandleKeypress}function rmPopupShortcuts(){popupHandleKeypress.lastPopupLinkSelected=null;try{if(document.oldPopupOnkeypress&&document.oldPopupOnkeypress===popupHandleKeypress)return void(document.onkeypress=null);document.onkeypress=document.oldPopupOnkeypress}catch{}}function addPopupShortcut(e,t){let i=t;if(!getValueOf("popupShortcutKeys"))return e;const n=function addLinkProperty(e,t){const i=e.indexOf(">");return i<0?e:`${e.substring(0,i)} ${t}${e.substring(i)}`}(e,`popupkey="${i}"`);return" "===i&&(i=popupString("spacebar")),n.replace(RegExp('^(.*?)(title=")(.*?)(".*)$',"i"),`$1$2$3 [${i}]$4`)}function doneDiff(e){if(!e.owner||!e.owner.diffData)return;const i=e.owner;completedNavpopTask(i);let n,o=[];try{n=getJsObj(e.data).query.pages;for(let e=0;e<n.length;e++)o=o.concat(n[e].revisions);for(let e=0;e<o.length;e++)o[e].revid===i.diffData.oldRev.revid?i.diffData.oldRev.revision=o[e]:o[e].revid===i.diffData.newRev.revid&&(i.diffData.newRev.revision=o[e])}catch(e){errlog("Could not get diff")}!function insertDiff(e){let i=e.diffData.oldRev.revision.content.split("\n"),n=e.diffData.newRev.revision.content.split("\n"),o=stripOuterCommonLines(i,n,getValueOf("popupDiffContextLines"));i=o.a,n=o.b;let s=!1;getValueOf("popupDiffMaxLines"),(i.length>t.option.popupDiffMaxLines||n.length>t.option.popupDiffMaxLines)&&(s=!0,o=stripOuterCommonLines(i.slice(0,t.option.popupDiffMaxLines),n.slice(0,t.option.popupDiffMaxLines),t.option.popupDiffContextLines),i=o.a,n=o.b);const r=diff(i,n),p=function rmBoringLines(e,t,i){let n=i;void 0===n&&(n=2);const o=[],s=[],r=[],p=[];let a,u;for(a=0;a<e.length;++a)e[a].paired?countCrossings(t,e,a,!0)&&(o[a]=1,r[e[a].row]=1):o[a]=1;for(a=0;a<t.length;++a)1!==r[a]&&(t[a].paired||(r[a]=1));for(a=0;a<t.length;++a)if(1===r[a])for(u=Math.max(0,a-n);u<Math.min(t.length,a+n);++u)r[u]||(r[u]=1,o[t[u].row]=.5);for(a=0;a<e.length;++a)if(1===o[a])for(u=Math.max(0,a-n);u<Math.min(e.length,a+n);++u)o[u]||(o[u]=1,r[e[u].row]=.5);for(a=0;a<r.length;++a)r[a]>0&&(t[a].paired?p.push(t[a].text):p.push(t[a]));for(a=0;a<o.length;++a)o[a]>0&&(e[a].paired?s.push(e[a].text):s.push(e[a]));return{a:s,b:p}}(r.o,r.n),a=p.a,u=p.b,l=!String.prototype.parenSplit.isNative;let c="<hr />";getValueOf("popupDiffDates")&&(c+=function diffDatesTable(e){let t='<table class="popup_diff_dates">';return t+=diffDatesTableRow(e.diffData.newRev.revision,tprintf("New revision")),t+=diffDatesTableRow(e.diffData.oldRev.revision,tprintf("Old revision")),t+="</table>",t}(e),c+="<hr />"),c+=function shortenDiffString(e,t){const i=RegExp("(<del[\\s\\S]*?</del>|<ins[\\s\\S]*?</ins>)"),n=e.parenSplit(i);let o=[""];for(let e=0;e<n.length;e+=2)n[e].length<2*t?(o[o.length-1]+=n[e],e+1<n.length&&(o[o.length-1]+=n[e+1])):(e>0&&(o[o.length-1]+=n[e].substring(0,t)),e+1<n.length&&o.push(n[e].substring(n[e].length-t)+n[e+1]));for(;o.length>0&&!o[0];)o=o.slice(1);return o}(function diffString(e,t,i){const n=RegExp("([[]{2}|[\\]]{2}|[{]{2,3}|[}]{2,3}|[|]|=|<|>|[*:]+|\\s|\\b)");let o,s,r;for(i?(s=e.split(/\b/),r=t.split(/\b/)):(s=e.parenSplit(n),r=t.parenSplit(n)),o=0;o<s.length;++o)s[o]=s[o].entify();for(o=0;o<r.length;++o)r[o]=r[o].entify();const p=diff(s,r);let a="",u=[],l=0;for(o=0;o<p.n.length;++o)p.n[o].paired&&(l>p.n[o].row&&(p.o[p.n[o].row]=p.o[p.n[o].row].text,p.n[o]=p.n[o].text),l<p.n[o].row&&(l=p.n[o].row));for(o=0;o<p.o.length&&!p.o[o].paired;++o)u.push(p.o[o]);for(a+=delFmt(u),u=[],o=0;o<p.n.length;++o){for(;o<p.n.length&&!p.n[o].paired;)u.push(p.n[o++]);if(a+=insFmt(u),u=[],o<p.n.length){a+=p.n[o].text;let e=p.n[o].row+1;for(;e<p.o.length&&!p.o[e].paired;)u.push(p.o[e++]);a+=delFmt(u),u=[]}}return a}(a.join("\n"),u.join("\n"),l),getValueOf("popupDiffContextCharacters")).join("<hr />"),setPopupTipsAndHTML(c.split("\n").join("<br>")+(s?`<hr /><b>${popupString("Diff truncated for performance reasons")}</b>`:""),"popupPreview",e.idNumber)}(i)}function stripOuterCommonLines(e,t,i){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)++n;let o=e.length-1,s=t.length-1;for(;o>=0&&s>=0&&e[o]===t[s];)--o,--s;return{a:e.slice(Math.max(0,n-1-i),Math.min(e.length+1,o+i+1)),b:t.slice(Math.max(0,n-1-i),Math.min(t.length+1,s+i+1))}}function diffDatesTableRow(e,t){let i="";return i=function formattedDateTime(e){if(useTimeOffset())return`${formattedDate(e)} ${formattedTime(e)}`;if("ISO 8601"===getMWDateFormat()){const t=convertTimeZone(e,getTimeZone());return`${map(zeroFill,[t.getFullYear(),t.getMonth()+1,t.getDate()]).join("-")}T${map(zeroFill,[t.getHours(),t.getMinutes(),t.getSeconds()]).join(":")}`}const t=getValueOf("popupDateTimeFormatterOptions");return t.timeZone=getTimeZone(),e.toLocaleString(getLocales(),t)}(new Date(e.timestamp)),simplePrintf("<tr><td>%s</td><td>%s</td></tr>",[generalLink({url:`${mw.config.get("wgScript")}?oldid=${e.revid}`,text:t,title:t}),i])}function titledDiffLink(e){return titledWikiLink({article:e.article,action:`${e.to}&oldid=${e.from}`,newWin:e.newWin,noPopup:e.noPopup,text:e.text,title:e.title,actionName:"diff"})}function wikiLink(e){if("object"!=typeof e.article||"string"!=typeof e.action||"string"!=typeof e.text)return null;void 0===e.oldid&&(e.oldid=null);const i=e.oldid;/^(edit|view|revert|render)$|^raw/.test(e.action)||(e.oldid=null);let n=popupString(`${e.action}Hint`);const o=[e.oldid,safeDecodeURI(e.article)];let s=tprintf("revision %s of %s",o);switch(log(`revisionString=${s}`),e.action){case"edit&section=new":n=popupString("newSectionHint");break;case"edit&undo=":e.diff&&"prev"!==e.diff&&i?e.action+=`${e.diff}&undoafter=${i}`:i&&(e.action+=i),n=popupString("undoHint");break;case"raw&ctype=text/css":n=popupString("rawHint");break;case"revert":{const i=parseParams(t.current.link.href);e.action=`edit&autoclick=wpSave&actoken=${autoClickToken()}&autoimpl=${popupString("autoedit_version")}&autosummary=${function revertSummary(e,t){let i="";return i=getValueOf("prev"===t?"popupQueriedRevertToPreviousSummary":"popupQueriedRevertSummary"),`${i}&autorv=${e}`}(e.oldid,i.diff)}`,"prev"===i.diff&&(e.action+="&direction=prev",s=tprintf("the revision prior to revision %s of %s",o)),getValueOf("popupRevertSummaryPrompt")&&(e.action+="&autosummaryprompt=true"),getValueOf("popupMinorReverts")&&(e.action+="&autominor=true"),log(`revisionString is now ${s}`);break}case"nullEdit":e.action=`edit&autoclick=wpSave&actoken=${autoClickToken()}&autoimpl=${popupString("autoedit_version")}&autosummary=${popupString("nullEditSummary")}`;break;case"historyfeed":e.action="history&feed=rss";break;case"markpatrolled":e.action=`markpatrolled&rcid=${e.rcid}`}return n=n?e.oldid?simplePrintf(n,[s]):simplePrintf(n,[safeDecodeURI(e.article)]):safeDecodeURI(`${e.article}&action=${e.action}`)+e.oldid?`&oldid=${e.oldid}`:"",titledWikiLink({article:e.article,action:e.action,text:e.text,newWin:e.newWin,title:n,oldid:e.oldid,noPopup:e.noPopup,onclick:e.onclick})}function titledWikiLink(e){if(void 0===e.article||void 0===e.action)return errlog("got undefined article or action in titledWikiLink"),null;const i=t.wiki.titlebase+e.article.urlString();let n=i;void 0!==e.actionName&&e.actionName||(e.actionName="action"),"view"!==e.action&&(n=`${i}&${e.actionName}=${e.action}`),"edit"===e.action&&(n+="&wpChangeTags=Popups%2CAutomation%20tool"),void 0!==e.oldid&&e.oldid&&(n+=`&oldid=${e.oldid}`);let o=t.misc.defaultNavlinkClassname;return void 0!==e.className&&e.className&&(o=e.className),generalNavLink({url:n,newWin:e.newWin,title:void 0!==e.title?e.title:null,text:void 0!==e.text?e.text:null,className:o,noPopup:e.noPopup,onclick:e.onclick})}function displayUrl(e,t){t?window.open(e):document.location=e}function processAllPopups(e,i){for(let n=0;t.current.links&&n<t.current.links.length;++n)t.current.links[n].navpopup&&((e||i)&&t.current.links[n].navpopup.banish(),t.current.links[n].simpleNoMore=!1,e&&(t.current.links[n].navpopup=null))}function magicWatchLink(e){return e.onclick=simplePrintf("pg.fn.modifyWatchlist('%s','%s');return false;",[e.article.toString(!0).split("\\").join("\\\\").split("'").join("\\'"),this.id]),wikiLink(e)}function magicHistoryLink(e){let t="",i="",n="";switch(e.id){case"lastContrib":n=simplePrintf("pg.fn.getLastContrib('%s',%s)",[e.article.toString(!0).split("\\").join("\\\\").split("'").join("\\'"),e.newWin]),i=popupString("lastContribHint");break;case"sinceMe":n=simplePrintf("pg.fn.getDiffSinceMyEdit('%s',%s)",[e.article.toString(!0).split("\\").join("\\\\").split("'").join("\\'"),e.newWin]),i=popupString("sinceMeHint")}return t=`javascript:${n}`,n+=";return false;",generalNavLink({url:t,newWin:!1,title:i,text:e.text,noPopup:e.noPopup,onclick:n})}function popupMenuLink(e){const t=simplePrintf("javascript:pg.fn.%s()",[e.id]),i=popupString(simplePrintf("%sHint",[e.id])),n=simplePrintf("pg.fn.%s();return false;",[e.id]);return generalNavLink({url:t,newWin:!1,title:i,text:e.text,noPopup:e.noPopup,onclick:n})}function specialLink(e){if(void 0===e.specialpage||!e.specialpage)return null;const i=`${t.wiki.titlebase+mw.config.get("wgFormattedNamespaces")[t.nsSpecialId]}:${e.specialpage}`;void 0!==e.sep&&null!==e.sep||(e.sep="&target=");let n=e.article.urlString({keepSpaces:"Search"===e.specialpage}),o=popupString(`${e.specialpage}Hint`);switch(e.specialpage){case"Log":switch(e.sep){case"&user=":o=popupString("userLogHint");break;case"&type=block&page=":o=popupString("blockLogHint");break;case"&page=":o=popupString("pageLogHint");break;case"&type=protect&page=":o=popupString("protectLogHint");break;case"&type=delete&page=":o=popupString("deleteLogHint");break;default:log(`Unknown log type, sep=${e.sep}`),o="Missing hint (FIXME)"}break;case"PrefixIndex":n+="/"}
;if(popupHandleKeypress.lastPopupLinkSelected)for(s=0;s<o.length;++s)o[s]===popupHandleKeypress.lastPopupLinkSelected&&(p=s);for(r=0;r<o.length;++r)if(s=(p+r+1)%o.length,o[s].getAttribute("popupkey")===n)return e&&e.preventDefault&&e.preventDefault(),o[s].trigger("focus"),popupHandleKeypress.lastPopupLinkSelected=o[s],!1;return!document.oldPopupOnkeypress||document.oldPopupOnkeypress(e)}function addPopupShortcuts(){document.onkeypress!==popupHandleKeypress&&(document.oldPopupOnkeypress=document.onkeypress),document.onkeypress=popupHandleKeypress}function rmPopupShortcuts(){popupHandleKeypress.lastPopupLinkSelected=null;try{if(document.oldPopupOnkeypress&&document.oldPopupOnkeypress===popupHandleKeypress)return void(document.onkeypress=null);document.onkeypress=document.oldPopupOnkeypress}catch{}}function addPopupShortcut(e,t){let i=t;if(!getValueOf("popupShortcutKeys"))return e;const n=function addLinkProperty(e,t){const i=e.indexOf(">");return i<0?e:`${e.substring(0,i)} ${t}${e.substring(i)}`}(e,`popupkey="${i}"`);return" "===i&&(i=popupString("spacebar")),n.replace(RegExp('^(.*?)(title=")(.*?)(".*)$',"i"),`$1$2$3 [${i}]$4`)}function doneDiff(e){if(!e.owner||!e.owner.diffData)return;const i=e.owner;completedNavpopTask(i);let n,o=[];try{n=getJsObj(e.data).query.pages;for(let e=0;e<n.length;e++)o=o.concat(n[e].revisions);for(let e=0;e<o.length;e++)o[e].revid===i.diffData.oldRev.revid?i.diffData.oldRev.revision=o[e]:o[e].revid===i.diffData.newRev.revid&&(i.diffData.newRev.revision=o[e])}catch(e){errlog("Could not get diff")}!function insertDiff(e){let i=e.diffData.oldRev.revision.content.split("\n"),n=e.diffData.newRev.revision.content.split("\n"),o=stripOuterCommonLines(i,n,getValueOf("popupDiffContextLines"));i=o.a,n=o.b;let s=!1;getValueOf("popupDiffMaxLines"),(i.length>t.option.popupDiffMaxLines||n.length>t.option.popupDiffMaxLines)&&(s=!0,o=stripOuterCommonLines(i.slice(0,t.option.popupDiffMaxLines),n.slice(0,t.option.popupDiffMaxLines),t.option.popupDiffContextLines),i=o.a,n=o.b);const r=diff(i,n),p=function rmBoringLines(e,t,i){let n=i;void 0===n&&(n=2);const o=[],s=[],r=[],p=[];let a,u;for(a=0;a<e.length;++a)e[a].paired?countCrossings(t,e,a,!0)&&(o[a]=1,r[e[a].row]=1):o[a]=1;for(a=0;a<t.length;++a)1!==r[a]&&(t[a].paired||(r[a]=1));for(a=0;a<t.length;++a)if(1===r[a])for(u=Math.max(0,a-n);u<Math.min(t.length,a+n);++u)r[u]||(r[u]=1,o[t[u].row]=.5);for(a=0;a<e.length;++a)if(1===o[a])for(u=Math.max(0,a-n);u<Math.min(e.length,a+n);++u)o[u]||(o[u]=1,r[e[u].row]=.5);for(a=0;a<r.length;++a)r[a]>0&&(t[a].paired?p.push(t[a].text):p.push(t[a]));for(a=0;a<o.length;++a)o[a]>0&&(e[a].paired?s.push(e[a].text):s.push(e[a]));return{a:s,b:p}}(r.o,r.n),a=p.a,u=p.b,l=!String.prototype.parenSplit.isNative;let c="<hr />";getValueOf("popupDiffDates")&&(c+=function diffDatesTable(e){let t='<table class="popup_diff_dates">';return t+=diffDatesTableRow(e.diffData.newRev.revision,tprintf("New revision")),t+=diffDatesTableRow(e.diffData.oldRev.revision,tprintf("Old revision")),t+="</table>",t}(e),c+="<hr />"),c+=function shortenDiffString(e,t){const i=RegExp("(<del[\\s\\S]*?</del>|<ins[\\s\\S]*?</ins>)"),n=e.parenSplit(i);let o=[""];for(let e=0;e<n.length;e+=2)n[e].length<2*t?(o[o.length-1]+=n[e],e+1<n.length&&(o[o.length-1]+=n[e+1])):(e>0&&(o[o.length-1]+=n[e].substring(0,t)),e+1<n.length&&o.push(n[e].substring(n[e].length-t)+n[e+1]));for(;o.length>0&&!o[0];)o=o.slice(1);return o}(function diffString(e,t,i){const n=RegExp("([[]{2}|[\\]]{2}|[{]{2,3}|[}]{2,3}|[|]|=|<|>|[*:]+|\\s|\\b)");let o,s,r;for(i?(s=e.split(/\b/),r=t.split(/\b/)):(s=e.parenSplit(n),r=t.parenSplit(n)),o=0;o<s.length;++o)s[o]=s[o].entify();for(o=0;o<r.length;++o)r[o]=r[o].entify();const p=diff(s,r);let a="",u=[],l=0;for(o=0;o<p.n.length;++o)p.n[o].paired&&(l>p.n[o].row&&(p.o[p.n[o].row]=p.o[p.n[o].row].text,p.n[o]=p.n[o].text),l<p.n[o].row&&(l=p.n[o].row));for(o=0;o<p.o.length&&!p.o[o].paired;++o)u.push(p.o[o]);for(a+=delFmt(u),u=[],o=0;o<p.n.length;++o){for(;o<p.n.length&&!p.n[o].paired;)u.push(p.n[o++]);if(a+=insFmt(u),u=[],o<p.n.length){a+=p.n[o].text;let e=p.n[o].row+1;for(;e<p.o.length&&!p.o[e].paired;)u.push(p.o[e++]);a+=delFmt(u),u=[]}}return a}(a.join("\n"),u.join("\n"),l),getValueOf("popupDiffContextCharacters")).join("<hr />"),setPopupTipsAndHTML(c.split("\n").join("<br>")+(s?`<hr /><b>${popupString("Diff truncated for performance reasons")}</b>`:""),"popupPreview",e.idNumber)}(i)}function stripOuterCommonLines(e,t,i){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)++n;let o=e.length-1,s=t.length-1;for(;o>=0&&s>=0&&e[o]===t[s];)--o,--s;return{a:e.slice(Math.max(0,n-1-i),Math.min(e.length+1,o+i+1)),b:t.slice(Math.max(0,n-1-i),Math.min(t.length+1,s+i+1))}}function diffDatesTableRow(e,t){let i="";return i=function formattedDateTime(e){if(useTimeOffset())return`${formattedDate(e)} ${formattedTime(e)}`;if("ISO 8601"===getMWDateFormat()){const t=convertTimeZone(e,getTimeZone());return`${map(zeroFill,[t.getFullYear(),t.getMonth()+1,t.getDate()]).join("-")}T${map(zeroFill,[t.getHours(),t.getMinutes(),t.getSeconds()]).join(":")}`}const t=getValueOf("popupDateTimeFormatterOptions");return t.timeZone=getTimeZone(),e.toLocaleString(getLocales(),t)}(new Date(e.timestamp)),simplePrintf("<tr><td>%s</td><td>%s</td></tr>",[generalLink({url:`${mw.config.get("wgScript")}?oldid=${e.revid}`,text:t,title:t}),i])}function titledDiffLink(e){return titledWikiLink({article:e.article,action:`${e.to}&oldid=${e.from}`,newWin:e.newWin,noPopup:e.noPopup,text:e.text,title:e.title,actionName:"diff"})}function wikiLink(e){if("object"!=typeof e.article||"string"!=typeof e.action||"string"!=typeof e.text)return null;void 0===e.oldid&&(e.oldid=null);const i=e.oldid;/^(edit|view|revert|render)$|^raw/.test(e.action)||(e.oldid=null);let n=popupString(`${e.action}Hint`);const o=[e.oldid,safeDecodeURI(e.article)];let s=tprintf("revision %s of %s",o);switch(log(`revisionString=${s}`),e.action){case"edit&section=new":n=popupString("newSectionHint");break;case"edit&undo=":e.diff&&"prev"!==e.diff&&i?e.action+=`${e.diff}&undoafter=${i}`:i&&(e.action+=i),n=popupString("undoHint");break;case"raw&ctype=text/css":n=popupString("rawHint");break;case"revert":{const i=parseParams(t.current.link.href);e.action=`edit&autoclick=wpSave&actoken=${autoClickToken()}&autoimpl=${popupString("autoedit_version")}&autosummary=${function revertSummary(e,t){let i="";return i=getValueOf("prev"===t?"popupQueriedRevertToPreviousSummary":"popupQueriedRevertSummary"),`${i}&autorv=${e}`}(e.oldid,i.diff)}`,"prev"===i.diff&&(e.action+="&direction=prev",s=tprintf("the revision prior to revision %s of %s",o)),getValueOf("popupRevertSummaryPrompt")&&(e.action+="&autosummaryprompt=true"),getValueOf("popupMinorReverts")&&(e.action+="&autominor=true"),log(`revisionString is now ${s}`);break}case"nullEdit":e.action=`edit&autoclick=wpSave&actoken=${autoClickToken()}&autoimpl=${popupString("autoedit_version")}&autosummary=${popupString("nullEditSummary")}`;break;case"historyfeed":e.action="history&feed=rss";break;case"markpatrolled":e.action=`markpatrolled&rcid=${e.rcid}`}return n=n?e.oldid?simplePrintf(n,[s]):simplePrintf(n,[safeDecodeURI(e.article)]):safeDecodeURI(`${e.article}&action=${e.action}`)+e.oldid?`&oldid=${e.oldid}`:"",titledWikiLink({article:e.article,action:e.action,text:e.text,newWin:e.newWin,title:n,oldid:e.oldid,noPopup:e.noPopup,onclick:e.onclick})}function titledWikiLink(e){if(void 0===e.article||void 0===e.action)return errlog("got undefined article or action in titledWikiLink"),null;const i=t.wiki.titlebase+e.article.urlString();let n=i;void 0!==e.actionName&&e.actionName||(e.actionName="action"),"view"!==e.action&&(n=`${i}&${e.actionName}=${e.action}`),"edit"===e.action&&(n+="&wpChangeTags=Popups%2CAutomation%20tool"),void 0!==e.oldid&&e.oldid&&(n+=`&oldid=${e.oldid}`);let o=t.misc.defaultNavlinkClassname;return void 0!==e.className&&e.className&&(o=e.className),generalNavLink({url:n,newWin:e.newWin,title:void 0!==e.title?e.title:null,text:void 0!==e.text?e.text:null,className:o,noPopup:e.noPopup,onclick:e.onclick})}function displayUrl(e,t){t?window.open(e):document.location=e}function processAllPopups(e,i){for(let n=0;t.current.links&&n<t.current.links.length;++n)t.current.links[n].navpopup&&((e||i)&&t.current.links[n].navpopup.banish(),t.current.links[n].simpleNoMore=!1,e&&(t.current.links[n].navpopup=null))}function magicWatchLink(e){return e.onclick=simplePrintf("pg.fn.modifyWatchlist('%s','%s');return false;",[e.article.toString(!0).split("\\").join("\\\\").split("'").join("\\'"),this.id]),wikiLink(e)}function magicHistoryLink(e){let t="",i="",n="";switch(e.id){case"lastContrib":n=simplePrintf("pg.fn.getLastContrib('%s',%s)",[e.article.toString(!0).split("\\").join("\\\\").split("'").join("\\'"),e.newWin]),i=popupString("lastContribHint");break;case"sinceMe":n=simplePrintf("pg.fn.getDiffSinceMyEdit('%s',%s)",[e.article.toString(!0).split("\\").join("\\\\").split("'").join("\\'"),e.newWin]),i=popupString("sinceMeHint")}return t=`javascript:${n}`,n+=";return false;",generalNavLink({url:t,newWin:!1,title:i,text:e.text,noPopup:e.noPopup,onclick:n})}function popupMenuLink(e){const t=simplePrintf("javascript:pg.fn.%s()",[e.id]),i=popupString(simplePrintf("%sHint",[e.id])),n=simplePrintf("pg.fn.%s();return false;",[e.id]);return generalNavLink({url:t,newWin:!1,title:i,text:e.text,noPopup:e.noPopup,onclick:n})}function specialLink(e){if(void 0===e.specialpage||!e.specialpage)return null;const i=`${t.wiki.titlebase+mw.config.get("wgFormattedNamespaces")[t.nsSpecialId]}:${e.specialpage}`;void 0!==e.sep&&null!==e.sep||(e.sep="&target=");let n=e.article.urlString({keepSpaces:"Search"===e.specialpage}),o=popupString(`${e.specialpage}Hint`);switch(e.specialpage){case"Log":switch(e.sep){case"&user=":o=popupString("userLogHint");break;case"&type=block&page=":o=popupString("blockLogHint");break;case"&page=":o=popupString("pageLogHint");break;case"&type=protect&page=":o=popupString("protectLogHint");break;case"&type=delete&page=":o=popupString("deleteLogHint");break;default:log(`Unknown log type, sep=${e.sep}`),o="Missing hint (FIXME)"}break;case"PrefixIndex":n+="/"}
return o=o?simplePrintf(o,[safeDecodeURI(e.article)]):safeDecodeURI(`${e.specialpage}:${e.article}`),generalNavLink({url:i+e.sep+n,title:o,text:e.text,newWin:e.newWin,noPopup:e.noPopup})}function generalLink(e){if(void 0===e.url)return null;let i,n=`<a href="${e.url.split('"').join("%22")}"`;return void 0!==e.title&&e.title&&(n+=` title="${t.escapeQuotesHTML(e.title)}"`),void 0!==e.onclick&&e.onclick&&(n+=` onclick="${t.escapeQuotesHTML(e.onclick)}"`),e.noPopup&&(n+=" noPopup=1"),i=void 0===e.newWin||null===e.newWin?getValueOf("popupNewWindows"):e.newWin,i&&(n+=' target="_blank"'),void 0!==e.className&&e.className&&(n+=` class="${e.className}"`),n+=">","string"==typeof e.text&&(n+=t.escapeQuotesHTML(t.unescapeQuotesHTML(e.text))),n+="</a>",n}function changeLinkTargetLink(e){e.newTarget&&log(`changeLinkTargetLink: newTarget=${e.newTarget}`),e.oldTarget!==decodeURIComponent(e.oldTarget)&&log(`This might be an input problem: ${e.oldTarget}`);const t=mw.util.escapeRegExp(e.oldTarget);let i=t.charAt(0).toUpperCase();i=`[${i}${i.toLowerCase()}]`;let n=i+t.substring(1);n=n.split(RegExp("(?:[_ ]+|%20)","g")).join("(?:[_ ]+|%20)").split("\\(").join("(?:%28|\\()").split("\\)").join("(?:%29|\\))"),n=`\\s*(${n}(?:#[^\\[\\|]*)?)\\s*`;const o=e.title||mw.config.get("wgPageName").split("_").join(" "),s=titledWikiLink({article:new Title(o),newWin:e.newWin,action:"edit",text:e.text,title:e.hint,className:"popup_change_title_link"});let r="";if(e.newTarget){const t=e.newTarget,i=mw.util.escapeRegExp(e.newTarget);e.alsoChangeLabel?(r+=`s~\\[\\[${n}\\]\\]~[[${t}]]~g;`,r+=`s~\\[\\[${n}[|]~[[${t}|~g;`,r+=`s~\\[\\[${i}\\|${i}\\]\\]~[[${t}]]~g`):(r+=`s~\\[\\[${n}\\]\\]~[[${t}|$1]]~g;`,r+=`s~\\[\\[${n}[|]~[[${t}|~g;`,r+=`s~\\[\\[${i}\\|${i}\\]\\]~[[${t}]]~g`)}else r+=`s~\\[\\[${n}\\]\\]~$1~g;`,r+=`s~\\[\\[${n}[|](.*?)\\]\\]~$2~g`;return r=`autoedit=${encodeURIComponent(r)}`,r+=`&autoclick=${encodeURIComponent(e.clickButton)}&actoken=${encodeURIComponent(autoClickToken())}`,r+=null===e.minor?"":`&autominor=${encodeURIComponent(e.minor)}`,r+=null===e.watch?"":`&autowatch=${encodeURIComponent(e.watch)}`,r+=`&autosummary=${encodeURIComponent(e.summary)}`,r+=`&autoimpl=${encodeURIComponent(popupString("autoedit_version"))}`,function appendParamsToLink(e,t){const i=e.parenSplit(RegExp('(href="[^"]+?)"',"i"));if(i.length<2)return null;let n=i.shift()+i.shift();return n+=`&${t}"`,n+=i.join(""),n}(s,r)}function arinLink(e){if(!saneLinkCheck(e))return null;if(!e.article.isIpUser()||!t.wiki.wikimedia)return null;const i=e.article.userName();return generalNavLink({url:`http://ws.arin.net/cgi-bin/whois.pl?queryinput=${encodeURIComponent(i)}`,newWin:e.newWin,title:tprintf("Look up %s in ARIN whois database",[i]),text:e.text,noPopup:1})}function toolDbName(e){let t=mw.config.get("wgDBname");return e||(t+="_p"),t}function saneLinkCheck(e){return"object"==typeof e.article&&"string"==typeof e.text}function editCounterLink(e){if(!saneLinkCheck(e))return null;if(!t.wiki.wikimedia)return null;const i=e.article.userName(),n=getValueOf("popupEditCounterTool");let o;const s=`https://xtools.wmflabs.org/ec?user=$1&project=$2.$3&uselang=${mw.config.get("wgUserLanguage")}`;if("custom"===n)o=simplePrintf(getValueOf("popupEditCounterUrl"),[encodeURIComponent(i),toolDbName()]);else{const e=t.wiki.hostname.split(".");o=simplePrintf(s,[encodeURIComponent(i),e[0],e[1]])}return generalNavLink({url:o,title:tprintf("editCounterLinkHint",[i]),newWin:e.newWin,text:e.text,noPopup:1})}function globalSearchLink(e){return saneLinkCheck(e)?generalNavLink({url:`https://global-search.toolforge.org/?uselang=${mw.config.get("wgUserLanguage")}&q=`+e.article.urlString({keepSpaces:!0}),newWin:e.newWin,title:tprintf("globalSearchHint",[safeDecodeURI(e.article)]),text:e.text,noPopup:1}):null}function googleLink(e){return saneLinkCheck(e)?generalNavLink({url:`https://www.google.com/search?q=%22${e.article.urlString({keepSpaces:!0})}%22`,newWin:e.newWin,title:tprintf("googleSearchHint",[safeDecodeURI(e.article)]),text:e.text,noPopup:1}):null}function editorListLink(e){if(!saneLinkCheck(e))return null;const i=e.article.articleFromTalkPage()||e.article;return generalNavLink({url:`https://xtools.wmflabs.org/articleinfo/${encodeURI(t.wiki.hostname)}/${i.urlString()}?uselang=${mw.config.get("wgUserLanguage")}`,title:tprintf("editorListHint",[i]),newWin:e.newWin,text:e.text,noPopup:1})}function generalNavLink(e){return e.className=null===e.className?"popupNavLink":e.className,generalLink(e)}function getHistoryInfo(e,i){log("getHistoryInfo"),function getHistory(e,i){log("getHistory");const n=`${t.wiki.apiwikibase}?format=json&formatversion=2&action=query&prop=revisions&titles=${new Title(e).urlString()}&rvlimit=${getValueOf("popupHistoryLimit")}`;log(`getHistory: url=${n}`),startDownload(n,`${t.idNumber}history`,i)}(e,i?e=>{i(processHistory(e))}:processHistory)}function processHistory(e){const t=getJsObj(e.data);try{const e=anyChild(t.query.pages).revisions,i=[];for(let t=0;t<e.length;++t)i.push({oldid:e[t].revid,editor:e[t].user});return log(`processed ${i.length} edits`),finishProcessHistory(i,mw.config.get("wgUserName"))}catch(e){return log("Something went wrong with JSON business"),finishProcessHistory([])}}function finishProcessHistory(e,t){const i={};i.edits=e,i.userName=t;for(let n=0;n<e.length;++n)void 0===i.myLastEdit&&t&&e[n].editor===t&&(i.myLastEdit={index:n,oldid:e[n].oldid,previd:0===n?null:e[n-1].oldid}),void 0===i.firstNewEditor&&e[n].editor!==e[0].editor&&(i.firstNewEditor={index:n,oldid:e[n].oldid,previd:0===n?null:e[n-1].oldid});return i}function newOption(e,i){t.optionDefault[e]=i}function getValueOf(e){return function defaultize(e){null!==t.option[e]&&void 0!==t.option[e]||(void 0!==window[e]?t.option[e]=window[e]:t.option[e]=t.optionDefault[e])}(e),t.option[e]}function popupString(t){return e&&e[t]?e[t]:(o.has(t)||"string"==typeof t&&(t.includes("&autoimpl=np20140416&actoken=")||t.endsWith("Hint"))||(o.add(t),console.info("popupNoTranslation",o)),t)}function tprintf(e,t){let i=t;return"object"!=typeof i&&(i=[i]),simplePrintf(popupString(e),i)}function run(){autoEdit(),setupPopups()}const e={article:wgULS("条目","條目"),category:wgULS("个分类","個分類"),categories:wgULS("个分类","個分類"),image:wgULS("个文件","個檔案"),images:wgULS("个文件","個檔案"),stub:wgULS("小作品","小作品"),"section stub":wgULS("小章节","小章節"),"Empty page":wgULS("空页面","空頁面"),kB:wgULS("千字节<sub>(以1000为一进)</sub>","千位元組<sub>(以1000為一進)</sub>"),bytes:wgULS("字节","位元組"),day:wgULS("天","天"),days:wgULS("天","天"),hour:wgULS("小时","小時"),hours:wgULS("小时","小時"),minute:wgULS("分","分"),minutes:wgULS("分","分"),second:wgULS("秒","秒"),seconds:wgULS("秒","秒"),week:wgULS("周","周"),weeks:wgULS("周","周"),month:wgULS("月","月"),months:wgULS("月","月"),year:wgULS("年","年"),years:wgULS("年","年"),search:wgULS("搜索","搜尋"),SearchHint:wgULS("搜索包含 %s 的页面","搜尋包含 %s 的頁面"),web:"Google",global:wgULS("全域","全域"),"more...":wgULS("更多……","更多……"),actions:wgULS("操作","動作"),popupsMenu:wgULS("Popups","Popups"),"disable previews":wgULS("禁用预览","禁用預覽"),togglePreviewsHint:wgULS("切换本页 Popups 的预览开关","切換本頁 Popups 的預覽開關"),"toggle previews":wgULS("切换预览开关","切換預覽開關"),reset:wgULS("复位","複位"),disable:wgULS("禁用 Popups","禁用 Popups"),disablePopupsHint:wgULS("在本页禁用 Popups,刷新页面以重新启用。","在本頁禁用 Popups,重新整理頁面以重新啟用。"),purgePopupsHint:wgULS("复位 Popups,清除所有缓存数据。","複位 Popups,清除所有快取資料。"),PopupsHint:wgULS("复位 Popups,清除所有缓存数据。","複位 Popups,清除所有快取資料。"),spacebar:wgULS("空格","空格"),view:wgULS("查看","檢視"),"view article":wgULS("查看条目","檢視條目"),viewHint:wgULS("前往 %s","前往 %s"),talk:wgULS("讨论","討論"),"talk page":wgULS("讨论页","討論頁"),"this&nbsp;revision":wgULS("此修订版本","此修訂版本"),"revision %s of %s":wgULS("页面 $2 的修订版本 $1","頁面 $2 的修訂版本 $1"),"Revision %s of %s":wgULS("页面 $2 的修订版本 $1","頁面 $2 的修訂版本 $1"),"the revision prior to revision %s of %s":wgULS("页面 $2 的修订版本 $1 之前的修订版本","頁面 $2 的修訂版本 $1 之前的修訂版本"),"Toggle image size":wgULS("点击切换图片大小","點擊切換圖片大小"),del:wgULS("删除","删除"),delete:wgULS("删除","删除"),deleteHint:wgULS("删除 %s","删除 %s"),undeleteShort:wgULS("恢复","恢復"),UndeleteHint:wgULS("恢复 %s","恢復 %s"),protect:wgULS("保护","保護"),protectHint:wgULS("保护 %s","保護 %s"),unprotectShort:wgULS("解除","解除"),unprotectHint:wgULS("解除对 %s 的保护","解除對 %s 的保護"),move:wgULS("移动","移動"),"move page":wgULS("移动页面","移動頁面"),MovepageHint:wgULS("修改 %s 的标题","修改 %s 的標題"),edit:wgULS("编辑","編輯"),"edit article":wgULS("编辑条目","編輯條目"),editHint:wgULS("修改 %s 的内容","修改 %s 的內容"),"edit talk":wgULS("编辑讨论页","編輯對話頁",null,null,"編輯討論頁"),new:wgULS("新","新"),"new topic":wgULS("新话题","新話題"),newSectionHint:wgULS("在 %s 增加新的讨论话题","在 %s 增加新的討論話題"),"null edit":wgULS("空编辑","空編輯"),nullEditHint:wgULS("进行一次对 %s 的空编辑","製造一次對 %s 的空編輯"),hist:wgULS("历史","歷史"),history:wgULS("历史","歷史"),historyHint:wgULS("%s 的修订历史","%s 的修訂歷史"),last:wgULS("之前","之前"),lastEdit:wgULS("最近更改","最近更改"),"show last edit":wgULS("最近一次更改","最新一次修訂"),"Show the last edit":wgULS("显示最近一次更改的差异","顯示最新一次修訂的差異"),lastContrib:wgULS("最近编辑","最近編輯"),"last set of edits":wgULS("最近编辑","最近編輯"),lastContribHint:wgULS("显示由最后一位编辑者造成的差异","顯示由最後一位編輯者製造的差異"),cur:wgULS("当前","當前"),diffCur:wgULS("与当前版本的差异","與目前版本的差異"),"Show changes since revision %s":wgULS("显示自修订版本 %s 的差异","顯示自修訂版本 %s 的差異"),"%s old":wgULS("%s 前的最后版本","%s 前的最后版本"),oldEdit:wgULS("旧编辑","舊編輯"),purge:wgULS("清除缓存","清除快取"),purgeHint:wgULS("清除服务器中 %s 的缓存","清除伺服器中 %s 的快取"),raw:wgULS("源代码","原始碼"),rawHint:wgULS("查看 %s 的源代码","檢視 %s 的原始碼"),render:wgULS("仅正文","僅正文"),renderHint:wgULS("显示 %s 的纯HTML解析(仅正文内容)","顯示 %s 的純HTML解析(僅正文內容)"),"Show the edit made to get revision":wgULS("显示编辑以得到修订版本","顯示編輯以得到修訂版本"),sinceMe:wgULS("自我","自我"),"changes since mine":wgULS("自我修订的差异","自我修訂的差異"),sinceMeHint:wgULS("显示自我上次修改以来的差异","顯示自我上次修改以來的差異"),"Couldn't find an edit by %s\nin the last %s edits to\n%s":wgULS("在 $3 最近 $2 次编辑中找不到 $1 做出的修改","在 $3 最近 $2 次編輯中找不到 $1 做出的修改"),eds:wgULS("编辑","編輯"),editors:wgULS("编辑者","編輯者"),editorListHint:wgULS("列出编辑过 %s 的用户","列出編輯過 %s 的使用者",null,null,"列出編輯過 %s 的用戶"),related:wgULS("相关","相關"),relatedChanges:wgULS("相关更改","相關更改"),"related changes":wgULS("相关更改","相關更改"),RecentchangeslinkedHint:wgULS("显示相关 %s 的修改","顯示相關 %s 的修改"),editOld:wgULS("编辑旧版","編輯舊版"),rv:wgULS("回退","恢復"),revert:wgULS("回退","恢復"),revertHint:wgULS("回退到 %s","恢復到 %s"),undo:wgULS("撤销","撤銷"),undoHint:wgULS("撤销这次编辑","撤銷這次編輯"),
return o=o?simplePrintf(o,[safeDecodeURI(e.article)]):safeDecodeURI(`${e.specialpage}:${e.article}`),generalNavLink({url:i+e.sep+n,title:o,text:e.text,newWin:e.newWin,noPopup:e.noPopup})}function generalLink(e){if(void 0===e.url)return null;let i,n=`<a href="${e.url.split('"').join("%22")}"`;return void 0!==e.title&&e.title&&(n+=` title="${t.escapeQuotesHTML(e.title)}"`),void 0!==e.onclick&&e.onclick&&(n+=` onclick="${t.escapeQuotesHTML(e.onclick)}"`),e.noPopup&&(n+=" noPopup=1"),i=void 0===e.newWin||null===e.newWin?getValueOf("popupNewWindows"):e.newWin,i&&(n+=' target="_blank"'),void 0!==e.className&&e.className&&(n+=` class="${e.className}"`),n+=">","string"==typeof e.text&&(n+=t.escapeQuotesHTML(t.unescapeQuotesHTML(e.text))),n+="</a>",n}function changeLinkTargetLink(e){e.newTarget&&log(`changeLinkTargetLink: newTarget=${e.newTarget}`),e.oldTarget!==decodeURIComponent(e.oldTarget)&&log(`This might be an input problem: ${e.oldTarget}`);const t=mw.util.escapeRegExp(e.oldTarget);let i=t.charAt(0).toUpperCase();i=`[${i}${i.toLowerCase()}]`;let n=i+t.substring(1);n=n.split(RegExp("(?:[_ ]+|%20)","g")).join("(?:[_ ]+|%20)").split("\\(").join("(?:%28|\\()").split("\\)").join("(?:%29|\\))"),n=`\\s*(${n}(?:#[^\\[\\|]*)?)\\s*`;const o=e.title||mw.config.get("wgPageName").split("_").join(" "),s=titledWikiLink({article:new Title(o),newWin:e.newWin,action:"edit",text:e.text,title:e.hint,className:"popup_change_title_link"});let r="";if(e.newTarget){const t=e.newTarget,i=mw.util.escapeRegExp(e.newTarget);e.alsoChangeLabel?(r+=`s~\\[\\[${n}\\]\\]~[[${t}]]~g;`,r+=`s~\\[\\[${n}[|]~[[${t}|~g;`,r+=`s~\\[\\[${i}\\|${i}\\]\\]~[[${t}]]~g`):(r+=`s~\\[\\[${n}\\]\\]~[[${t}|$1]]~g;`,r+=`s~\\[\\[${n}[|]~[[${t}|~g;`,r+=`s~\\[\\[${i}\\|${i}\\]\\]~[[${t}]]~g`)}else r+=`s~\\[\\[${n}\\]\\]~$1~g;`,r+=`s~\\[\\[${n}[|](.*?)\\]\\]~$2~g`;return r=`autoedit=${encodeURIComponent(r)}`,r+=`&autoclick=${encodeURIComponent(e.clickButton)}&actoken=${encodeURIComponent(autoClickToken())}`,r+=null===e.minor?"":`&autominor=${encodeURIComponent(e.minor)}`,r+=null===e.watch?"":`&autowatch=${encodeURIComponent(e.watch)}`,r+=`&autosummary=${encodeURIComponent(e.summary)}`,r+=`&autoimpl=${encodeURIComponent(popupString("autoedit_version"))}`,function appendParamsToLink(e,t){const i=e.parenSplit(RegExp('(href="[^"]+?)"',"i"));if(i.length<2)return null;let n=i.shift()+i.shift();return n+=`&${t}"`,n+=i.join(""),n}(s,r)}function arinLink(e){if(!saneLinkCheck(e))return null;if(!e.article.isIpUser()||!t.wiki.wikimedia)return null;const i=e.article.userName();return generalNavLink({url:`http://ws.arin.net/cgi-bin/whois.pl?queryinput=${encodeURIComponent(i)}`,newWin:e.newWin,title:tprintf("Look up %s in ARIN whois database",[i]),text:e.text,noPopup:1})}function toolDbName(e){let t=mw.config.get("wgDBname");return e||(t+="_p"),t}function saneLinkCheck(e){return"object"==typeof e.article&&"string"==typeof e.text}function editCounterLink(e){if(!saneLinkCheck(e))return null;if(!t.wiki.wikimedia)return null;const i=e.article.userName(),n=getValueOf("popupEditCounterTool");let o;const s=`https://xtools.wmflabs.org/ec?user=$1&project=$2.$3&uselang=${mw.config.get("wgUserLanguage")}`;if("custom"===n)o=simplePrintf(getValueOf("popupEditCounterUrl"),[encodeURIComponent(i),toolDbName()]);else{const e=t.wiki.hostname.split(".");o=simplePrintf(s,[encodeURIComponent(i),e[0],e[1]])}return generalNavLink({url:o,title:tprintf("editCounterLinkHint",[i]),newWin:e.newWin,text:e.text,noPopup:1})}function globalSearchLink(e){return saneLinkCheck(e)?generalNavLink({url:`https://global-search.toolforge.org/?uselang=${mw.config.get("wgUserLanguage")}&q=`+e.article.urlString({keepSpaces:!0}),newWin:e.newWin,title:tprintf("globalSearchHint",[safeDecodeURI(e.article)]),text:e.text,noPopup:1}):null}function googleLink(e){return saneLinkCheck(e)?generalNavLink({url:`https://www.google.com/search?q=%22${e.article.urlString({keepSpaces:!0})}%22`,newWin:e.newWin,title:tprintf("googleSearchHint",[safeDecodeURI(e.article)]),text:e.text,noPopup:1}):null}function editorListLink(e){if(!saneLinkCheck(e))return null;const i=e.article.articleFromTalkPage()||e.article;return generalNavLink({url:`https://xtools.wmflabs.org/articleinfo/${encodeURI(t.wiki.hostname)}/${i.urlString()}?uselang=${mw.config.get("wgUserLanguage")}`,title:tprintf("editorListHint",[i]),newWin:e.newWin,text:e.text,noPopup:1})}function generalNavLink(e){return e.className=null===e.className?"popupNavLink":e.className,generalLink(e)}function getHistoryInfo(e,i){log("getHistoryInfo"),function getHistory(e,i){log("getHistory");const n=`${t.wiki.apiwikibase}?format=json&formatversion=2&action=query&prop=revisions&titles=${new Title(e).urlString()}&rvlimit=${getValueOf("popupHistoryLimit")}`;log(`getHistory: url=${n}`),startDownload(n,`${t.idNumber}history`,i)}(e,i?e=>{i(processHistory(e))}:processHistory)}function processHistory(e){const t=getJsObj(e.data);try{const e=anyChild(t.query.pages).revisions,i=[];for(let t=0;t<e.length;++t)i.push({oldid:e[t].revid,editor:e[t].user});return log(`processed ${i.length} edits`),finishProcessHistory(i,mw.config.get("wgUserName"))}catch(e){return log("Something went wrong with JSON business"),finishProcessHistory([])}}function finishProcessHistory(e,t){const i={};i.edits=e,i.userName=t;for(let n=0;n<e.length;++n)void 0===i.myLastEdit&&t&&e[n].editor===t&&(i.myLastEdit={index:n,oldid:e[n].oldid,previd:0===n?null:e[n-1].oldid}),void 0===i.firstNewEditor&&e[n].editor!==e[0].editor&&(i.firstNewEditor={index:n,oldid:e[n].oldid,previd:0===n?null:e[n-1].oldid});return i}function newOption(e,i){t.optionDefault[e]=i}function getValueOf(e){return function defaultize(e){null!==t.option[e]&&void 0!==t.option[e]||(void 0!==window[e]?t.option[e]=window[e]:t.option[e]=t.optionDefault[e])}(e),t.option[e]}function popupString(t){return e&&e[t]?e[t]:(o.has(t)||"string"==typeof t&&(t.includes("&autoimpl=np20140416&actoken=")||t.endsWith("Hint"))||(o.add(t),console.info("popupNoTranslation",o)),t)}function tprintf(e,t){let i=t;return"object"!=typeof i&&(i=[i]),simplePrintf(popupString(e),i)}function run(){autoEdit(),setupPopups()}const e={article:wgULS("条目","條目"),category:wgULS("个分类","個分類"),categories:wgULS("个分类","個分類"),image:wgULS("个文件","個檔案"),images:wgULS("个文件","個檔案"),stub:wgULS("小作品","小作品"),"section stub":wgULS("小章节","小章節"),"Empty page":wgULS("空页面","空頁面"),kB:wgULS("千字节<sub>(以1000为一进)</sub>","千位元組<sub>(以1000為一進)</sub>"),bytes:wgULS("字节","位元組"),day:wgULS("天","天"),days:wgULS("天","天"),hour:wgULS("小时","小時"),hours:wgULS("小时","小時"),minute:wgULS("分","分"),minutes:wgULS("分","分"),second:wgULS("秒","秒"),seconds:wgULS("秒","秒"),week:wgULS("周","周"),weeks:wgULS("周","周"),month:wgULS("月","月"),months:wgULS("月","月"),year:wgULS("年","年"),years:wgULS("年","年"),search:wgULS("搜索","搜尋"),SearchHint:wgULS("搜索包含 %s 的页面","搜尋包含 %s 的頁面"),web:"Google",global:wgULS("全域","全域"),"more...":wgULS("更多……","更多……"),actions:wgULS("操作","動作"),popupsMenu:wgULS("Popups","Popups"),"disable previews":wgULS("禁用预览","禁用預覽"),togglePreviewsHint:wgULS("切换本页 Popups 的预览开关","切換本頁 Popups 的預覽開關"),"toggle previews":wgULS("切换预览开关","切換預覽開關"),reset:wgULS("复位","複位"),disable:wgULS("禁用 Popups","禁用 Popups"),disablePopupsHint:wgULS("在本页禁用 Popups,刷新页面以重新启用。","在本頁禁用 Popups,重新整理頁面以重新啟用。"),purgePopupsHint:wgULS("复位 Popups,清除所有缓存数据。","複位 Popups,清除所有快取資料。"),PopupsHint:wgULS("复位 Popups,清除所有缓存数据。","複位 Popups,清除所有快取資料。"),spacebar:wgULS("空格","空格"),view:wgULS("查看","檢視"),"view article":wgULS("查看条目","檢視條目"),viewHint:wgULS("前往 %s","前往 %s"),talk:wgULS("讨论","討論"),"talk page":wgULS("讨论页","討論頁"),"this&nbsp;revision":wgULS("此修订版本","此修訂版本"),"revision %s of %s":wgULS("页面 $2 的修订版本 $1","頁面 $2 的修訂版本 $1"),"Revision %s of %s":wgULS("页面 $2 的修订版本 $1","頁面 $2 的修訂版本 $1"),"the revision prior to revision %s of %s":wgULS("页面 $2 的修订版本 $1 之前的修订版本","頁面 $2 的修訂版本 $1 之前的修訂版本"),"Toggle image size":wgULS("点击切换图片大小","點擊切換圖片大小"),del:wgULS("删除","删除"),delete:wgULS("删除","删除"),deleteHint:wgULS("删除 %s","删除 %s"),undeleteShort:wgULS("恢复","恢復"),UndeleteHint:wgULS("恢复 %s","恢復 %s"),protect:wgULS("保护","保護"),protectHint:wgULS("保护 %s","保護 %s"),unprotectShort:wgULS("解除","解除"),unprotectHint:wgULS("解除对 %s 的保护","解除對 %s 的保護"),move:wgULS("移动","移動"),"move page":wgULS("移动页面","移動頁面"),MovepageHint:wgULS("修改 %s 的标题","修改 %s 的標題"),edit:wgULS("编辑","編輯"),"edit article":wgULS("编辑条目","編輯條目"),editHint:wgULS("修改 %s 的内容","修改 %s 的內容"),"edit talk":wgULS("编辑讨论页","編輯對話頁",null,null,"編輯討論頁"),new:wgULS("新","新"),"new topic":wgULS("新话题","新話題"),newSectionHint:wgULS("在 %s 增加新的讨论话题","在 %s 增加新的討論話題"),"null edit":wgULS("空编辑","空編輯"),nullEditHint:wgULS("进行一次对 %s 的空编辑","製造一次對 %s 的空編輯"),hist:wgULS("历史","歷史"),history:wgULS("历史","歷史"),historyHint:wgULS("%s 的修订历史","%s 的修訂歷史"),last:wgULS("之前","之前"),lastEdit:wgULS("最近更改","最近更改"),"show last edit":wgULS("最近一次更改","最新一次修訂"),"Show the last edit":wgULS("显示最近一次更改的差异","顯示最新一次修訂的差異"),lastContrib:wgULS("最近编辑","最近編輯"),"last set of edits":wgULS("最近编辑","最近編輯"),lastContribHint:wgULS("显示由最后一位编辑者造成的差异","顯示由最後一位編輯者製造的差異"),cur:wgULS("当前","當前"),diffCur:wgULS("与当前版本的差异","與目前版本的差異"),"Show changes since revision %s":wgULS("显示自修订版本 %s 的差异","顯示自修訂版本 %s 的差異"),"%s old":wgULS("%s 前的最后版本","%s 前的最后版本"),oldEdit:wgULS("旧编辑","舊編輯"),purge:wgULS("清除缓存","清除快取"),purgeHint:wgULS("清除服务器中 %s 的缓存","清除伺服器中 %s 的快取"),raw:wgULS("源代码","原始碼"),rawHint:wgULS("查看 %s 的源代码","檢視 %s 的原始碼"),render:wgULS("仅正文","僅正文"),renderHint:wgULS("显示 %s 的纯HTML解析(仅正文内容)","顯示 %s 的純HTML解析(僅正文內容)"),"Show the edit made to get revision":wgULS("显示编辑以得到修订版本","顯示編輯以得到修訂版本"),sinceMe:wgULS("自我","自我"),"changes since mine":wgULS("自我修订的差异","自我修訂的差異"),sinceMeHint:wgULS("显示自我上次修改以来的差异","顯示自我上次修改以來的差異"),"Couldn't find an edit by %s\nin the last %s edits to\n%s":wgULS("在 $3 最近 $2 次编辑中找不到 $1 做出的修改","在 $3 最近 $2 次編輯中找不到 $1 做出的修改"),eds:wgULS("编辑","編輯"),editors:wgULS("编辑者","編輯者"),editorListHint:wgULS("列出编辑过 %s 的用户","列出編輯過 %s 的使用者",null,null,"列出編輯過 %s 的用戶"),related:wgULS("相关","相關"),relatedChanges:wgULS("相关更改","相關更改"),"related changes":wgULS("相关更改","相關更改"),RecentchangeslinkedHint:wgULS("显示相关 %s 的修改","顯示相關 %s 的修改"),editOld:wgULS("编辑旧版","編輯舊版"),rv:wgULS("回退","恢復"),revert:wgULS("回退","恢復"),revertHint:wgULS("回退到 %s","恢復到 %s"),undo:wgULS("撤销","撤銷"),undoHint:wgULS("撤销这次编辑","撤銷這次編輯"),
defaultpopupRedlinkSummary:wgULS("移除到空页面[[%s]]的链接 ——[[Help:Popups小工具|Popups]]","移除到空頁面[[%s]]的連結 ——[[Help:Popups小工具|Popups]]"),defaultpopupFixDabsSummary:wgULS("消歧义[[%s]]到[[%s]] ——[[Help:Popups小工具|Popups]]","消歧義[[%s]]到[[%s]] ——[[Help:Popups小工具|Popups]]"),defaultpopupFixRedirsSummary:wgULS("忽略从[[%s]]到[[%s]]的重定向 ——[[Help:Popups小工具|Popups]]","忽略從[[%s]]到[[%s]]的重新導向 ——[[Help:Popups小工具|Popups]]"),defaultpopupExtendedRevertSummary:wgULS("回退到$2在$1时编辑的修订版本$3 ——[[Help:Popups小工具|Popups]]","還原到$2在$1時製作的修訂版本$3 ——[[Help:Popups小工具|Popups]]"),defaultpopupRevertToPreviousSummary:wgULS("回退到修订版本%s的上一个版本 ——[[Help:Popups小工具|Popups]]","還原到修訂版本%s的上一個版本 ——[[Help:Popups小工具|Popups]]"),defaultpopupRevertSummary:wgULS("回退到修订版本%s ——[[Help:Popups小工具|Popups]]","還原到修訂版本%s ——[[Help:Popups小工具|Popups]]"),defaultpopupQueriedRevertToPreviousSummary:wgULS("回退到修订版本$1的上一个版本,由$3在$2时编辑 ——[[Help:Popups小工具|Popups]]","還原到修訂版本$1的上一個版本,由$3在$2時製作 ——[[Help:Popups小工具|Popups]]"),defaultpopupQueriedRevertSummary:wgULS("回退到$3在$2时编辑的修订版本$1 ——[[Help:Popups小工具|Popups]]","還原到$3在$2時製作的修訂版本$1 ——[[Help:Popups小工具|Popups]]"),defaultpopupRmDabLinkSummary:wgULS("移除到消歧义页[[%s]]的链接 ——[[Help:Popups小工具|Popups]]","移除到消歧義頁[[%s]]的連結 ——[[Help:Popups小工具|Popups]]"),Redirects:wgULS("重定向","重定向"),"Bypass redirect":wgULS("忽略重定向","忽略重新導向"),"Fix this redirect":wgULS("修复重定向","修復重新導向"),disambig:wgULS("消歧义","消歧義"),disambigHint:wgULS("消歧义这个链接到 [[%s]]","消歧義這個連結到 [[%s]]"),"Click to disambiguate this link to:":wgULS("点击以消歧义这个链接到:","點擊以消歧義這個連結到:"),"remove this link":wgULS("移除链接","移除連結"),"remove all links to this page from this article":wgULS("移除此条目到这页的所有链接","移除此條目到這頁的所有連結"),"remove all links to this disambig page from this article":wgULS("移除此条目到这消歧义的所有链接","移除此條目到這消歧義的所有連結"),mainlink:wgULS("主链接","主連結"),wikiLink:wgULS("个内部链接","個內部連結"),wikiLinks:wgULS("个内部链接","個內部連結"),"links here":wgULS("链入","鏈入"),whatLinksHere:wgULS("链入页面","鏈入頁面"),"what links here":wgULS("链入页面","鏈入頁面"),WhatlinkshereHint:wgULS("显示链接到 %s 的页面","顯示連結到 %s 的頁面"),unwatchShort:wgULS("取消","取消"),watchThingy:wgULS("监视","監視"),watchHint:wgULS("加入 %s 到我的监视列表","加入 %s 到我的監視列表"),unwatchHint:wgULS("从我的监视列表移除 %s","從我的監視列表移除 %s"),"Only found one editor: %s made %s edits":wgULS("仅找到一位编者:%s 制造了 %s 次编辑","僅找到一位編者:%s 製造了 %s 次編輯"),"%s seems to be the last editor to the page %s":wgULS("%s 看上去是 %s 这页的最后一位编者","%s 看上去是 %s 這頁的最後一位編者"),rss:wgULS("RSS","RSS"),"Diff truncated for performance reasons":wgULS("出于性能考虑,差异已被截断","出於效能考慮,差異已被截斷"),"Old revision":wgULS("旧版本","舊版本"),"New revision":wgULS("新版本","新版本"),"Something went wrong :-(":wgULS("出问题了 :-(","出問題了 :-("),"Empty revision, maybe non-existent":wgULS("空的修订,可能并不存在","空的修訂,可能並不存在"),"Unknown date":wgULS("未知日期","未知日期"),"Empty category":wgULS("空的分类","空的分類"),"Category members (%s shown)":wgULS("分类成员(%s 显示)","分類成員(%s 顯示)"),"No image links found":wgULS("未找到文件链接","未找到檔案連結"),"File links":wgULS("文件链接","檔案連結"),"not commons":wgULS("维基共享中无此名称的文件。","維基共享中無此名稱的檔案。"),"commons only":wgULS("此文件来自维基共享。","此檔案來自維基共享。"),"No image found":wgULS("找不到文件","找不到檔案"),"commons dupe":wgULS("维基共享中存在此文件的副本。","維基共享中存在此檔案的副本。"),"commons conflict":wgULS("维基共享中存在此文件名称不同的副本。","維基共享中存在此檔名稱不同的副本。"),user:wgULS("用户","使用者",null,null,"用戶"),"user&nbsp;page":wgULS("用户页","使用者頁",null,null,"用戶頁"),"user talk":wgULS("用户讨论","使用者對話",null,null,"用戶討論"),"edit user talk":wgULS("编辑用户讨论","編輯使用者對話",null,null,"編輯用戶討論"),"leave comment":wgULS("留言","留言"),email:wgULS("电邮","電郵"),"email user":wgULS("电邮用户","電郵使用者"),EmailuserHint:wgULS("给 %s 发送电子邮件","給 %s 發送電子郵件"),space:wgULS("子页面","子頁面"),PrefixindexHint:wgULS("显示 %s 的用户页子页面","顯示 %s 的使用者頁子頁面",null,null,"顯示 %s 的用戶頁子頁面"),count:wgULS("统计","統計"),"edit counter":wgULS("编辑次数","編輯次數"),katelinkHint:wgULS("%s 的编辑次数","%s 的編輯次數"),contribs:wgULS("贡献","貢獻"),contributions:wgULS("贡献","貢獻"),deletedContribs:wgULS("已删除的贡献","已刪除的貢獻"),ContributionsHint:wgULS("%s 的用户贡献","%s 的使用者貢獻",null,null,"%s 的用戶貢獻"),tree:wgULS("树","樹"),contribsTreeHint:wgULS("根据名字空间查看 %s 的贡献","根據命名空間檢視 %s 的貢獻"),log:wgULS("日志","日誌"),"user log":wgULS("用户日志","使用者日誌",null,null,"用戶日誌"),userLogHint:wgULS("显示 %s 的用户日志","顯示 %s 的使用者日誌",null,null,"顯示 %s 的用戶日誌"),arin:wgULS("ARIN 查询","ARIN 查詢"),"Look up %s in ARIN whois database":wgULS("在 ARIN Whois 数据库中查询 %s","在 ARIN Whois 數據庫中查詢 %s"),unblockShort:wgULS("解除","解除"),block:wgULS("封禁","封鎖"),"block user":wgULS("封禁用户","封鎖使用者",null,null,"封鎖用戶"),IpblocklistHint:wgULS("解封 %s","解封 %s"),BlockipHint:wgULS("封禁 %s","封鎖 %s"),"block log":wgULS("封禁日志","封鎖日誌"),blockLogHint:wgULS("显示 %s 的封禁日志","顯示 %s 的封鎖日誌"),protectLogHint:wgULS("显示 %s 的保护日志","顯示 %s 的保護日誌"),pageLogHint:wgULS("显示 %s 的日志","顯示 %s 的日誌"),deleteLogHint:wgULS("显示 %s 的删除日志","顯示 %s 的刪除日誌"),"Invalid %s %s":wgULS("选项 %s 不可用:%s","選項 %s 不可用:%s"),m:wgULS("小","小"),"Enter a non-empty edit summary or press cancel to abort":wgULS("输入编辑摘要,或按取消中止操作","輸入編輯摘要,或按取消中止操作"),"Failed to get revision information, please edit manually.\n\n":wgULS("获取修订版本信息失败,请手动修改。\n\n","獲取修訂版本資訊失敗,請手動修改。\n\n"),"The %s button has been automatically clicked. Please wait for the next page to load.":wgULS("按钮 %s 已被自动点击,请等待下一个页面加载。","按鈕 %s 已被自動點擊,請等待下一個頁面載入。"),"Could not find button %s. Please check the settings in your javascript file.":wgULS("找不到按钮 %s,请检查您 JavaScript 文件中的设置。","找不到按鈕 %s,請檢查您 JavaScript 檔案中的設定。"),"Open full-size image":wgULS("查看全尺寸图像","檢視全尺寸影像"),zxy:wgULS("zxy","zxy"),globalSearchHint:wgULS("在维基百科其他语言搜索“%s”","在維基百科其他語言搜尋「%s」"),googleSearchHint:wgULS("在 Google 上搜索“%s”","在 Google 上搜尋「%s」"),"enable previews":wgULS("启用预览","啟用預覽"),"show preview":wgULS("禁用预览","禁用預覽"),historyfeedHint:wgULS("该页面的近期更改 RSS feed","該頁面的近期更改 RSS feed"),"send thanks":wgULS("发送感谢","傳送感謝"),ThanksHint:wgULS("向该用户发送一封感谢消息","向該使用者傳送一封感謝訊息"),"mark patrolled":wgULS("标记为已巡查","標記為已巡查"),markpatrolledHint:wgULS("标记该编辑为已巡查","標記該編輯為已巡查"),"Could not marked this edit as patrolled":wgULS("无法标记该编辑为已巡查","無法標記該編輯為已巡查"),defaultpopupReviewedSummary:wgULS("标记从版本%s到%s间的编辑为已巡查","標記從版本%s到%s間的編輯為已巡查"),"Image from Commons":wgULS("来自维基共享的图片","來自維基共用的圖片"),"Description page":wgULS("图片描述页","圖片描述頁"),"Alt text:":wgULS("替换文本(Alt):","替換文字(Alt):"),revdel:wgULS("历史版本被隐藏","歷史版本被隱藏"),editCounterLinkHint:wgULS("用户%s的编辑次数","使用者%s的編輯次數"),DeletedcontributionsHint:wgULS("用户%s的被删除编辑次数","使用者%s的被刪除編輯次數"),"No backlinks found":wgULS("找不到链入页面","找不到鏈入頁面")," and more":wgULS("以及其他页面","以及其他頁面"),"Download preview data":wgULS("下载预览数据","下載預覽資料"),"Invalid or IP user":wgULS("错误的用户名或IP用户","錯誤的使用者名稱或IP使用者"),"Not a registered username":wgULS("非已注册的用户","非已註冊的使用者"),BLOCKED:wgULS("被封禁","被封鎖"),"Has blocks":wgULS("被部分封禁","被部分封鎖")," edits since: ":wgULS("次编辑,注册日期为","次編輯,註冊日期為"),"last edit on ":wgULS("最后一次编辑于","最後一次編輯於"),EmailUserHint:wgULS("给 %s 发送电子邮件","給 %s 發送電子郵件"),RANGEBLOCKED:wgULS("IP段被封禁","IP段被封鎖"),"IP user":wgULS("IP用户","IP使用者"),"♀":"♀","♂":"♂",HIDDEN:wgULS("全域隐藏","全域隱藏"),LOCKED:wgULS("全域锁定","全域鎖定"),"Invalid user":wgULS("非法用户名","非法使用者名稱"),diff:wgULS("差异","差異")," to ":wgULS("至","至"),autoedit_version:"np20140416",PrefixIndexHint:wgULS("显示用户%s的子页面","顯示使用者%s的子頁面",null,null,"顯示用戶%s的子頁面"),nullEditSummary:wgULS("进行一次零编辑","進行一次零編輯"),"group-no-autoconfirmed":wgULS("非自动确认用户","非自動確認使用者",null,null,"非自動確認用戶"),separator:"、",comma:","},t={api:{},re:{},ns:{},string:{},wiki:{},user:{},misc:{},option:{},optionDefault:{},flag:{},cache:{},structures:{},timer:{},counter:{},current:{},fn:{},endoflist:null};if(window.pg&&!(window.pg instanceof HTMLElement))return;window.pg=t,mw.util.escapeRegExp||(mw.util.escapeRegExp=mw.RegExp.escape);const log=(...e)=>window.popupDebug&&console.log(...e),errlog=(...e)=>window.popupDebug&&console.error(...e);class Drag{constructor(){this.startCondition=null,this.endHook=null}fixE(e){let t=e;return void 0===t&&(t=window.event),void 0===t.layerX&&(t.layerX=t.offsetX),void 0===t.layerY&&(t.layerY=t.offsetY),t}init(e,t){const i=this;this.obj=e,e.onmousedown=function(e){i.start.bind(i)(e)},e.dragging=!1,e.popups_draggable=!0,e.hmode=!0,e.vmode=!0,e.root=t||e,isNaN(parseInt(e.root.style.left,10))&&(e.root.style.left="0px"),isNaN(parseInt(e.root.style.top,10))&&(e.root.style.top="0px"),e.root.onthisStart=function(){},e.root.onthisEnd=function(){},e.root.onthis=function(){}}start(e){let t=e;const i=this.obj;if(t=this.fixE(t),this.startCondition&&!this.startCondition(t))return;const n=parseInt(i.vmode?i.root.style.top:i.root.style.bottom,10),o=parseInt(i.hmode?i.root.style.left:i.root.style.right,10);i.root.onthisStart(o,n),i.lastMouseX=t.clientX,i.lastMouseY=t.clientY;const s=this;return i.onmousemoveDefault=document.onmousemove,i.dragging=!0,document.onmousemove=function(e){s.drag.bind(s)(e)},document.onmouseup=function(e){s.end.bind(s)(e)},!1}drag(e){let t=e;t=this.fixE(t);const i=this.obj,n=t.clientY,o=t.clientX,s=parseInt(i.vmode?i.root.style.top:i.root.style.bottom,10),r=parseInt(i.hmode?i.root.style.left:i.root.style.right,10)+(o-i.lastMouseX)*(i.hmode?1:-1),p=s+(n-i.lastMouseY)*(i.vmode?1:-1);return this.obj.root.style[i.hmode?"left":"right"]=`${r}px`,this.obj.root.style[i.vmode?"top":"bottom"]=`${p}px`,this.obj.lastMouseX=o,this.obj.lastMouseY=n,this.obj.root.onthis(r,p),!1}end(){document.onmousemove=this.obj.onmousemoveDefault,document.onmouseup=null,this.obj.dragging=!1,this.endHook&&this.endHook(parseInt(this.obj.root.style[this.obj.hmode?"left":"right"],10),parseInt(this.obj.root.style[this.obj.vmode?"top":"bottom"],10))}}t.structures.original={},t.structures.original.popupLayout=function(){return["popupError","popupImage","popupTopLinks","popupTitle","popupUserData","popupData","popupOtherLinks","popupRedir",["popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"],"popupMiscTools",["popupRedlink"],"popupPrePreviewSep","popupPreview","popupSecondPreview","popupPreviewMore","popupPostPreview","popupFixDab"]},t.structures.original.popupRedirSpans=function(){return["popupRedir","popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"]},t.structures.original.popupTitle=function(e){return log("defaultstructure.popupTitle"),getValueOf("popupNavLinks")?"":navlinkStringToHTML("<b><<mainlink>></b>",e.article,e.params)},t.structures.original.popupTopLinks=function(e){return log("defaultstructure.popupTopLinks"),getValueOf("popupNavLinks")?function navLinksHTML(e,t,i){return navlinkStringToHTML(`<span class="popupNavLinks">${function defaultNavlinkSpec(){let e=""
defaultpopupRedlinkSummary:wgULS("移除到空页面[[%s]]的链接 ——[[Help:Popups小工具|Popups]]","移除到空頁面[[%s]]的連結 ——[[Help:Popups小工具|Popups]]"),defaultpopupFixDabsSummary:wgULS("消歧义[[%s]]到[[%s]] ——[[Help:Popups小工具|Popups]]","消歧義[[%s]]到[[%s]] ——[[Help:Popups小工具|Popups]]"),defaultpopupFixRedirsSummary:wgULS("忽略从[[%s]]到[[%s]]的重定向 ——[[Help:Popups小工具|Popups]]","忽略從[[%s]]到[[%s]]的重新導向 ——[[Help:Popups小工具|Popups]]"),defaultpopupExtendedRevertSummary:wgULS("回退到$2在$1时编辑的修订版本$3 ——[[Help:Popups小工具|Popups]]","還原到$2在$1時製作的修訂版本$3 ——[[Help:Popups小工具|Popups]]"),defaultpopupRevertToPreviousSummary:wgULS("回退到修订版本%s的上一个版本 ——[[Help:Popups小工具|Popups]]","還原到修訂版本%s的上一個版本 ——[[Help:Popups小工具|Popups]]"),defaultpopupRevertSummary:wgULS("回退到修订版本%s ——[[Help:Popups小工具|Popups]]","還原到修訂版本%s ——[[Help:Popups小工具|Popups]]"),defaultpopupQueriedRevertToPreviousSummary:wgULS("回退到修订版本$1的上一个版本,由$3在$2时编辑 ——[[Help:Popups小工具|Popups]]","還原到修訂版本$1的上一個版本,由$3在$2時製作 ——[[Help:Popups小工具|Popups]]"),defaultpopupQueriedRevertSummary:wgULS("回退到$3在$2时编辑的修订版本$1 ——[[Help:Popups小工具|Popups]]","還原到$3在$2時製作的修訂版本$1 ——[[Help:Popups小工具|Popups]]"),defaultpopupRmDabLinkSummary:wgULS("移除到消歧义页[[%s]]的链接 ——[[Help:Popups小工具|Popups]]","移除到消歧義頁[[%s]]的連結 ——[[Help:Popups小工具|Popups]]"),Redirects:wgULS("重定向","重定向"),"Bypass redirect":wgULS("忽略重定向","忽略重新導向"),"Fix this redirect":wgULS("修复重定向","修復重新導向"),disambig:wgULS("消歧义","消歧義"),disambigHint:wgULS("消歧义这个链接到 [[%s]]","消歧義這個連結到 [[%s]]"),"Click to disambiguate this link to:":wgULS("点击以消歧义这个链接到:","點擊以消歧義這個連結到:"),"remove this link":wgULS("移除链接","移除連結"),"remove all links to this page from this article":wgULS("移除此条目到这页的所有链接","移除此條目到這頁的所有連結"),"remove all links to this disambig page from this article":wgULS("移除此条目到这消歧义的所有链接","移除此條目到這消歧義的所有連結"),mainlink:wgULS("主链接","主連結"),wikiLink:wgULS("个内部链接","個內部連結"),wikiLinks:wgULS("个内部链接","個內部連結"),"links here":wgULS("链入","鏈入"),whatLinksHere:wgULS("链入页面","鏈入頁面"),"what links here":wgULS("链入页面","鏈入頁面"),WhatlinkshereHint:wgULS("显示链接到 %s 的页面","顯示連結到 %s 的頁面"),unwatchShort:wgULS("取消","取消"),watchThingy:wgULS("监视","監視"),watchHint:wgULS("加入 %s 到我的监视列表","加入 %s 到我的監視列表"),unwatchHint:wgULS("从我的监视列表移除 %s","從我的監視列表移除 %s"),"Only found one editor: %s made %s edits":wgULS("仅找到一位编者:%s 制造了 %s 次编辑","僅找到一位編者:%s 製造了 %s 次編輯"),"%s seems to be the last editor to the page %s":wgULS("%s 看上去是 %s 这页的最后一位编者","%s 看上去是 %s 這頁的最後一位編者"),rss:wgULS("RSS","RSS"),"Diff truncated for performance reasons":wgULS("出于性能考虑,差异已被截断","出於效能考慮,差異已被截斷"),"Old revision":wgULS("旧版本","舊版本"),"New revision":wgULS("新版本","新版本"),"Something went wrong :-(":wgULS("出问题了 :-(","出問題了 :-("),"Empty revision, maybe non-existent":wgULS("空的修订,可能并不存在","空的修訂,可能並不存在"),"Unknown date":wgULS("未知日期","未知日期"),"Empty category":wgULS("空的分类","空的分類"),"Category members (%s shown)":wgULS("分类成员(%s 显示)","分類成員(%s 顯示)"),"No image links found":wgULS("未找到文件链接","未找到檔案連結"),"File links":wgULS("文件链接","檔案連結"),"not commons":wgULS("维基共享中无此名称的文件。","維基共享中無此名稱的檔案。"),"commons only":wgULS("此文件来自维基共享。","此檔案來自維基共享。"),"No image found":wgULS("找不到文件","找不到檔案"),"commons dupe":wgULS("维基共享中存在此文件的副本。","維基共享中存在此檔案的副本。"),"commons conflict":wgULS("维基共享中存在此文件名称不同的副本。","維基共享中存在此檔名稱不同的副本。"),user:wgULS("用户","使用者",null,null,"用戶"),"user&nbsp;page":wgULS("用户页","使用者頁",null,null,"用戶頁"),"user talk":wgULS("用户讨论","使用者對話",null,null,"用戶討論"),"edit user talk":wgULS("编辑用户讨论","編輯使用者對話",null,null,"編輯用戶討論"),"leave comment":wgULS("留言","留言"),email:wgULS("电邮","電郵"),"email user":wgULS("电邮用户","電郵使用者"),EmailuserHint:wgULS("给 %s 发送电子邮件","給 %s 發送電子郵件"),space:wgULS("子页面","子頁面"),PrefixindexHint:wgULS("显示 %s 的用户页子页面","顯示 %s 的使用者頁子頁面",null,null,"顯示 %s 的用戶頁子頁面"),count:wgULS("统计","統計"),"edit counter":wgULS("编辑次数","編輯次數"),katelinkHint:wgULS("%s 的编辑次数","%s 的編輯次數"),contribs:wgULS("贡献","貢獻"),contributions:wgULS("贡献","貢獻"),deletedContribs:wgULS("已删除的贡献","已刪除的貢獻"),ContributionsHint:wgULS("%s 的用户贡献","%s 的使用者貢獻",null,null,"%s 的用戶貢獻"),tree:wgULS("树","樹"),contribsTreeHint:wgULS("根据命名空间查看 %s 的贡献","根據命名空間檢視 %s 的貢獻"),log:wgULS("日志","日誌"),"user log":wgULS("用户日志","使用者日誌",null,null,"用戶日誌"),userLogHint:wgULS("显示 %s 的用户日志","顯示 %s 的使用者日誌",null,null,"顯示 %s 的用戶日誌"),arin:wgULS("ARIN 查询","ARIN 查詢"),"Look up %s in ARIN whois database":wgULS("在 ARIN Whois 数据库中查询 %s","在 ARIN Whois 數據庫中查詢 %s"),unblockShort:wgULS("解除","解除"),block:wgULS("封禁","封鎖"),"block user":wgULS("封禁用户","封鎖使用者",null,null,"封鎖用戶"),IpblocklistHint:wgULS("解封 %s","解封 %s"),BlockipHint:wgULS("封禁 %s","封鎖 %s"),"block log":wgULS("封禁日志","封鎖日誌"),blockLogHint:wgULS("显示 %s 的封禁日志","顯示 %s 的封鎖日誌"),protectLogHint:wgULS("显示 %s 的保护日志","顯示 %s 的保護日誌"),pageLogHint:wgULS("显示 %s 的日志","顯示 %s 的日誌"),deleteLogHint:wgULS("显示 %s 的删除日志","顯示 %s 的刪除日誌"),"Invalid %s %s":wgULS("选项 %s 不可用:%s","選項 %s 不可用:%s"),m:wgULS("小","小"),"Enter a non-empty edit summary or press cancel to abort":wgULS("输入编辑摘要,或按取消中止操作","輸入編輯摘要,或按取消中止操作"),"Failed to get revision information, please edit manually.\n\n":wgULS("获取修订版本信息失败,请手动修改。\n\n","獲取修訂版本資訊失敗,請手動修改。\n\n"),"The %s button has been automatically clicked. Please wait for the next page to load.":wgULS("按钮 %s 已被自动点击,请等待下一个页面加载。","按鈕 %s 已被自動點擊,請等待下一個頁面載入。"),"Could not find button %s. Please check the settings in your javascript file.":wgULS("找不到按钮 %s,请检查您 JavaScript 文件中的设置。","找不到按鈕 %s,請檢查您 JavaScript 檔案中的設定。"),"Open full-size image":wgULS("查看全尺寸图像","檢視全尺寸影像"),zxy:wgULS("zxy","zxy"),globalSearchHint:wgULS("在维基百科其他语言搜索“%s”","在維基百科其他語言搜尋「%s」"),googleSearchHint:wgULS("在 Google 上搜索“%s”","在 Google 上搜尋「%s」"),"enable previews":wgULS("启用预览","啟用預覽"),"show preview":wgULS("禁用预览","禁用預覽"),historyfeedHint:wgULS("该页面的近期更改 RSS feed","該頁面的近期更改 RSS feed"),"send thanks":wgULS("发送感谢","傳送感謝"),ThanksHint:wgULS("向该用户发送一封感谢消息","向該使用者傳送一封感謝訊息"),"mark patrolled":wgULS("标记为已巡查","標記為已巡查"),markpatrolledHint:wgULS("标记该编辑为已巡查","標記該編輯為已巡查"),"Could not marked this edit as patrolled":wgULS("无法标记该编辑为已巡查","無法標記該編輯為已巡查"),defaultpopupReviewedSummary:wgULS("标记从版本%s到%s间的编辑为已巡查","標記從版本%s到%s間的編輯為已巡查"),"Image from Commons":wgULS("来自维基共享的图片","來自維基共用的圖片"),"Description page":wgULS("图片描述页","圖片描述頁"),"Alt text:":wgULS("替换文本(Alt):","替換文字(Alt):"),revdel:wgULS("历史版本被隐藏","歷史版本被隱藏"),editCounterLinkHint:wgULS("用户%s的编辑次数","使用者%s的編輯次數"),DeletedcontributionsHint:wgULS("用户%s的被删除编辑次数","使用者%s的被刪除編輯次數"),"No backlinks found":wgULS("找不到链入页面","找不到鏈入頁面")," and more":wgULS("以及其他页面","以及其他頁面"),"Download preview data":wgULS("下载预览数据","下載預覽資料"),"Invalid or IP user":wgULS("错误的用户名或IP用户","錯誤的使用者名稱或IP使用者"),"Not a registered username":wgULS("非已注册的用户","非已註冊的使用者"),BLOCKED:wgULS("被封禁","被封鎖"),"Has blocks":wgULS("被部分封禁","被部分封鎖")," edits since: ":wgULS("次编辑,注册日期为","次編輯,註冊日期為"),"last edit on ":wgULS("最后一次编辑于","最後一次編輯於"),EmailUserHint:wgULS("给 %s 发送电子邮件","給 %s 發送電子郵件"),RANGEBLOCKED:wgULS("IP段被封禁","IP段被封鎖"),"IP user":wgULS("IP用户","IP使用者"),"♀":"♀","♂":"♂",HIDDEN:wgULS("全域隐藏","全域隱藏"),LOCKED:wgULS("全域锁定","全域鎖定"),"Invalid user":wgULS("非法用户名","非法使用者名稱"),diff:wgULS("差异","差異")," to ":wgULS("至","至"),autoedit_version:"np20140416",PrefixIndexHint:wgULS("显示用户%s的子页面","顯示使用者%s的子頁面",null,null,"顯示用戶%s的子頁面"),nullEditSummary:wgULS("进行一次零编辑","進行一次零編輯"),"group-no-autoconfirmed":wgULS("非自动确认用户","非自動確認使用者",null,null,"非自動確認用戶"),separator:"、",comma:","},t={api:{},re:{},ns:{},string:{},wiki:{},user:{},misc:{},option:{},optionDefault:{},flag:{},cache:{},structures:{},timer:{},counter:{},current:{},fn:{},endoflist:null};if(window.pg&&!(window.pg instanceof HTMLElement))return;window.pg=t,mw.util.escapeRegExp||(mw.util.escapeRegExp=mw.RegExp.escape);const log=(...e)=>window.popupDebug&&console.log(...e),errlog=(...e)=>window.popupDebug&&console.error(...e);class Drag{constructor(){this.startCondition=null,this.endHook=null}fixE(e){let t=e;return void 0===t&&(t=window.event),void 0===t.layerX&&(t.layerX=t.offsetX),void 0===t.layerY&&(t.layerY=t.offsetY),t}init(e,t){const i=this;this.obj=e,e.onmousedown=function(e){i.start.bind(i)(e)},e.dragging=!1,e.popups_draggable=!0,e.hmode=!0,e.vmode=!0,e.root=t||e,isNaN(parseInt(e.root.style.left,10))&&(e.root.style.left="0px"),isNaN(parseInt(e.root.style.top,10))&&(e.root.style.top="0px"),e.root.onthisStart=function(){},e.root.onthisEnd=function(){},e.root.onthis=function(){}}start(e){let t=e;const i=this.obj;if(t=this.fixE(t),this.startCondition&&!this.startCondition(t))return;const n=parseInt(i.vmode?i.root.style.top:i.root.style.bottom,10),o=parseInt(i.hmode?i.root.style.left:i.root.style.right,10);i.root.onthisStart(o,n),i.lastMouseX=t.clientX,i.lastMouseY=t.clientY;const s=this;return i.onmousemoveDefault=document.onmousemove,i.dragging=!0,document.onmousemove=function(e){s.drag.bind(s)(e)},document.onmouseup=function(e){s.end.bind(s)(e)},!1}drag(e){let t=e;t=this.fixE(t);const i=this.obj,n=t.clientY,o=t.clientX,s=parseInt(i.vmode?i.root.style.top:i.root.style.bottom,10),r=parseInt(i.hmode?i.root.style.left:i.root.style.right,10)+(o-i.lastMouseX)*(i.hmode?1:-1),p=s+(n-i.lastMouseY)*(i.vmode?1:-1);return this.obj.root.style[i.hmode?"left":"right"]=`${r}px`,this.obj.root.style[i.vmode?"top":"bottom"]=`${p}px`,this.obj.lastMouseX=o,this.obj.lastMouseY=n,this.obj.root.onthis(r,p),!1}end(){document.onmousemove=this.obj.onmousemoveDefault,document.onmouseup=null,this.obj.dragging=!1,this.endHook&&this.endHook(parseInt(this.obj.root.style[this.obj.hmode?"left":"right"],10),parseInt(this.obj.root.style[this.obj.vmode?"top":"bottom"],10))}}t.structures.original={},t.structures.original.popupLayout=function(){return["popupError","popupImage","popupTopLinks","popupTitle","popupUserData","popupData","popupOtherLinks","popupRedir",["popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"],"popupMiscTools",["popupRedlink"],"popupPrePreviewSep","popupPreview","popupSecondPreview","popupPreviewMore","popupPostPreview","popupFixDab"]},t.structures.original.popupRedirSpans=function(){return["popupRedir","popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"]},t.structures.original.popupTitle=function(e){return log("defaultstructure.popupTitle"),getValueOf("popupNavLinks")?"":navlinkStringToHTML("<b><<mainlink>></b>",e.article,e.params)},t.structures.original.popupTopLinks=function(e){return log("defaultstructure.popupTopLinks"),getValueOf("popupNavLinks")?function navLinksHTML(e,t,i){return navlinkStringToHTML(`<span class="popupNavLinks">${function defaultNavlinkSpec(){let e=""
;e+="<b><<mainlink|shortcut= >></b>",getValueOf("popupLastEditLink")&&(e+="*<<lastEdit|shortcut=/>>|<<lastContrib>>|<<sinceMe>>if(oldid){|<<oldEdit>>|<<diffCur>>}"),e+="if(user){<br><<contribs|shortcut=c>>*<<userlog|shortcut=L|log>>",e+="if(ipuser){*<<arin>>}if(wikimedia){*<<count|shortcut=#>>}",e+="if(ipuser){}else{*<<email|shortcut=E>>}if(admin){*<<block|shortcut=b>>|<<blocklog|log>>}}";const t="if(oldid){<<editOld|shortcut=e>>|<<revert|shortcut=v|rv>>|<<edit|cur>>}else{<<edit|shortcut=e>>}",i="<<history|shortcut=h>>|<<editors|shortcut=E|>>",n="<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>";return e+=`<br>if(talk){${t}|<<new|shortcut=+>>*${i}*${n}*<b><<article|shortcut=a>></b>|<<editArticle|edit>>}else{${t}*${i}*${n}*<b><<talk|shortcut=t>></b>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>}`,e+="<br><<whatLinksHere|shortcut=l>>*<<relatedChanges|shortcut=r>>*<<move|shortcut=m>>",e+="if(admin){<br><<unprotect|unprotectShort>>|<<protect|shortcut=p>>|<<protectlog|log>>*<<undelete|undeleteShort>>|<<delete|shortcut=d>>|<<deletelog|log>>}",e}()}</span>`,e,i)}(e.article,e.hint,e.params):""},t.structures.original.popupImage=function(e){return log(`original.popupImage, x.article=${e.article}, x.navpop.idNumber=${e.navpop.idNumber}`),function imageHTML(e,t){return simplePrintf('<a id="popupImageLink$1"><img align="right" valign="top" id="popupImg$1" style="display: none;"></img></a>',[t])}(e.article,e.navpop.idNumber)},t.structures.original.popupRedirTitle=t.structures.original.popupTitle,t.structures.original.popupRedirTopLinks=t.structures.original.popupTopLinks,copyStructure("original","nostalgia"),t.structures.nostalgia.popupTopLinks=function(e){let t="";t+="<b><<mainlink|shortcut= >></b>",t+="if(user){<br><<contribs|shortcut=c>>",t+="if(wikimedia){*<<count|shortcut=#>>}",t+="if(ipuser){}else{*<<email|shortcut=E>>}if(admin){*<<block|shortcut=b>>}}";const i="if(oldid){<<editOld|shortcut=e>>|<<revert|shortcut=v|rv>>|<<edit|cur>>}else{<<edit|shortcut=e>>}",n="<<history|shortcut=h>>",o="<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>";return t+=`<br>if(talk){${i}|<<new|shortcut=+>>*${n}*${o}*<b><<article|shortcut=a>></b>|<<editArticle|edit>>}else{${i}*${n}*${o}*<b><<talk|shortcut=t>></b>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>}`,t+="<br><<whatLinksHere|shortcut=l>>*<<relatedChanges|shortcut=r>>",t+="if(admin){<br>}else{*}<<move|shortcut=m>>",t+="if(admin){*<<unprotect|unprotectShort>>|<<protect|shortcut=p>>*<<undelete|undeleteShort>>|<<delete|shortcut=d>>}",navlinkStringToHTML(t,e.article,e.params)},t.structures.nostalgia.popupRedirTopLinks=t.structures.nostalgia.popupTopLinks,copyStructure("original","fancy"),t.structures.fancy.popupTitle=function(e){return navlinkStringToHTML("<font size=+0><<mainlink>></font>",e.article,e.params)},t.structures.fancy.popupTopLinks=function(e){const t="<<history|shortcut=h|hist>>|<<lastEdit|shortcut=/|last>>|<<editors|shortcut=E|eds>>",i="<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>",n="<<move|shortcut=m|move>>";return navlinkStringToHTML(`if(talk){<<edit|shortcut=e>>|<<new|shortcut=+|+>>*${t}*<<article|shortcut=a>>|<<editArticle|edit>>*${i}*${n}}else{<<edit|shortcut=e>>*${t}*<<talk|shortcut=t|>>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>*${i}*${n}}<br>`,e.article,e.params)},t.structures.fancy.popupOtherLinks=function(e){let t="<<contribs|shortcut=c>>if(wikimedia){|<<count|shortcut=#|#>>}";return t+=`if(ipuser){|<<arin>>}else{*<<email|shortcut=E|${popupString("email")}>>}if(admin){*<<block|shortcut=b>>}`,navlinkStringToHTML(`<br>if(user){${t}*}if(admin){<<unprotect|unprotectShort>>|<<protect|shortcut=p>>*<<undelete|undeleteShort>>|<<delete|shortcut=d|del>>if(user){<br>}else{*}}<<whatLinksHere|shortcut=l|links here>>*<<relatedChanges|shortcut=r|related>>`,e.article,e.params)},t.structures.fancy.popupRedirTitle=t.structures.fancy.popupTitle,t.structures.fancy.popupRedirTopLinks=t.structures.fancy.popupTopLinks,t.structures.fancy.popupRedirOtherLinks=t.structures.fancy.popupOtherLinks,copyStructure("fancy","fancy2"),t.structures.fancy2.popupTopLinks=function(e){return`<br>${t.structures.fancy.popupTopLinks(e).replace(RegExp("<br>$","i"),"")}`},t.structures.fancy2.popupLayout=function(){return["popupError","popupImage","popupTitle","popupUserData","popupData","popupTopLinks","popupOtherLinks","popupRedir",["popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"],"popupMiscTools",["popupRedlink"],"popupPrePreviewSep","popupPreview","popupSecondPreview","popupPreviewMore","popupPostPreview","popupFixDab"]},copyStructure("original","menus"),t.structures.menus.popupLayout=function(){return["popupError","popupImage","popupTopLinks","popupTitle","popupOtherLinks","popupRedir",["popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"],"popupUserData","popupData","popupMiscTools",["popupRedlink"],"popupPrePreviewSep","popupPreview","popupSecondPreview","popupPreviewMore","popupPostPreview","popupFixDab"]},t.structures.menus.popupTopLinks=function(e,t){const i=[],n='<div class="popup_drop">',o="</div>";let s="<<history|shortcut=h>>";t||(s=`<menurow>${s}|<<historyfeed|rss>>|<<editors|shortcut=E>></menurow>`),getValueOf("popupActionsMenu")?i.push(`<<mainlink>>*${n}${menuTitle("actions")}`):i.push(`${n}<<mainlink>>`),i.push("<menu>"),i.push("if(oldid){<menurow><<edit|shortcut=e>>|<<editOld|shortcut=e|this&nbsp;revision>></menurow><menurow><<revert|shortcut=v>>|<<undo>></menurow>}else{<<edit|shortcut=e>>}if(rcid){<<markpatrolled|mark patrolled>>}if(talk){<<new|shortcut=+|new topic>>}"+s+"<<lastEdit|shortcut=/|show last edit>>if(diff){<<thank|send thanks>>}"),t||i.push("<<lastContrib|last set of edits>><<sinceMe|changes since mine>>"),i.push("<<move|shortcut=m|move page>><<whatLinksHere|shortcut=l|what links here>><<relatedChanges|shortcut=r|related changes>>"),t||i.push("<menurow><<nullEdit|shortcut=n|null edit>>|<<purge|shortcut=P>></menurow><menurow><<search|shortcut=s>>if(wikimedia){|<<globalsearch|shortcut=g|global>>}|<<google|shortcut=G|web>></menurow>"),t||i.push("<menurow><<view|shortcut=v>>|<<render|shortcut=S>>|<<raw>></menurow>"),i.push("<hr /><menurow><<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>></menurow>if(admin){<menurow><<unprotect|unprotectShort>>|<<protect|shortcut=p>>|<<protectlog|log>></menurow><menurow><<undelete|undeleteShort>>|<<delete|shortcut=d>>|<<deletelog|log>></menurow>}"),i.push(`<hr />if(talk){<<article|shortcut=a|view article>><<editArticle|edit article>>}else{<<talk|shortcut=t|talk page>><<editTalk|edit talk>><<newTalk|shortcut=+|new topic>>}</menu>${o}`);const r="<<email|shortcut=E|email user>>";return i.push(`if(user){*${n}${menuTitle("user")}`),i.push("<menu>"),i.push("<menurow><<userPage|shortcut=u|user&nbsp;page>>|<<userSpace|space>></menurow>"),i.push("<<userTalk|shortcut=t|user talk>><<editUserTalk|edit user talk>><<newUserTalk|shortcut=+|leave comment>>"),t?i.push(`if(ipuser){}else{${r}}`):i.push(`if(ipuser){<<arin>>}else{${r}}`),i.push("<hr />if(wikimedia){<menurow>}<<contribs|shortcut=c|contributions>>if(wikimedia){</menurow>}if(admin){<menurow><<deletedContribs>></menurow>}<<userlog|shortcut=L|user log>>"),i.push("if(wikimedia){<<count|shortcut=#|edit counter>>}"),i.push("if(admin){<menurow><<unblock|unblockShort>>|<<block|shortcut=b|block user>></menurow>}"),i.push("<<blocklog|shortcut=B|block log>>"),i.push(`</menu>${o}}`),getValueOf("popupSetupMenu")&&!e.navpop.hasPopupMenu&&(e.navpop.hasPopupMenu=!0,i.push(`*${n}${menuTitle("popupsMenu")}<menu>`),i.push("<<togglePreviews|toggle previews>>"),i.push("<<purgePopups|reset>>"),i.push("<<disablePopups|disable>>"),i.push(`</menu>${o}`)),navlinkStringToHTML(i.join(""),e.article,e.params)},t.structures.menus.popupRedirTitle=t.structures.menus.popupTitle,t.structures.menus.popupRedirTopLinks=t.structures.menus.popupTopLinks,copyStructure("menus","shortmenus"),t.structures.shortmenus.popupTopLinks=function(e){return t.structures.menus.popupTopLinks(e,!0)},t.structures.shortmenus.popupRedirTopLinks=t.structures.shortmenus.popupTopLinks,t.structures.lite={},t.structures.lite.popupLayout=function(){return["popupTitle","popupPreview"]},t.structures.lite.popupTitle=function(e){return log(`${e.article}: structures.lite.popupTitle`),`<div><span class="popup_mainlink"><b>${e.article.toString()}</b></span></div>`};class Downloader{constructor(e){this.id=null,this.lastModified=null,this.callbackFunction=null,this.onFailure=null,this.aborted=!1,this.method="GET",this.async=!0,"undefined"!=typeof XMLHttpRequest&&(this.http=new XMLHttpRequest),this.url=e}send(e){return this.http?this.http.send(e):null}abort(){return this.http?(this.aborted=!0,this.http.abort()):null}getData(){return this.http?this.http.responseText:null}setTarget(){if(!this.http)return null;this.http.open(this.method,this.url,this.async),this.http.setRequestHeader("Api-User-Agent",t.api.userAgent)}getReadyState(){return this.http?this.http.readyState:null}start(){this.http&&(t.misc.downloadsInProgress[this.id]=this,this.http.send(null))}getLastModifiedDate(){if(!this.http)return null;let e=null;try{e=this.http.getResponseHeader("Last-Modified")}catch{}return e?new Date(e):null}setCallback(e){this.http&&(this.http.onreadystatechange=e)}getStatus(){return this.http?this.http.status:null}}t.misc.downloadsInProgress={};const i={dump:function(e,t){let i=e,n=t;"string"==typeof i&&(i=document.getElementById(i)),"string"==typeof n&&(n=document.getElementById(n)),n.innerHTML=this.convert(i.value)},convert:function(e){function remain(){return t.length}function sh(){return t.shift()}function ps(e){o+=e}function f(...e){let t,i,n=1,o=e[0],s="";for(;n<e.length&&(i=o.indexOf("?"))+1;n++)n-=t="?"===o.charAt(i+1)?1:0,s+=o.substring(0,i)+(t?"?":e[n]),o=o.substr(i+1+t);return s+o}function html_entities(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function htmlescape_text(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/:/g,"&#58;").replace(/\[/g,"&#91;").replace(/]/g,"&#93;")}function htmlescape_attr(e){return htmlescape_text(e).replace(/'/g,"&#39;").replace(/"/g,"&quot;")}function str_imatch(e,t){const i=Math.min(e.length,t.length);let n
;e+="<b><<mainlink|shortcut= >></b>",getValueOf("popupLastEditLink")&&(e+="*<<lastEdit|shortcut=/>>|<<lastContrib>>|<<sinceMe>>if(oldid){|<<oldEdit>>|<<diffCur>>}"),e+="if(user){<br><<contribs|shortcut=c>>*<<userlog|shortcut=L|log>>",e+="if(ipuser){*<<arin>>}if(wikimedia){*<<count|shortcut=#>>}",e+="if(ipuser){}else{*<<email|shortcut=E>>}if(admin){*<<block|shortcut=b>>|<<blocklog|log>>}}";const t="if(oldid){<<editOld|shortcut=e>>|<<revert|shortcut=v|rv>>|<<edit|cur>>}else{<<edit|shortcut=e>>}",i="<<history|shortcut=h>>|<<editors|shortcut=E|>>",n="<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>";return e+=`<br>if(talk){${t}|<<new|shortcut=+>>*${i}*${n}*<b><<article|shortcut=a>></b>|<<editArticle|edit>>}else{${t}*${i}*${n}*<b><<talk|shortcut=t>></b>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>}`,e+="<br><<whatLinksHere|shortcut=l>>*<<relatedChanges|shortcut=r>>*<<move|shortcut=m>>",e+="if(admin){<br><<unprotect|unprotectShort>>|<<protect|shortcut=p>>|<<protectlog|log>>*<<undelete|undeleteShort>>|<<delete|shortcut=d>>|<<deletelog|log>>}",e}()}</span>`,e,i)}(e.article,e.hint,e.params):""},t.structures.original.popupImage=function(e){return log(`original.popupImage, x.article=${e.article}, x.navpop.idNumber=${e.navpop.idNumber}`),function imageHTML(e,t){return simplePrintf('<a id="popupImageLink$1"><img align="right" valign="top" id="popupImg$1" style="display: none;"></img></a>',[t])}(e.article,e.navpop.idNumber)},t.structures.original.popupRedirTitle=t.structures.original.popupTitle,t.structures.original.popupRedirTopLinks=t.structures.original.popupTopLinks,copyStructure("original","nostalgia"),t.structures.nostalgia.popupTopLinks=function(e){let t="";t+="<b><<mainlink|shortcut= >></b>",t+="if(user){<br><<contribs|shortcut=c>>",t+="if(wikimedia){*<<count|shortcut=#>>}",t+="if(ipuser){}else{*<<email|shortcut=E>>}if(admin){*<<block|shortcut=b>>}}";const i="if(oldid){<<editOld|shortcut=e>>|<<revert|shortcut=v|rv>>|<<edit|cur>>}else{<<edit|shortcut=e>>}",n="<<history|shortcut=h>>",o="<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>";return t+=`<br>if(talk){${i}|<<new|shortcut=+>>*${n}*${o}*<b><<article|shortcut=a>></b>|<<editArticle|edit>>}else{${i}*${n}*${o}*<b><<talk|shortcut=t>></b>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>}`,t+="<br><<whatLinksHere|shortcut=l>>*<<relatedChanges|shortcut=r>>",t+="if(admin){<br>}else{*}<<move|shortcut=m>>",t+="if(admin){*<<unprotect|unprotectShort>>|<<protect|shortcut=p>>*<<undelete|undeleteShort>>|<<delete|shortcut=d>>}",navlinkStringToHTML(t,e.article,e.params)},t.structures.nostalgia.popupRedirTopLinks=t.structures.nostalgia.popupTopLinks,copyStructure("original","fancy"),t.structures.fancy.popupTitle=function(e){return navlinkStringToHTML("<font size=+0><<mainlink>></font>",e.article,e.params)},t.structures.fancy.popupTopLinks=function(e){const t="<<history|shortcut=h|hist>>|<<lastEdit|shortcut=/|last>>|<<editors|shortcut=E|eds>>",i="<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>",n="<<move|shortcut=m|move>>";return navlinkStringToHTML(`if(talk){<<edit|shortcut=e>>|<<new|shortcut=+|+>>*${t}*<<article|shortcut=a>>|<<editArticle|edit>>*${i}*${n}}else{<<edit|shortcut=e>>*${t}*<<talk|shortcut=t|>>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>*${i}*${n}}<br>`,e.article,e.params)},t.structures.fancy.popupOtherLinks=function(e){let t="<<contribs|shortcut=c>>if(wikimedia){|<<count|shortcut=#|#>>}";return t+=`if(ipuser){|<<arin>>}else{*<<email|shortcut=E|${popupString("email")}>>}if(admin){*<<block|shortcut=b>>}`,navlinkStringToHTML(`<br>if(user){${t}*}if(admin){<<unprotect|unprotectShort>>|<<protect|shortcut=p>>*<<undelete|undeleteShort>>|<<delete|shortcut=d|del>>if(user){<br>}else{*}}<<whatLinksHere|shortcut=l|links here>>*<<relatedChanges|shortcut=r|related>>`,e.article,e.params)},t.structures.fancy.popupRedirTitle=t.structures.fancy.popupTitle,t.structures.fancy.popupRedirTopLinks=t.structures.fancy.popupTopLinks,t.structures.fancy.popupRedirOtherLinks=t.structures.fancy.popupOtherLinks,copyStructure("fancy","fancy2"),t.structures.fancy2.popupTopLinks=function(e){return`<br>${t.structures.fancy.popupTopLinks(e).replace(RegExp("<br>$","i"),"")}`},t.structures.fancy2.popupLayout=function(){return["popupError","popupImage","popupTitle","popupUserData","popupData","popupTopLinks","popupOtherLinks","popupRedir",["popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"],"popupMiscTools",["popupRedlink"],"popupPrePreviewSep","popupPreview","popupSecondPreview","popupPreviewMore","popupPostPreview","popupFixDab"]},copyStructure("original","menus"),t.structures.menus.popupLayout=function(){return["popupError","popupImage","popupTopLinks","popupTitle","popupOtherLinks","popupRedir",["popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"],"popupUserData","popupData","popupMiscTools",["popupRedlink"],"popupPrePreviewSep","popupPreview","popupSecondPreview","popupPreviewMore","popupPostPreview","popupFixDab"]},t.structures.menus.popupTopLinks=function(e,t){const i=[],n='<div class="popup_drop">',o="</div>";let s="<<history|shortcut=h>>";t||(s=`<menurow>${s}|<<historyfeed|rss>>|<<editors|shortcut=E>></menurow>`),getValueOf("popupActionsMenu")?i.push(`<<mainlink>>*${n}${menuTitle("actions")}`):i.push(`${n}<<mainlink>>`),i.push("<menu>"),i.push("if(oldid){<menurow><<edit|shortcut=e>>|<<editOld|shortcut=e|this&nbsp;revision>></menurow><menurow><<revert|shortcut=v>>|<<undo>></menurow>}else{<<edit|shortcut=e>>}if(rcid){<<markpatrolled|mark patrolled>>}if(talk){<<new|shortcut=+|new topic>>}"+s+"<<lastEdit|shortcut=/|show last edit>>if(diff){<<thank|send thanks>>}"),t||i.push("<<lastContrib|last set of edits>><<sinceMe|changes since mine>>"),i.push("<<move|shortcut=m|move page>><<whatLinksHere|shortcut=l|what links here>><<relatedChanges|shortcut=r|related changes>>"),t||i.push("<menurow><<nullEdit|shortcut=n|null edit>>|<<purge|shortcut=P>></menurow><menurow><<search|shortcut=s>>if(wikimedia){|<<globalsearch|shortcut=g|global>>}|<<google|shortcut=G|web>></menurow>"),t||i.push("<menurow><<view|shortcut=v>>|<<render|shortcut=S>>|<<raw>></menurow>"),i.push("<hr /><menurow><<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>></menurow>if(admin){<menurow><<unprotect|unprotectShort>>|<<protect|shortcut=p>>|<<protectlog|log>></menurow><menurow><<undelete|undeleteShort>>|<<delete|shortcut=d>>|<<deletelog|log>></menurow>}"),i.push(`<hr />if(talk){<<article|shortcut=a|view article>><<editArticle|edit article>>}else{<<talk|shortcut=t|talk page>><<editTalk|edit talk>><<newTalk|shortcut=+|new topic>>}</menu>${o}`);const r="<<email|shortcut=E|email user>>";return i.push(`if(user){*${n}${menuTitle("user")}`),i.push("<menu>"),i.push("<menurow><<userPage|shortcut=u|user&nbsp;page>>|<<userSpace|space>></menurow>"),i.push("<<userTalk|shortcut=t|user talk>><<editUserTalk|edit user talk>><<newUserTalk|shortcut=+|leave comment>>"),t?i.push(`if(ipuser){}else{${r}}`):i.push(`if(ipuser){<<arin>>}else{${r}}`),i.push("<hr />if(wikimedia){<menurow>}<<contribs|shortcut=c|contributions>>if(wikimedia){</menurow>}if(admin){<menurow><<deletedContribs>></menurow>}<<userlog|shortcut=L|user log>>"),i.push("if(wikimedia){<<count|shortcut=#|edit counter>>}"),i.push("if(admin){<menurow><<unblock|unblockShort>>|<<block|shortcut=b|block user>></menurow>}"),i.push("<<blocklog|shortcut=B|block log>>"),i.push(`</menu>${o}}`),getValueOf("popupSetupMenu")&&!e.navpop.hasPopupMenu&&(e.navpop.hasPopupMenu=!0,i.push(`*${n}${menuTitle("popupsMenu")}<menu>`),i.push("<<togglePreviews|toggle previews>>"),i.push("<<purgePopups|reset>>"),i.push("<<disablePopups|disable>>"),i.push(`</menu>${o}`)),navlinkStringToHTML(i.join(""),e.article,e.params)},t.structures.menus.popupRedirTitle=t.structures.menus.popupTitle,t.structures.menus.popupRedirTopLinks=t.structures.menus.popupTopLinks,copyStructure("menus","shortmenus"),t.structures.shortmenus.popupTopLinks=function(e){return t.structures.menus.popupTopLinks(e,!0)},t.structures.shortmenus.popupRedirTopLinks=t.structures.shortmenus.popupTopLinks,t.structures.lite={},t.structures.lite.popupLayout=function(){return["popupTitle","popupPreview"]},t.structures.lite.popupTitle=function(e){return log(`${e.article}: structures.lite.popupTitle`),`<div><span class="popup_mainlink"><b>${e.article.toString()}</b></span></div>`};class Downloader{constructor(e){this.id=null,this.lastModified=null,this.callbackFunction=null,this.onFailure=null,this.aborted=!1,this.method="GET",this.async=!0,"undefined"!=typeof XMLHttpRequest&&(this.http=new XMLHttpRequest),this.url=e}send(e){return this.http?this.http.send(e):null}abort(){return this.http?(this.aborted=!0,this.http.abort()):null}getData(){return this.http?this.http.responseText:null}setTarget(){if(!this.http)return null;this.http.open(this.method,this.url,this.async),this.http.setRequestHeader("Api-User-Agent",t.api.userAgent)}getReadyState(){return this.http?this.http.readyState:null}start(){this.http&&(t.misc.downloadsInProgress[this.id]=this,this.http.send(null))}getLastModifiedDate(){if(!this.http)return null;let e=null;try{e=this.http.getResponseHeader("Last-Modified")}catch{}return e?new Date(e):null}setCallback(e){this.http&&(this.http.onreadystatechange=e)}getStatus(){return this.http?this.http.status:null}}t.misc.downloadsInProgress={};const i={dump:function(e,t){let i=e,n=t;"string"==typeof i&&(i=document.getElementById(i)),"string"==typeof n&&(n=document.getElementById(n)),n.innerHTML=this.convert(i.value)},convert:function(e){function remain(){return t.length}function sh(){return t.shift()}function ps(e){o+=e}function f(...e){let t,i,n=1,o=e[0],s="";for(;n<e.length&&(i=o.indexOf("?"))+1;n++)n-=t="?"===o.charAt(i+1)?1:0,s+=o.substring(0,i)+(t?"?":e[n]),o=o.substr(i+1+t);return s+o}function html_entities(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function htmlescape_text(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/:/g,"&#58;").replace(/\[/g,"&#91;").replace(/]/g,"&#93;")}function htmlescape_attr(e){return htmlescape_text(e).replace(/'/g,"&#39;").replace(/"/g,"&quot;")}function str_imatch(e,t){const i=Math.min(e.length,t.length);let n
;for(n=0;n<i&&e.charAt(n)===t.charAt(n);n++);return n}function compareLineStringOrReg(e){return"string"==typeof e?t[0]&&t[0].substr(0,e.length)===e:n=t[0]&&t[0].match(e)}function compareLineString(e){return t[0]===e}function charAtPoint(e){return t[0].charAt(e)}function endl(e){ps(e),sh()}function parse_list(){let e="";for(;remain()&&compareLineStringOrReg(/^([*#:;]+)(.*)$/);){const i=n;sh();const o=str_imatch(e,i[1]);for(let t=e.length-1;t>=o;t--){const n=e.charAt(t);"*"===n?ps("</ul>"):"#"===n?ps("</ol>"):$.inArray(i[1].charAt(t),["","*","#"])&&ps("</dl>")}for(let t=o;t<i[1].length;t++){const n=i[1].charAt(t);"*"===n?ps("<ul>"):"#"===n?ps("<ol>"):$.inArray(e.charAt(t),["","*","#"])&&ps("<dl>")}switch(i[1].charAt(i[1].length-1)){case"*":case"#":ps(`<li>${parse_inline_nowiki(i[2])}`);break;case";":{ps("<dt>");const e=i[2].match(/(.*?)(:.*?)$/);e?(ps(parse_inline_nowiki(e[1])),t.unshift(e[2])):ps(parse_inline_nowiki(i[2]));break}case":":ps(`<dd>${parse_inline_nowiki(i[2])}`)}e=i[1]}for(let t=e.length-1;t>=0;t--)ps(f("</?>","*"===e.charAt(t)?"ul":"#"===e.charAt(t)?"ol":"dl"))}function parse_table(){for(endl(f("<table>",compareLineStringOrReg(/^\{\|( .*)$/)?n[1]:""));remain();)if(compareLineStringOrReg("|"))switch(charAtPoint(1)){case"}":return void endl("</table>");case"-":endl(f("<tr>",compareLineStringOrReg(/\|-*(.*)/)[1]));break;default:parse_table_data()}else compareLineStringOrReg("!")?parse_table_data():sh()}function parse_table_data(){let e,n;const o=sh().match(/^(\|\+|\||!)((?:([^[|]*?)\|(?!\|))?(.*))$/);if("|+"===o[1]?ps("<caption"):ps("<t"+("|"===o[1]?"d":"h")),n=void 0!==o[3]?4:2,ps(">"),"|+"!==o[1])for(e=o[n].split("|"===o[1]?"||":/(?:\|\||!!)/),ps(parse_inline_nowiki(e.shift()));e.length;)t.unshift(o[1]+e.pop());else ps(parse_inline_nowiki(o[n]));let s=0;const r=[];for(;remain();)if(r.push(sh()),compareLineStringOrReg("|")){if(!s)break;"}"===charAtPoint(1)&&s--}else{if(!s&&compareLineStringOrReg("!"))break;compareLineStringOrReg("{|")&&s++}r.length&&ps(i.convert(r))}function parse_pre(){ps("<pre>");do{endl(`${parse_inline_nowiki(t[0].substring(1))}\n`)}while(remain()&&compareLineStringOrReg(" "));ps("</pre>")}function parse_block_image(){ps(parse_image(sh()))}function parse_image(e){let t=e.substring(e.indexOf(":")+1,e.length-2);const i=[];if(t.match(/\|/)){let e,n=0;for(let i=t.length-1;i>0;i--){if("|"===t.charAt(i)&&!n){e=t.substr(i+1),t=t.substring(0,i);break}switch(t.substr(i-1,2)){case"]]":n++,i--;break;case"[[":n--,i--}}i.length=0,i.push(...t.split(/\s*\|\s*/)),i.push(e)}return""}function parse_inline_nowiki(e){let t,i,n,o,s=0,r=0,p=0,a="";for(;-1!==(t=e.indexOf("<nowiki>",r));){a+=parse_inline_wiki(e.substring(s,t)),t+=8,r=t,o=!0;do{if(i=e.indexOf("<nowiki>",r),n=e.indexOf("</nowiki>",r),n<=i||-1===i){if(-1===n)return a+html_entities(e.substr(t));r=n+9,p?p--:(s=r,a+=html_entities(e.substring(t,s-9)),o=!1)}else r=i+8,p++}while(o)}return a+parse_inline_wiki(e.substr(s))}function parse_inline_wiki(e){let t=e;t=function parse_inline_images(e){let t,n,o,s,r,p,a=e,u=0,l=0;for(;-1!==(t=a.indexOf("[[",u))&&a.substr(t+2).match(RegExp(`^(Image|File|${i.conf.locale.image}):`,"i"));){n=!0,u=t;do{if(u+=2,o=a.indexOf("]]",u),s=a.indexOf("[[",u),o<=s||-1===s){if(-1===o)return a;u=o,l?l--:(r=a.substring(t,o+2),p=parse_image(r),a=a.replace(r,p),u=t+p.length,n=!1)}else u=s,l++}while(n)}return a}(t),t=t.replace(/<(?:)math>(.*?)<\/math>/gi,"");let n=new Date,o=n.getUTCMinutes();return o<10&&(o=`0${o}`),n=f("?:?, ? ? ? (UTC)",n.getUTCHours(),o,n.getUTCDate(),i.conf.locale.months[n.getUTCMonth()],n.getUTCFullYear()),t=t.replace(/~{5}(?!~)/g,n).replace(/~{4}(?!~)/g,`${i.conf.user.name} ${n}`).replace(/~{3}(?!~)/g,i.conf.user.name).replace(RegExp(`\\[\\[:((?:${i.conf.locale.category}|Image|File|${i.conf.locale.image}|${i.conf.wiki.interwiki}):[^|]*?)\\]\\](\\w*)`,"gi"),(e,t,n)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(t)+htmlescape_text(n))).replace(RegExp(`\\[\\[(?:${i.conf.locale.category}|${i.conf.wiki.interwiki}):.*?\\]\\]`,"gi"),"").replace(RegExp(`\\[\\[:((?:${i.conf.locale.category}|Image|File|${i.conf.locale.image}|${i.conf.wiki.interwiki}):.*?)\\|([^\\]]+?)\\]\\](\\w*)`,"gi"),(e,t,n,o)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(n)+htmlescape_text(o))).replace(/\[\[(\/[^|]*?)\]\]/g,(e,t)=>f("<a href='?'>?</a>",i.conf.baseUrl+htmlescape_attr(t),htmlescape_text(t))).replace(/\[\[(\/.*?)\|(.+?)\]\]/g,(e,t,n)=>f("<a href='?'>?</a>",i.conf.baseUrl+htmlescape_attr(t),htmlescape_text(n))).replace(/\[\[([^[|]*?)\]\](\w*)/g,(e,t,n)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(t)+htmlescape_text(n))).replace(/\[\[([^[]*?)\|([^\]]+?)\]\](\w*)/g,(e,t,n,o)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(n)+htmlescape_text(o))).replace(/\[\[([^\]]*?:)?(.*?)( *\(.*?\))?\|\]\]/g,(e,t,n,o)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t)+htmlescape_attr(n)+htmlescape_attr(o),htmlescape_text(n))).replace(/\[(https?|news|ftp|mailto|gopher|irc):(\/*)([^\]]*?) (.*?)\]/g,(e,t,i,n,o)=>f("<a class='external' href='?:?'>?</a>",htmlescape_attr(t),htmlescape_attr(i)+htmlescape_attr(n),htmlescape_text(o))).replace(/\[http:\/\/(.*?)\]/g,(e,t)=>f("<a class='external' href='http://?'>[#]</a>",htmlescape_attr(t))).replace(/\[(news|ftp|mailto|gopher|irc):(\/*)(.*?)\]/g,(e,t,i,n)=>f("<a class='external' href='?:?'>?:?</a>",htmlescape_attr(t),htmlescape_attr(i)+htmlescape_attr(n),htmlescape_text(t),htmlescape_text(i)+htmlescape_text(n))).replace(/(^| )(https?|news|ftp|mailto|gopher|irc):(\/*)([^ $]*[^.,!?;: $])/g,(e,t,i,n,o)=>f("?<a class='external' href='?:?'>?:?</a>",htmlescape_text(t),htmlescape_attr(i),htmlescape_attr(n)+htmlescape_attr(o),htmlescape_text(i),htmlescape_text(n)+htmlescape_text(o))).replace("__NOTOC__","").replace("__NOINDEX__","").replace("__INDEX__","").replace("__NOEDITSECTION__",""),function parse_inline_formatting(e){let t,i,n,o,s="";for(;(n=e.indexOf("''",o))+1;)s+=e.substring(o,n),o=n+2,"'"===e.charAt(n+2)?(o++,i=!i,s+=i?"<strong>":"</strong>"):(t=!t,s+=t?"<em>":"</em>");return s+e.substr(o)}(t)}const t="string"==typeof e?e.replace(/\r/g,"").split(/\n/):e;let n,o="",s=0;for(;remain();)compareLineStringOrReg(/^(={1,6})(.*)\1(.*)$/)?(s=0,endl(f("<h?>?</h?>?",n[1].length,parse_inline_nowiki(n[2]),n[1].length,n[3]))):compareLineStringOrReg(/^[*#:;]/)?(s=0,parse_list()):compareLineStringOrReg(" ")?(s=0,parse_pre()):compareLineStringOrReg("{|")?(s=0,parse_table()):compareLineStringOrReg(/^----+$/)?(s=0,endl("<hr />")):compareLineStringOrReg(i.BLOCK_IMAGE)?(s=0,parse_block_image()):(compareLineString("")?(s=remain()>1&&""===t[1],s&&endl("<p><br>")):(s||(ps("<p>"),s=1),ps(`${parse_inline_nowiki(t[0])} `)),sh());return o}};class Stringwrapper{indexOf(e){return this.toString().indexOf(e)}toString(){return this.value}parenSplit(e){return this.toString().parenSplit(e)}substring(e,t){return void 0===t?this.toString().substring(e):this.toString().substring(e,t)}split(e){return this.toString().split(e)}replace(e,t){return this.toString().replace(e,t)}}class Title extends Stringwrapper{constructor(e){super(),this.value=null,this.anchor="",this.setUtf(e)}static fromURL(e){return(new Title).fromURL(e)}static fromAnchor(e){return(new Title).fromAnchor(e)}static fromWikiText(e){return(new Title).fromWikiText(e)}toString(e){return this.value+(!e&&this.anchor?`#${this.anchorString()}`:"")}anchorString(){if(!this.anchor)return"";const e=this.anchor.parenSplit(/((?:[.][0-9A-F]{2})+)/),t=e.length;let i;for(let n=1;n<t;n+=2){i=e[n].split(".").join("%");try{i=decodeURIComponent(i)}catch{}e[n]=i.split("_").join(" ")}return e.join("")}urlAnchor(){const e=this.anchor.parenSplit("/((?:[%][0-9A-F]{2})+)/"),t=e.length;for(let i=1;i<t;i+=2)e[i]=e[i].split("%").join(".");return e.join("")}anchorFromUtf(e){this.anchor=encodeURIComponent(e.split(" ").join("_")).split("%3A").join(":").split("'").join("%27").split("%").join(".")}decodeNasties(e){try{let t=decodeURI(this.decodeEscapes(e));return t=t.replace(/[_ ]*$/,""),t}catch(t){return e}}decodeEscapes(e){const t=e.parenSplit(/((?:[%][0-9A-Fa-f]{2})+)/),i=t.length;if(1===i)return t[0].replace(/%(?![0-9a-fA-F][0-9a-fA-F])/g,"%25");for(let e=1;e<i;e+=2)t[e]=decodeURIComponent(t[e]);return t.join("")}hintValue(){return this.value?safeDecodeURI(this.value):""}toUserName(e){this.namespaceId()===t.nsUserId||this.namespaceId()===t.nsUsertalkId?this.value=(e?`${mw.config.get("wgFormattedNamespaces")[t.nsUserId]}:`:"")+this.stripNamespace().split("/")[0]:this.value=null}userName(e){const t=new Title(this.value);return t.toUserName(e),t.value?t:null}toTalkPage(){if(null===this.value)return null;const e=this.namespaceId();if(e>=0&&e%2==0){const t=mw.config.get("wgFormattedNamespaces")[e+1];if(void 0!==t)return this.value=""===t?this.stripNamespace():`${t.split(" ").join("_")}:${this.stripNamespace()}`,this.value}return this.value=null,null}namespace(){return mw.config.get("wgFormattedNamespaces")[this.namespaceId()]}namespaceId(){try{const e=this.value.indexOf(":");if(e<0)return 0;const t=mw.config.get("wgNamespaceIds")[this.value.substring(0,e).split(" ").join("_").toLowerCase()];return void 0===t?0:t}catch(e){return console.error(e,this),0}}talkPage(){const e=new Title(this.value);return e.toTalkPage(),e.value?e:null}isTalkPage(){return null===this.talkPage()}toArticleFromTalkPage(){if(null===this.value)return null;const e=this.namespaceId();if(e>=0&&e%2==1){const t=mw.config.get("wgFormattedNamespaces")[e-1];if(void 0!==t)return this.value=""===t?this.stripNamespace():`${t.split(" ").join("_")}:${this.stripNamespace()}`,this.value}return this.value=null,null}articleFromTalkPage(){const e=new Title(this.value);return e.toArticleFromTalkPage(),e.value?e:null}articleFromTalkOrArticle(){const e=new Title(this.value);return e.toArticleFromTalkPage()?e:this}isIpUser(){return t.re.ipUser.test(this.userName())}stripNamespace(){const e=this.value.indexOf(":");return e<0||this.namespaceId()===t.nsMainspaceId?this.value:this.value.substring(e+1)}setUtf(e){if(!e)return void(this.value="");const t=e.indexOf("#");if(t<0)return this.value=e.split("_").join(" "),void(this.anchor="")
;for(n=0;n<i&&e.charAt(n)===t.charAt(n);n++);return n}function compareLineStringOrReg(e){return"string"==typeof e?t[0]&&t[0].substr(0,e.length)===e:n=t[0]&&t[0].match(e)}function compareLineString(e){return t[0]===e}function charAtPoint(e){return t[0].charAt(e)}function endl(e){ps(e),sh()}function parse_list(){let e="";for(;remain()&&compareLineStringOrReg(/^([*#:;]+)(.*)$/);){const i=n;sh();const o=str_imatch(e,i[1]);for(let t=e.length-1;t>=o;t--){const n=e.charAt(t);"*"===n?ps("</ul>"):"#"===n?ps("</ol>"):$.inArray(i[1].charAt(t),["","*","#"])&&ps("</dl>")}for(let t=o;t<i[1].length;t++){const n=i[1].charAt(t);"*"===n?ps("<ul>"):"#"===n?ps("<ol>"):$.inArray(e.charAt(t),["","*","#"])&&ps("<dl>")}switch(i[1].charAt(i[1].length-1)){case"*":case"#":ps(`<li>${parse_inline_nowiki(i[2])}`);break;case";":{ps("<dt>");const e=i[2].match(/(.*?)(:.*?)$/);e?(ps(parse_inline_nowiki(e[1])),t.unshift(e[2])):ps(parse_inline_nowiki(i[2]));break}case":":ps(`<dd>${parse_inline_nowiki(i[2])}`)}e=i[1]}for(let t=e.length-1;t>=0;t--)ps(f("</?>","*"===e.charAt(t)?"ul":"#"===e.charAt(t)?"ol":"dl"))}function parse_table(){for(endl(f("<table>",compareLineStringOrReg(/^\{\|( .*)$/)?n[1]:""));remain();)if(compareLineStringOrReg("|"))switch(charAtPoint(1)){case"}":return void endl("</table>");case"-":endl(f("<tr>",compareLineStringOrReg(/\|-*(.*)/)[1]));break;default:parse_table_data()}else compareLineStringOrReg("!")?parse_table_data():sh()}function parse_table_data(){let e,n;const o=sh().match(/^(\|\+|\||!)((?:([^[|]*?)\|(?!\|))?(.*))$/);if("|+"===o[1]?ps("<caption"):ps("<t"+("|"===o[1]?"d":"h")),n=void 0!==o[3]?4:2,ps(">"),"|+"!==o[1])for(e=o[n].split("|"===o[1]?"||":/(?:\|\||!!)/),ps(parse_inline_nowiki(e.shift()));e.length;)t.unshift(o[1]+e.pop());else ps(parse_inline_nowiki(o[n]));let s=0;const r=[];for(;remain();)if(r.push(sh()),compareLineStringOrReg("|")){if(!s)break;"}"===charAtPoint(1)&&s--}else{if(!s&&compareLineStringOrReg("!"))break;compareLineStringOrReg("{|")&&s++}r.length&&ps(i.convert(r))}function parse_pre(){ps("<pre>");do{endl(`${parse_inline_nowiki(t[0].substring(1))}\n`)}while(remain()&&compareLineStringOrReg(" "));ps("</pre>")}function parse_block_image(){ps(parse_image(sh()))}function parse_image(e){let t=e.substring(e.indexOf(":")+1,e.length-2);const i=[];if(t.match(/\|/)){let e,n=0;for(let i=t.length-1;i>0;i--){if("|"===t.charAt(i)&&!n){e=t.substr(i+1),t=t.substring(0,i);break}switch(t.substr(i-1,2)){case"]]":n++,i--;break;case"[[":n--,i--}}i.length=0,i.push(...t.split(/\s*\|\s*/)),i.push(e)}return""}function parse_inline_nowiki(e){let t,i,n,o,s=0,r=0,p=0,a="";for(;-1!==(t=e.indexOf("<nowiki>",r));){a+=parse_inline_wiki(e.substring(s,t)),t+=8,r=t,o=!0;do{if(i=e.indexOf("<nowiki>",r),n=e.indexOf("</nowiki>",r),n<=i||-1===i){if(-1===n)return a+html_entities(e.substr(t));r=n+9,p?p--:(s=r,a+=html_entities(e.substring(t,s-9)),o=!1)}else r=i+8,p++}while(o)}return a+parse_inline_wiki(e.substr(s))}function parse_inline_wiki(e){let t=e;t=function parse_inline_images(e){let t,n,o,s,r,p,a=e,u=0,l=0;for(;-1!==(t=a.indexOf("[[",u))&&a.substr(t+2).match(RegExp(`^(Image|File|${i.conf.locale.image}):`,"i"));){n=!0,u=t;do{if(u+=2,o=a.indexOf("]]",u),s=a.indexOf("[[",u),o<=s||-1===s){if(-1===o)return a;u=o,l?l--:(r=a.substring(t,o+2),p=parse_image(r),a=a.replace(r,p),u=t+p.length,n=!1)}else u=s,l++}while(n)}return a}(t),t=t.replace(/<(?:)math>(.*?)<\/math>/gi,"");let n=new Date,o=n.getUTCMinutes();return o<10&&(o=`0${o}`),n=f("?:?, ? ? ? (UTC)",n.getUTCHours(),o,n.getUTCDate(),i.conf.locale.months[n.getUTCMonth()],n.getUTCFullYear()),t=t.replace(/~{5}(?!~)/g,n).replace(/~{4}(?!~)/g,`${i.conf.user.name} ${n}`).replace(/~{3}(?!~)/g,i.conf.user.name).replace(RegExp(`\\[\\[:((?:${i.conf.locale.category}|Image|File|${i.conf.locale.image}|${i.conf.wiki.interwiki}):[^|]*?)\\]\\](\\w*)`,"gi"),(e,t,n)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(t)+htmlescape_text(n))).replace(RegExp(`\\[\\[(?:${i.conf.locale.category}|${i.conf.wiki.interwiki}):.*?\\]\\]`,"gi"),"").replace(RegExp(`\\[\\[:((?:${i.conf.locale.category}|Image|File|${i.conf.locale.image}|${i.conf.wiki.interwiki}):.*?)\\|([^\\]]+?)\\]\\](\\w*)`,"gi"),(e,t,n,o)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(n)+htmlescape_text(o))).replace(/\[\[(\/[^|]*?)\]\]/g,(e,t)=>f("<a href='?'>?</a>",i.conf.baseUrl+htmlescape_attr(t),htmlescape_text(t))).replace(/\[\[(\/.*?)\|(.+?)\]\]/g,(e,t,n)=>f("<a href='?'>?</a>",i.conf.baseUrl+htmlescape_attr(t),htmlescape_text(n))).replace(/\[\[([^[|]*?)\]\](\w*)/g,(e,t,n)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(t)+htmlescape_text(n))).replace(/\[\[([^[]*?)\|([^\]]+?)\]\](\w*)/g,(e,t,n,o)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(n)+htmlescape_text(o))).replace(/\[\[([^\]]*?:)?(.*?)( *\(.*?\))?\|\]\]/g,(e,t,n,o)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t)+htmlescape_attr(n)+htmlescape_attr(o),htmlescape_text(n))).replace(/\[(https?|news|ftp|mailto|gopher|irc):(\/*)([^\]]*?) (.*?)\]/g,(e,t,i,n,o)=>f("<a class='external' href='?:?'>?</a>",htmlescape_attr(t),htmlescape_attr(i)+htmlescape_attr(n),htmlescape_text(o))).replace(/\[http:\/\/(.*?)\]/g,(e,t)=>f("<a class='external' href='http://?'>[#]</a>",htmlescape_attr(t))).replace(/\[(news|ftp|mailto|gopher|irc):(\/*)(.*?)\]/g,(e,t,i,n)=>f("<a class='external' href='?:?'>?:?</a>",htmlescape_attr(t),htmlescape_attr(i)+htmlescape_attr(n),htmlescape_text(t),htmlescape_text(i)+htmlescape_text(n))).replace(/(^| )(https?|news|ftp|mailto|gopher|irc):(\/*)([^ $]*[^.,!?;: $])/g,(e,t,i,n,o)=>f("?<a class='external' href='?:?'>?:?</a>",htmlescape_text(t),htmlescape_attr(i),htmlescape_attr(n)+htmlescape_attr(o),htmlescape_text(i),htmlescape_text(n)+htmlescape_text(o))).replace("__NOTOC__","").replace("__NOINDEX__","").replace("__INDEX__","").replace("__NOEDITSECTION__",""),function parse_inline_formatting(e){let t,i,n,o,s="";for(;(n=e.indexOf("''",o))+1;)s+=e.substring(o,n),o=n+2,"'"===e.charAt(n+2)?(o++,i=!i,s+=i?"<strong>":"</strong>"):(t=!t,s+=t?"<em>":"</em>");return s+e.substr(o)}(t)}const t="string"==typeof e?e.replace(/\r/g,"").split(/\n/):e;let n,o="",s=0;for(;remain();)compareLineStringOrReg(/^(={1,6})(.*)\1(.*)$/)?(s=0,endl(f("<h?>?</h?>?",n[1].length,parse_inline_nowiki(n[2]),n[1].length,n[3]))):compareLineStringOrReg(/^[*#:;]/)?(s=0,parse_list()):compareLineStringOrReg(" ")?(s=0,parse_pre()):compareLineStringOrReg("{|")?(s=0,parse_table()):compareLineStringOrReg(/^----+$/)?(s=0,endl("<hr />")):compareLineStringOrReg(i.BLOCK_IMAGE)?(s=0,parse_block_image()):(compareLineString("")?(s=remain()>1&&""===t[1],s&&endl("<p><br>")):(s||(ps("<p>"),s=1),ps(`${parse_inline_nowiki(t[0])} `)),sh());return o}};class Stringwrapper{indexOf(e){return this.toString().indexOf(e)}toString(){return this.value}parenSplit(e){return this.toString().parenSplit(e)}substring(e,t){return void 0===t?this.toString().substring(e):this.toString().substring(e,t)}split(e){return this.toString().split(e)}replace(e,t){return this.toString().replace(e,t)}}class Title extends Stringwrapper{constructor(e){super(),this.value=null,this.anchor="",this.setUtf(e)}static fromURL(e){return(new Title).fromURL(e)}static fromAnchor(e){return(new Title).fromAnchor(e)}static fromWikiText(e){return(new Title).fromWikiText(e)}toString(e){return this.value+(!e&&this.anchor?`#${this.anchorString()}`:"")}anchorString(){if(!this.anchor)return"";const e=this.anchor.parenSplit(/((?:[.][0-9A-F]{2})+)/),t=e.length;let i;for(let n=1;n<t;n+=2){i=e[n].split(".").join("%");try{i=decodeURIComponent(i)}catch{}e[n]=i.split("_").join(" ")}return e.join("")}urlAnchor(){const e=this.anchor.parenSplit("/((?:[%][0-9A-F]{2})+)/"),t=e.length;for(let i=1;i<t;i+=2)e[i]=e[i].split("%").join(".");return e.join("")}anchorFromUtf(e){this.anchor=encodeURIComponent(e.split(" ").join("_")).split("%3A").join(":").split("'").join("%27").split("%").join(".")}decodeNasties(e){try{let t=decodeURI(this.decodeEscapes(e));return t=t.replace(/[_ ]*$/,""),t}catch(t){return e}}decodeEscapes(e){const t=e.parenSplit(/((?:[%][0-9A-Fa-f]{2})+)/),i=t.length;if(1===i)return t[0].replace(/%(?![0-9a-fA-F][0-9a-fA-F])/g,"%25");for(let e=1;e<i;e+=2)t[e]=decodeURIComponent(t[e]);return t.join("")}hintValue(){return this.value?safeDecodeURI(this.value):""}toUserName(e){this.namespaceId()===t.nsUserId||this.namespaceId()===t.nsUsertalkId?this.value=(e?`${mw.config.get("wgFormattedNamespaces")[t.nsUserId]}:`:"")+this.stripNamespace().split("/")[0]:this.value=null}userName(e){const t=new Title(this.value);return t.toUserName(e),t.value?t:null}toTalkPage(){if(null===this.value)return null;const e=this.namespaceId();if(e>=0&&e%2==0){const t=mw.config.get("wgFormattedNamespaces")[e+1];if(void 0!==t)return this.value=""===t?this.stripNamespace():`${t.split(" ").join("_")}:${this.stripNamespace()}`,this.value}return this.value=null,null}namespace(){return mw.config.get("wgFormattedNamespaces")[this.namespaceId()]}namespaceId(){try{const e=this.value.indexOf(":");if(e<0)return 0;const t=mw.config.get("wgNamespaceIds")[this.value.substring(0,e).split(" ").join("_").toLowerCase()];return void 0===t?0:t}catch(e){return console.error(e,this),0}}talkPage(){const e=new Title(this.value);return e.toTalkPage(),e.value?e:null}isTalkPage(){return null===this.talkPage()}toArticleFromTalkPage(){if(null===this.value)return null;const e=this.namespaceId();if(e>=0&&e%2==1){const t=mw.config.get("wgFormattedNamespaces")[e-1];if(void 0!==t)return this.value=""===t?this.stripNamespace():`${t.split(" ").join("_")}:${this.stripNamespace()}`,this.value}return this.value=null,null}articleFromTalkPage(){const e=new Title(this.value);return e.toArticleFromTalkPage(),e.value?e:null}articleFromTalkOrArticle(){const e=new Title(this.value);return e.toArticleFromTalkPage()?e:this}isIpUser(){return t.re.ipUser.test(this.userName())}stripNamespace(){const e=this.value.indexOf(":");return e<0||this.namespaceId()===t.nsMainspaceId?this.value:this.value.substring(e+1)}setUtf(e){if(!e)return void(this.value="");const t=e.indexOf("#");if(t<0)return this.value=e.split("_").join(" "),void(this.anchor="")

2025年9月21日 (日) 17:52的最新版本

/**
 * -------------------------------------------------------------------------
 * !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!!
 * -------------------------------------------------------------------------
 */
var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/Navigation_popups/Gadget-popups.js|user=[[U:星海子]]|co-authors=|longId=168b702dde16bcbf184e95908f72ee4114d46c94|shortId=168b702d|summary=feat: rename `名字空间` to `命名空间`}}'; 

/* <pre> */

"use strict";$(()=>{function setupTooltips(e,t,i,n){let o=e;log(`setupTooltips, container=${o}, remove=${t}`),o||(getValueOf("popupOnEditSelection")&&document&&document.editform&&document.editform.wpTextbox1&&(document.editform.wpTextbox1.onmouseup=doSelectionPopup),o=function defaultPopupsContainer(){return getValueOf("popupOnlyArticleLinks")&&(document.querySelector(".skin-vector-2022 .vector-body")||document.getElementById("mw_content")||document.getElementById("content")||document.getElementById("article")||document.getElementsByTagName("article")?.[0])||document}()),(t||i||!o.ranSetupTooltipsAlready)&&(o.ranSetupTooltipsAlready=!t,setupTooltipsLoop(o.getElementsByTagName("A"),0,250,100,t,n))}function setupTooltipsLoop(e,i,n,o,s,r){log(simplePrintf("setupTooltipsLoop(%s,%s,%s,%s,%s)",[e,i,n,o,s,r]));const p=i+n,a=Math.min(p,e.length);let u=a-i;log(`setupTooltips: anchors.length=${e.length}, begin=${i}, howmany=${n}, loopend=${a}, remove=${s}`);const l=s?removeTooltip:addTooltip;if(u>0)do{const t=e[a-u];void 0!==t&&t&&t.href?l(t,r):log(`got null anchor at index ${a}`-u)}while(--u);p<e.length?setTimeout(()=>{setupTooltipsLoop(e,p,n,o,s,r)},o):(s||getValueOf("popupTocLinks")||function rmTocTooltips(){const e=document.getElementById("toc");if(e){const t=e.getElementsByTagName("A"),i=t.length;for(let e=0;e<i;++e)removeTooltip(t[e])}}(),t.flag.finishedLoading=!0)}function addTooltip(e,i){(function isPopupLink(e){if(markNopopupSpanLinks.done||markNopopupSpanLinks(),e.inNopopupSpan)return!1;if(e.onmousedown||e.getAttribute("nopopup"))return!1;const i=e.href;return i!==`${document.location.href}#`&&!!t.re.basenames.test(i)&&(!t.re.urlNoPopup.test(i)||(t.re.email.test(i)||t.re.contribs.test(i)||t.re.backlinks.test(i)||t.re.specialdiff.test(i))&&-1===i.indexOf("&limit="))})(e)&&(e.onmouseover=mouseOverWikiLink,e.onmouseout=mouseOutWikiLink,e.onmousedown=killPopup,e.hasPopup=!0,e.popData=i)}function removeTooltip(e){e.hasPopup&&(e.onmouseover=null,e.onmouseout=null,e.originalTitle&&(e.title=e.originalTitle),e.hasPopup=!1)}function restoreTitle(e){!e.title&&e.originalTitle&&(e.title=e.originalTitle)}function removeModifierKeyHandler(e){document.removeEventListener("keydown",e.modifierKeyHandler,!1),document.removeEventListener("keyup",e.modifierKeyHandler,!1)}function mouseOverWikiLink(e){let t=e;if(!t&&window.event&&(t=window.event),getValueOf("popupModifier")){const e="disable"===getValueOf("popupModifierAction")?"keyup":"keydown",t=this;t.modifierKeyHandler=function(e){mouseOverWikiLink2(t,e)},document.addEventListener(e,t.modifierKeyHandler,!1)}return mouseOverWikiLink2(this,t)}function modifierPressed(e){let t=e;const i=getValueOf("popupModifier");return!!i&&(!t&&window.event&&(t=window.event),t&&i&&t[`${i.toLowerCase()}Key`])}function mouseOverWikiLink2(e,i){if(!function isCorrectModifier(e,t){if(!getValueOf("popupModifier"))return!0;const i=getValueOf("popupModifierAction");return"enable"===i&&modifierPressed(t)||"disable"===i&&!modifierPressed(t)}(0,i))return;if(getValueOf("removeTitles")&&function removeTitle(e){e.originalTitle||(e.originalTitle=e.title),e.title=""}(e),e===t.current.link&&e.navpopup&&e.navpopup.isVisible())return;t.current.link=e,getValueOf("simplePopups")&&!t.option.popupStructure&&function setDefault(e,t){newOption(e,t)}("popupStructure","original");const n=(new Title).fromAnchor(e);if(t.current.article=n,e.navpopup||(e.navpopup=function newNavpopup(e,i){const n=new Navpopup;return n.fuzz=5,n.delay=1e3*getValueOf("popupDelay"),n.idNumber=++t.idNumber,n.parentAnchor=e,n.parentPopup=e.popData&&e.popData.owner,n.article=i,function registerHooks(e){const t=getValueOf("popupMaxWidth");if("number"==typeof t){const setMaxWidth=function(){e.mainDiv.style.maxWidth=`${t}px`,e.maxWidth=t};e.addHook(setMaxWidth,"unhide","before")}e.addHook(addPopupShortcuts,"unhide","after"),e.addHook(rmPopupShortcuts,"hide","before")}(n),n}(e,n),t.current.linksHash[e.href]=e.navpopup,t.current.links.push(e)),null!==e.navpopup.pending&&0===e.navpopup.pending||function simplePopupContent(e,t){if(e.navpopup.hasPopupMenu=!1,e.navpopup.setInnerHTML(popupHTML(e)),fillEmptySpans({navpopup:e.navpopup}),getValueOf("popupDraggable")){let t=getValueOf("popupDragHandle")||null;t&&"all"!==t&&(t+=e.navpopup.idNumber),setTimeout(()=>{e.navpopup.makeDraggable(t)},150)}getValueOf("popupRedlinkRemoval")&&"new"===e.className&&setPopupHTML(`<br>${function popupRedlinkHTML(e){return changeLinkTargetLink({newTarget:null,text:popupString("remove this link").split(" ").join("&nbsp;"),hint:popupString("remove all links to this page from this article"),clickButton:getValueOf("popupRedlinkAutoClick"),oldTarget:e.toString(),summary:simplePrintf(getValueOf("popupRedlinkSummary"),[e.toString()])})}(t)}`,"popupRedlink",e.navpopup.idNumber)}(e,n),e.navpopup.showSoonIfStable(e.navpopup.delay),clearInterval(t.timer.checkPopupPosition),t.timer.checkPopupPosition=setInterval(checkPopupPosition,600),getValueOf("simplePopups")&&getValueOf("popupPreviewButton")&&!e.simpleNoMore){const t=document.createElement("div");t.className="popupPreviewButtonDiv";const i=document.createElement("span");t.appendChild(i),i.className="popupPreviewButton",i[`on${getValueOf("popupPreviewButtonEvent")}`]=function(){e.simpleNoMore=!0,t.style.display="none",nonsimplePopupContent(e,n)},i.innerHTML=popupString("show preview"),setPopupHTML(t,"popupPreview",e.navpopup.idNumber)}0!==e.navpopup.pending&&nonsimplePopupContent(e,n)}function debugData(e){getValueOf("popupDebugging")&&e.idNumber&&setPopupHTML(`idNumber=${e.idNumber}, pending=${e.pending}`,"popupError",e.idNumber)}function shouldShowNonSimple(e){return!getValueOf("simplePopups")||e.simpleNoMore}function shouldShow(e,t){return shouldShowNonSimple(e)?getValueOf(t):void 0!==window[t]&&window[t]}function nonsimplePopupContent(e,i){let n=null,o=null;const s=parseParams(e.href),r=void 0===s.oldid?null:s.oldid;shouldShow(e,"popupPreviewDiffs")&&(n=s.diff),shouldShow(e,"popupPreviewHistory")&&(o="history"===s.action),e.navpopup.pending=0;const p=function footnoteTarget(e){const t=Title.fromAnchor(e),i=t.anchor;if(!/^(cite_note-|_note-|endnote)/.test(i))return!1;if(Title.fromURL(location.href).toString(!0)!==t.toString(!0))return!1;let n=document.getElementById(i);for(;n&&"string"==typeof n.nodeName;){const e=n.nodeName.toLowerCase();if("li"===e)return n;if("body"===e)return!1;if(!n.parentNode)return!1;n=n.parentNode}return!1}(e);p?function footnotePreview(e,t){setPopupHTML(`<hr />${e.innerHTML}`,"popupPreview",t.idNumber)}(p,e.navpopup):n||0===n?async function loadDiff(e,i,n,o){o.diffData={oldRev:{},newRev:{}};const s=getMwApi(),r={action:"compare",prop:"ids|title"};switch(e.title&&(r.fromtitle=e.title),n){case"cur":switch(i){case null:case"":case"prev":r.torelative="prev";break;default:r.fromrev=i,r.torelative="cur"}break;case"prev":i?r.fromrev=i:r.fromtitle,r.torelative="prev";break;case"next":r.fromrev=i||0,r.torelative="next";break;default:r.fromrev=i||0,r.torev=n||0}const p=await s.get(r);o.diffData.oldRev.revid=p.compare.fromrevid,o.diffData.newRev.revid=p.compare.torevid,async function addReviewLink(e,i){if(!t.user.canReview)return;if(e.diffData.newRev.revid<=e.diffData.oldRev.revid)return;const n={action:"query",prop:"info|flagged",revids:e.diffData.oldRev.revid,formatversion:2},o=await getMwApi().get(n);if((o.query.pages[0].flagged&&o.query.pages[0].flagged.stable_revid||0)===e.diffData.oldRev.revid){const t=document.createElement("a");t.innerHTML=popupString("mark patrolled"),t.title=popupString("markpatrolledHint"),t.onclick=async function(){const i={action:"review",revid:e.diffData.newRev.revid,comment:tprintf("defaultpopupReviewedSummary",[e.diffData.oldRev.revid,e.diffData.newRev.revid])};try{await getMwApi().postWithToken("csrf",i),t.style.display="none"}catch{alert(popupString("Could not marked this edit as patrolled"))}},setPopupHTML(t,i,e.idNumber,null,!0)}}(o,"popupMiscTools");const go=function(){pendingNavpopTask(o);let e=`${t.wiki.apiwikibase}?format=json&formatversion=2&action=query&`;return e+=`revids=${o.diffData.oldRev.revid}|${o.diffData.newRev.revid}`,e+="&prop=revisions&rvprop=ids|timestamp|content",getPageWithCaching(e,doneDiff,o),!0};o.visible||!getValueOf("popupLazyDownloads")?go():o.addHook(go,"unhide","before","DOWNLOAD_DIFFS")}(i,r,n,e.navpopup):o?loadAPIPreview("history",i,e.navpopup):shouldShowNonSimple(e)&&t.re.contribs.test(e.href)?loadAPIPreview("contribs",i,e.navpopup):shouldShowNonSimple(e)&&t.re.backlinks.test(e.href)?loadAPIPreview("backlinks",i,e.navpopup):i.namespaceId()!==t.nsImageId||!shouldShow(e,"imagePopupsForImages")&&function anchorContainsImage(e){if(null===e)return!1;const t=e.childNodes;for(let e=0;e<t.length;++e)if("IMG"===t[e].nodeName)return!0;return!1}(e)?(i.namespaceId()===t.nsCategoryId&&shouldShow(e,"popupCategoryMembers")?loadAPIPreview("category",i,e.navpopup):i.namespaceId()!==t.nsUserId&&i.namespaceId()!==t.nsUsertalkId||!shouldShow(e,"popupUserInfo")||loadAPIPreview("userinfo",i,e.navpopup),shouldShowNonSimple(e)&&function startArticlePreview(e,t,i){i.redir=0,loadPreview(e,t,i)}(i,r,e.navpopup)):(loadAPIPreview("imagepagepreview",i,e.navpopup),loadImage(i,e.navpopup))}function pendingNavpopTask(e){e&&null===e.pending&&(e.pending=0),++e.pending,debugData(e)}function completedNavpopTask(e){e&&e.pending&&--e.pending,debugData(e)}function loadPreview(e,t,i){i.redir||(i.originalArticle=e),e.oldid=t,loadAPIPreview("revision",e,i)}function insertPreviewNow(e){if(!e.owner)return;const i=e.data,n=e.owner,o=n.redirTarget||n.originalArticle;!function makeFixDabs(e,i){getValueOf("popupFixDabs")&&isDisambig(e,i.article)&&Title.fromURL(location.href).namespaceId()!==t.nsSpecialId&&i.article.talkPage()&&setPopupHTML(function makeFixDab(e,t){const i=t.parentPopup&&t.parentPopup.article.toString(),n=function listLinks(e,t,i){const n=RegExp("\\[\\[([^|]*?) *(\\||\\]\\])","gi");let o=[];const s=e.parenSplit(n),r=RegExp("^[a-z]*:|^[Ss]pecial:|^[Ii]mage|^[Cc]ategory"),p=t.toString(),a=getValueOf("popupDabWiktionary");for(let e=1;e<s.length;e+=3)"string"==typeof s[e]&&s[e].length>0&&!r.test(s[e])&&o.push(retargetDab(s[e],t,p,i));if(o=function rmDupesFromSortedList(e){const t=[]
;for(let i=0;i<e.length;++i)0!==t.length&&e[i]===t[t.length-1]||t.push(e[i]);return t}(o.sort()),a){const e=`wiktionary:${p.replace(RegExp("^(.+)\\s+[(][^)]+[)]\\s*$"),"$1")}`;let n;n="first"===a.toLowerCase()?"unshift":"push",o[n](retargetDab(e,t,p,i))}return o.push(changeLinkTargetLink({newTarget:null,text:popupString("remove this link").split(" ").join("&nbsp;"),hint:popupString("remove all links to this disambig page from this article"),clickButton:getValueOf("popupDabsAutoClick"),oldTarget:t,summary:simplePrintf(getValueOf("popupRmDabLinkSummary"),[p]),watch:getValueOf("popupWatchDisambiggedPages"),title:i})),o}(e,t.originalArticle,i);if(0===n.length)return log("listLinks returned empty list"),null;let o=`<hr />${popupString("Click to disambiguate this link to:")}<br>`;return o+=n.join(popupString("separator")),o}(e,i),"popupFixDab",i.idNumber)}(i,n),getValueOf("popupSummaryData")&&(getPageInfo(i,e),setPopupTrailer(getPageInfo(i,e),n.idNumber));let s="";s=o.namespaceId()===t.nsImageId?o.toString():function getValidImageFromWikiText(e){let i=null;const n=function removeMatchesUnless(e,t,i,n){const o=e.parenSplit(t),s=i+1;for(let e=0;e<o.length;++e)e%s===0||n.test(o[e])||(o[e]="");return o.join("")}(e,RegExp("(\x3c!--[\\s\\S]*?--\x3e)"),1,RegExp("^\x3c!--[^[]*popup","i"));let o=t.re.image.exec(n);for(;o;){const e=o[2]||o[6];if(isValidImageName(e)){i=e;break}o=t.re.image.exec(n)}return t.re.image.lastIndex=0,i?`${mw.config.get("wgFormattedNamespaces")[t.nsImageId]}:${upcaseFirst(i)}`:null}(i),s&&loadImage(Title.fromWikiText(s),n),getValueOf("popupPreviews")&&function insertArticlePreview(e,i,n){e&&"string"==typeof e.data&&(i.namespaceId()===t.nsTemplateId&&getValueOf("popupPreviewRawTemplates")?setPopupHTML(`<hr /><span style="font-family: monospace;">${e.data.entify().split("\\n").join("<br />\\n")}</span>`,"popupPreview",n.idNumber):prepPreviewmaker(e.data,i,n).showPreview())}(e,o,n)}function prepPreviewmaker(e,i,n){const o=function anchorize(e,t){if(!t)return e;const i=RegExp(`(?:=+\\s*${literalizeRegex(t).replace(/[_ ]/g,"[_ ]")}\\s*=+|\\{\\{\\s*${getValueOf("popupAnchorRegexp")}\\s*(?:\\|[^|}]*)*?\\s*${literalizeRegex(t)}\\s*(?:\\|[^}]*)?}})`),n=e.match(i);if(n&&n.length>0&&n[0])return e.substring(e.indexOf(n[0]));const o=e.split("\n");for(let t=0;t<o.length;++t)if(o[t]=o[t].replace(RegExp("[[]{2}([^|\\]]*?[|])?(.*?)[\\]]{2}","g"),"$2").replace(/'''([^'])/g,"$1").replace(RegExp("''([^'])","g"),"$1"),o[t].match(i))return e.split("\n").slice(t).join("\n").replace(RegExp("^[^=]*"),"");return e}(e,i.anchorString()),s=function joinPath(e){return e.filter(removeNulls).join("/")}([t.wiki.articlebase,i.urlString()]);return new Previewmaker(o,s,n)}function killPopup(){if(removeModifierKeyHandler(this),getValueOf("popupShortcutKeys")&&rmPopupShortcuts(),t)return t.current.link&&t.current.link.navpopup&&t.current.link.navpopup.banish(),t.current.link=null,abortAllDownloads(),t.timer.checkPopupPosition&&(clearInterval(t.timer.checkPopupPosition),t.timer.checkPopupPosition=null),!0}function copyStructure(e,i){t.structures[i]={};for(const n in t.structures[e])t.structures[i][n]=t.structures[e][n]}function menuTitle(e){return`<a href="#" noPopup=1>${popupString(e)}</a>`}function substitute(e,t){const i=RegExp(t.from,t.flags);return e.replace(i,t.to)}function parseCmd(e){if(!e.length)return[];let t=!1;return"s"===e.charAt(0)&&(t=function parseSubstitute(e){let t,i,n,o,s=e;if(s.length<4)return!1;const r=s.charAt(1);return s=s.substring(2),o=skipOver(s,r),!!o&&(t=o.segment,s=o.remainder,o=skipOver(s,r),!!o&&(i=o.segment,s=o.remainder,n="",s.length&&(o=skipOver(s,";")||function skipToEnd(e){return{segment:e,remainder:""}}(s),o&&(n=o.segment,s=o.remainder)),{action:substitute,from:t,to:i,flags:n,remainder:s}))}(e),!!t&&[t].concat(parseCmd(t.remainder)))}function skipOver(e,t){const i=function findNext(e,t){for(let i=0;i<e.length;++i)if("\\"===e.charAt(i)&&(i+=2),e.charAt(i)===t)return i;return-1}(e,t);if(i<0)return!1;const n=function unEscape(e,t){return e.split("\\\\").join("\\").split(`\\${t}`).join(t).split("\\n").join("\n")}(e.substring(0,i),t);return{segment:n,remainder:e.substring(i+1)}}function setCheckbox(e,t){const i=mw.util.getParamValue(e);if(i)switch(i){case"1":case"yes":case"true":t.checked=!0;break;case"0":case"no":case"false":t.checked=!1}}function autoEdit(){if(!document.editform)return!1;if(/Popups/.test(mw.util.getParamValue("wpChangeTags"))){const e=document.createElement("input");e.type="hidden",e.name="wpChangeTags",e.value="Popups",document.editform.append(e),document.editform.action+="&wpChangeTags=Popups","wpSave"===mw.util.getParamValue("autoclick")&&(e.value+=",Automation tool",document.editform.action+="%2CAutomation%20tool")}setupPopups(()=>{if(mw.util.getParamValue("autoimpl")!==popupString("autoedit_version"))return!1;if(mw.util.getParamValue("autowatchlist")&&mw.util.getParamValue("actoken")===autoClickToken()&&t.fn.modifyWatchlist(mw.util.getParamValue("title"),mw.util.getParamValue("action")),!document.editform)return!1;if(autoEdit.alreadyRan)return!1;autoEdit.alreadyRan=!0;const e=mw.util.getParamValue("autoedit");if(e){try{const t=document.editform.wpTextbox1,i=parseCmd(e),n=function execCmds(e,t){let i=e;for(let e=0;e<t.length;++e)i=t[e].action(i,t[e]);return i}(t.value,i);t.value=n}catch(e){return}"undefined"!=typeof wikEdUseWikEd&&!0===wikEdUseWikEd&&WikEdUpdateFrame()}setCheckbox("autominor",document.editform.wpMinoredit),setCheckbox("autowatch",document.editform.wpWatchthis);const i=mw.util.getParamValue("autorv");i?startDownload(`${t.wiki.apiwikibase}?action=query&format=json&formatversion=2&prop=revisions&revids=${i}`,null,autoEdit2):autoEdit2()})}function autoEdit2(e){let t=mw.util.getParamValue("autosummary"),i=mw.util.getParamValue("autosummaryprompt"),n="";if(e&&e.data&&mw.util.getParamValue("autorv")){const o=function getRvSummary(e,t){try{const i=anyChild(getJsObj(t).query.pages).revisions[0],n=i.timestamp.split(/[A-Z]/g).join(" ").replace(/^ *| *$/g,"");return simplePrintf(e,[i.revid,n,i.userhidden?"(hidden)":i.user])}catch(e){return!1}}(t,e.data);!1===o?(i=!0,n=popupString("Failed to get revision information, please edit manually.\n\n"),t=simplePrintf(t,[mw.util.getParamValue("autorv"),"(unknown)","(unknown)"])):t=o}if(i){const e=n+popupString("Enter a non-empty edit summary or press cancel to abort"),i=prompt(e,t);if(!i)return;t=i}t&&(document.editform.wpSummary.value=t),setTimeout(autoEdit3,100)}function autoClickToken(){return mw.user.sessionId()}function autoEdit3(){if(mw.util.getParamValue("actoken")!==autoClickToken())return;const e=mw.util.getParamValue("autoclick");if(e)if(document.editform&&document.editform[e]){const i=document.editform[e];!function bannerMessage(e){const i=document.getElementsByTagName("h1");if(i){const n=document.createElement("div");n.innerHTML=`<font size=+1><b>${t.escapeQuotesHTML(e)}</b></font>`,i[0].parentNode.insertBefore(n,i[0])}}(tprintf("The %s button has been automatically clicked. Please wait for the next page to load.",[i.value])),document.title=`(${document.title})`,i.click()}else alert(tprintf("Could not find button %s. Please check the settings in your javascript file.",[e]))}function newDownload(e,i,n,o){let s=o;const r=new Downloader(e);return r.http?(r.id=i,r.setTarget(),s||(s=2),r.setCallback(function(){if(4===r.getReadyState()){Reflect.deleteProperty(t.misc.downloadsInProgress,this.id);try{200===r.getStatus()?(r.data=r.getData(),r.lastModified=r.getLastModifiedDate(),n(r)):"number"==typeof s?s>0&&newDownload(e,i,n,s-1):"function"==typeof s&&s(r,e,i,n)}catch{}}}),r):"ohdear"}function startDownload(e,t,i){const n=newDownload(e,t,i);return"string"==typeof n||n.start(),n}function abortAllDownloads(){for(const e in t.misc.downloadsInProgress)try{t.misc.downloadsInProgress[e].aborted=!0,t.misc.downloadsInProgress[e].abort(),Reflect.deleteProperty(t.misc.downloadsInProgress,e)}catch{}}function wiki2html(e,t){return i.conf.baseUrl=t,i.convert(e)}function popupFilterPageSize(e){return function formatBytes(e){return e>949?Math.round(e/100)/10+popupString("kB"):`${e}&nbsp;${popupString("bytes")}`}(e.length)}function popupFilterCountLinks(e){const t=function countLinks(e){return e.split("[[").length-1}(e);return`${t}&nbsp;${popupString(1!==t?"wikiLinks":"wikiLink")}`}function popupFilterCountImages(e){const i=function countImages(e){return(e.parenSplit(t.re.image).length-1)/(t.re.imageBracketCount+1)}(e);return`${i}&nbsp;${popupString(1!==i?"images":"image")}`}function popupFilterCountCategories(e){const i=function countCategories(e){return(e.parenSplit(t.re.category).length-1)/(t.re.categoryBracketCount+1)}(e);return`${i}&nbsp;${popupString(1!==i?"categories":"category")}`}function popupFilterLastModified(e,t){const i=t.lastModified,n=moment(i);return i&&getValueOf("popupLastModified")?tprintf("%s old",[formatAge(n)]).replace(RegExp(" ","g"),"&nbsp;"):""}function formatAge(e){const t=moment(),i=e.isBefore(t);let n=i?t.year()-e.year():e.year()-t.year(),o=i?t.month()-e.month():e.month()-t.month(),s=i?t.date()-e.date():e.date()-t.date(),r=i?t.hour()-e.hour():e.hour()-t.hour(),p=i?t.minute()-e.minute():e.minute()-t.minute(),a=i?t.second()-e.second():e.second()-t.second();a<0&&(p--,a+=60),p<0&&(r--,p+=60),r<0&&(s--,r+=24),s<0&&(o--,[0,2,4,6,7,9,11].includes((i?e:t).month())?s+=31:1===(i?e:t).month()?(i?e:t).year()%4==0?s+=29:s+=28:s+=30),o<0&&(n--,o+=12);let u="";return n>0&&(u+=addunit(n,"year")),o>0?u+=addunit(o,"month"):""!==u&&(u+=addunit(0,"month")),s>0?u+=addunit(s,"day"):""!==u&&(u+=addunit(0,"day")),r>0?u+=addunit(r,"hour"):""!==u&&(u+=addunit(0,"hour")),p>0?u+=addunit(p,"minute"):""!==u&&(u+=addunit(0,"minute")),a>0?u+=addunit(a,"second"):""!==u&&(u+=addunit(0,"second")),u.replace(/(\d) /g,"$1")}function addunit(e,t){return`${e} ${popupString(1!==e?`${t}s`:t)}`}function getPageInfo(e,t){if(!e||0===e.length)return popupString("Empty page");const i=getValueOf("popupFilters")||[],n=getValueOf("extraPopupFilters")||[],o=function runPopupFilters(e,t,i){const n=[];for(let o=0;o<e.length;++o)if(e[o]&&"function"==typeof e[o]){const s=e[o](t,i,i.owner.article);s&&n.push(s)}return n}(i.concat(n),e,t);let s=o.join(popupString("comma"));return""!==s&&(s=upcaseFirst(s)),s}
function popupFilterStubDetect(e,i,n){const o=function stubCount(e,i){if(!getValueOf("popupAllDabsStubs")&&i.namespace())return!1;let n=0,o=0;if(t.re.stub.test(e)){const i=e.parenSplit(t.re.stub);for(let e=1;e<i.length;e+=2)i[e]?++n:++o}return{real:o,sect:n}}(e,n);return o.real?popupString("stub"):o.sect?popupString("section stub"):""}function popupFilterDisambigDetect(e,t,i){return!getValueOf("popupAllDabsStubs")&&i.namespace()?"":isDisambig(e,i)?popupString("disambig"):""}function parseParams(e){let i=e;const n=t.re.specialdiff.exec(i);if(n){const e=n[1].split("/");if(1===e.length)return{oldid:e[0],diff:"prev"};if(2===e.length)return{oldid:e[0],diff:e[1]}}const o={};if(-1===i.indexOf("?"))return o;i=i.split("#")[0];const s=i.split("?").slice(1).join().split("&");for(let e=0;e<s.length;++e){const t=s[e].split("=");t.push(null),o[t[0]]=t[1]}if(o.diff&&void 0===o.oldid&&(o.oldid="prev"),o.oldid&&("prev"===o.oldid||"next"===o.oldid||"cur"===o.oldid)){const e=o.diff;o.diff=o.oldid,o.oldid=e}return o}function myDecodeURI(e){let i;try{i=decodeURI(e.toString())}catch(t){return e}for(let e=0;e<t.misc.decodeExtras.length;++e){const n=t.misc.decodeExtras[e].from,o=t.misc.decodeExtras[e].to;i=i.split(n).join(o)}return i}function safeDecodeURI(e){return myDecodeURI(e)||e}function isDisambig(e,i){return!(!getValueOf("popupAllDabsStubs")&&i.namespace())&&!i.isTalkPage()&&t.re.disambig.test(e)}function isValidImageName(e){return-1===e.indexOf("{")}function isInMainNamespace(e){return 0===e.namespaceId()}function markNopopupSpanLinks(){getValueOf("popupOnlyArticleLinks")||function fixVectorMenuPopups(){$("div.vectorMenu h3:first a:first, div.vector-menu h3:first a:first, nav.vector-menu h3:first a:first").prop("inNopopupSpan",!0)}();const e=$(".nopopups").toArray();for(let t=0;t<e.length;++t){const i=e[t].getElementsByTagName("a");for(let e=0;e<i.length;++e)i[e].inNopopupSpan=!0}markNopopupSpanLinks.done=!0}function getPageWithCaching(e,i,n){log(`getPageWithCaching, url=${e}`);const o=function findInPageCache(e){for(let i=0;i<t.cache.pages.length;++i)if(e===t.cache.pages[i].url)return i;return-1}(e);let s;o>-1?s=function fakeDownload(e,t,i,n,o,s){const r=newDownload(e,i);return r.owner=s,r.id=t,r.data=n,r.lastModified=o,i(r)}(e,n.idNumber,i,t.cache.pages[o].data,t.cache.pages[o].lastModified,n):(s=function getPage(e,i,n){return log("getPage"),startDownload(e,n.idNumber,function(e){e.aborted||(function addPageToCache(e){log(`addPageToCache ${e.url}`);const i={url:e.url,data:e.data,lastModified:e.lastModified};t.cache.pages.push(i)}(e),i(e))})}(e,i,n),s&&n&&n.addDownload&&(n.addDownload(s),s.owner=n))}function getJsObj(e){try{const t=JSON.parse(e);if(t.warnings)for(let e=0;e<t.warnings.length;e++)t.warnings[e]["*"]?log(t.warnings[e]["*"]):log(t.warnings[e].warnings);else t.error&&errlog(`${t.error.code}: ${t.error.info}`);return t}catch(t){return errlog(`Something went wrong with getJsObj, json=${e}`),1}}function anyChild(e){for(const t in e)return e[t];return null}function upcaseFirst(e){return"string"!=typeof e||""===e?"":e.charAt(0).toUpperCase()+e.substring(1)}function literalizeRegex(e){return mw.util.escapeRegExp(e)}function removeNulls(e){return null!==e}function simplePrintf(e,t){if(!e||!t)return e;const i=[],n=e.parenSplit(/(%s|\$[0-9]+)/);let o=0;do{if(i.push(n.shift()),!n.length)break;const e=n.shift();if("%s"===e)o<t.length?i.push(t[o]):i.push(e),++o;else{const n=parseInt(e.replace("$",""),10)-1;n>-1&&n<t.length?i.push(t[n]):i.push(e)}}while(n.length>0);return i.join("")}function isString(e){return"string"==typeof e||e instanceof String}function zeroFill(e,t=2){return`${e}`.padStart(t,"0")}function map(e,t){return function isArray(e){return Array.isArray(e)}(t)?function map_array(e,t){const i=[];for(let n=0;n<t.length;++n)i.push(e(t[n]));return i}(e,t):function map_object(e,t){const i={};for(const n in t)i[t]=e(t[n]);return i}(e,t)}function retargetDab(e,t,i,n){return log(`retargetDab: newTarget=${e} oldTarget=${t}`),changeLinkTargetLink({newTarget:e,text:e.split(" ").join("&nbsp;"),hint:tprintf("disambigHint",[e]),summary:simplePrintf(getValueOf("popupFixDabsSummary"),[i,e]),clickButton:getValueOf("popupDabsAutoClick"),minor:!0,oldTarget:t,watch:getValueOf("popupWatchDisambiggedPages"),title:n})}function setPopupHTML(e,i,n,o,s){let r=n;void 0===r&&(r=t.idNumber);const p=document.getElementById(i+r);return p?(s||(p.innerHTML=""),isString(e)?p.innerHTML+=e:p.appendChild(e),o&&o(),setTimeout(checkPopupPosition,100),!0):(setTimeout(()=>{setPopupHTML(e,i,r,o)},600),null)}function setPopupTrailer(e,t){return setPopupHTML(e,"popupData",t)}function fillEmptySpans(e){let i,n=!0;"object"==typeof e&&void 0!==e.redir&&e.redir||(n=!1);const o=e.navpopup.parentAnchor;let s,r=null,p=null,a={};n&&"object"==typeof e.redirTarget?s=e.redirTarget:(s=(new Title).fromAnchor(o),r=o.originalTitle||s.hintValue(),a=parseParams(o.href),p=getValueOf("popupHistoricalLinks")?a.oldid:null,i=a.rcid);const u={article:s,hint:r,oldid:p,rcid:i,navpop:e.navpopup,params:a},l=t.structures[getValueOf("popupStructure")];if("object"!=typeof l)return void setPopupHTML("popupError",`Unknown structure (this should never happen): ${t.option.popupStructure}`,e.navpopup.idNumber);const c=flatten(t.misc.layout),g=c.length,d=t.misc.redirSpans;for(let t=0;t<g;++t){const i=d&&-1!==d.indexOf(c[t]);if(i&&!n||!i&&n)continue;const o=l[c[t]];if(void 0===o)continue;let s=setPopupHTML;switch(!getValueOf("popupActiveNavlinks")||0!==c[t].indexOf("popupTopLinks")&&0!==c[t].indexOf("popupRedirTopLinks")||(s=setPopupTipsAndHTML),typeof o){case"function":log(`running ${c[t]}({article:${u.article}, hint:${u.hint}, oldid: ${u.oldid}})`),s(o(u),c[t],e.navpopup.idNumber);break;case"string":s(o,c[t],e.navpopup.idNumber);break;default:errlog(`unknown thing with label ${c[t]} (span index was ${t})`)}}}function flatten(e,t){let i=t;const n=[];void 0===i&&(i=0);for(let t=i;t<e.length;++t){if("object"==typeof e[t])return n.concat(flatten(e[t])).concat(flatten(e,t+1));n.push(e[t])}return n}function popupHTML(e){getValueOf("popupStructure");const i=t.structures[t.option.popupStructure];return"object"!=typeof i?(t.option.popupStructure=t.optionDefault.popupStructure,popupHTML(e)):"function"!=typeof i.popupLayout?"Bad layout":(t.misc.layout=i.popupLayout(),"function"==typeof i.popupRedirSpans?t.misc.redirSpans=i.popupRedirSpans():t.misc.redirSpans=[],makeEmptySpans(t.misc.layout,e.navpopup))}function makeEmptySpans(e,t){let i="";for(let n=0;n<e.length;++n)"string"==typeof e[n]?i+=emptySpanHTML(e[n],t.idNumber,"div"):"object"==typeof e[n]&&e[n].length>0?i=i.parenSplit(RegExp("(</[^>]*?>$)")).join(makeEmptySpans(e[n],t)):"object"==typeof e[n]&&e[n].nodeType&&(i+=emptySpanHTML(e[n].name,t.idNumber,e[n].nodeType));return i}function emptySpanHTML(e,t,i,n){let o=n;const s=i||"span";return o||(o=emptySpanHTML.classAliases[e]),o||(o=e),e===getValueOf("popupDragHandle")&&(o+=" popupDragHandle"),simplePrintf('<%s id="%s" class="%s"></%s>',[s,e+t,o,s])}function popTipsSoonFn(e,t,i){let n=t;n||(n=250);const popTips=function(){setupTooltips(document.getElementById(e),!1,!0,i)};return function(){setTimeout(popTips,n,i)}}function setPopupTipsAndHTML(e,t,i,n){setPopupHTML(e,t,i,getValueOf("popupSubpopups")?popTipsSoonFn(t+i,null,n):null)}function checkPopupPosition(){t.current.link&&t.current.link.navpopup&&t.current.link.navpopup.limitHorizontalPosition()}function mouseOutWikiLink(){const e=this;removeModifierKeyHandler(e),null!==e.navpopup&&void 0!==e.navpopup&&(e.navpopup.isVisible()?(restoreTitle(e),Navpopup.tracker.addHook(posCheckerHook(e.navpopup))):e.navpopup.banish())}function posCheckerHook(e){return function(){if(!e.isVisible())return!0;if(Navpopup.tracker.dirty)return!1;const t=Navpopup.tracker.x,i=Navpopup.tracker.y,n=e.isWithin(t,i,e.fuzz,e.mainDiv)||!function fuzzyCursorOffMenus(e,t,i,n){if(!n)return null;const o=n.getElementsByTagName("ul");for(let e=0;e<o.length;++e)if("popup_menu"===o[e].className&&o[e].offsetWidth>0)return!1;return!0}(0,0,e.fuzz,e.mainDiv);let o=getValueOf("popupHideDelay");if(o&&(o*=1e3),!o)return!n&&(e.parentAnchor&&restoreTitle(e.parentAnchor),e.banish(),!0);const s=+new Date;return e.mouseLeavingTime?n?(e.mouseLeavingTime=null,!1):s-e.mouseLeavingTime>o&&(e.mouseLeavingTime=null,e.banish(),!0):(e.mouseLeavingTime=s,!1)}}function loadAPIPreview(e,i,n){const o=new Title(i).urlString();let s=`${t.wiki.apiwikibase}?format=json&formatversion=2&action=query&`,htmlGenerator=function(){alert("invalid html generator")},r="";switch(e){case"history":s+=`titles=${o}&prop=revisions&rvlimit=${getValueOf("popupHistoryPreviewLimit")}`,htmlGenerator=APIhistoryPreviewHTML;break;case"category":s+=`list=categorymembers&cmtitle=${o}`,htmlGenerator=APIcategoryPreviewHTML;break;case"userinfo":{const e=new Title(i).userName();r=encodeURIComponent(e),t.re.ipUser.test(e)?s+=`list=blocks&bkprop=range|restrictions&bkip=${r}`:s+=`list=users|usercontribs&usprop=blockinfo|groups|editcount|registration|gender&ususers=${r}&meta=globaluserinfo&guiprop=groups|unattached&guiuser=${r}&uclimit=1&ucprop=timestamp&ucuser=${r}`,htmlGenerator=APIuserInfoPreviewHTML;break}case"contribs":r=encodeURIComponent(new Title(i).userName()),s+=`list=usercontribs&ucuser=${r}&uclimit=${getValueOf("popupContribsPreviewLimit")}`,htmlGenerator=APIcontribsPreviewHTML;break;case"imagepagepreview":{let e="";getValueOf("popupImageLinks")&&(e=`&list=imageusage&iutitle=${o}`),s+=`titles=${o}&prop=revisions|imageinfo&rvprop=content${e}`,htmlGenerator=APIimagepagePreviewHTML;break}case"backlinks":s+=`list=backlinks&bltitle=${o}`,htmlGenerator=APIbacklinksPreviewHTML;break;case"revision":i.oldid?s+=`revids=${i.oldid}`:s+=`titles=${i.removeAnchor().urlString()}`,s+="&prop=revisions|pageprops|info|images|categories&rvprop=ids|timestamp|comment|user|content&cllimit=max&imlimit=max",htmlGenerator=APIrevisionPreviewHTML}pendingNavpopTask(n);const callback=async t=>{if(log("callback of API functions was hit"),"userinfo"===e)return await function fetchUserGroupNames(e){const t=getJsObj(e).query,i=anyChild(t.users),n=[];return i.groups&&i.groups.forEach(e=>{n.push(`group-${e}-member`)}),t.globaluserinfo&&t.globaluserinfo.groups&&t.globaluserinfo.groups.forEach(e=>{
n.push(`group-${e}-member`)}),getMwApi().loadMessagesIfMissing(n)}(t.data),void showAPIPreview(e,htmlGenerator(i,t,n),n.idNumber,n,t);showAPIPreview(e,htmlGenerator(i,t,n),n.idNumber,n,t)},go=function(){return getPageWithCaching(s,callback,n),!0};n.visible||!getValueOf("popupLazyDownloads")?go():n.addHook(go,"unhide","before",`DOWNLOAD_${e}_QUERY_DATA`)}function linkList(e){e.sort((e,t)=>e===t?0:e<t?-1:1);const t=[];for(let i=0;i<e.length;++i)t.push(wikiLink({article:new Title(e[i]),text:e[i].split(" ").join("&nbsp;"),action:"view"}));return t.join(popupString("separator"))}function getTimeOffset(){const e=mw.user.options.get("timecorrection");return e&&e.indexOf("|")>-1?parseInt(e.split("|")[1],10):0}function getTimeZone(){if(!t.user.timeZone){const e=mw.user.options.get("timecorrection");if(t.user.timeZone="UTC",e){const i=e.split("|");3===i.length&&"ZoneInfo"===i[0]?t.user.timeZone=i[2]:errlog(`Unexpected timezone information: ${e}`)}}return t.user.timeZone}function useTimeOffset(){if(void 0===Intl.DateTimeFormat.prototype.formatToParts)return!0;const e=mw.user.options.get("timecorrection");return!(!e||-1!==e.indexOf("ZoneInfo|"))}function getLocales(){if(!t.user.locales){let e=document.querySelector("html").getAttribute("lang");getValueOf("popupLocale")?e=getValueOf("popupLocale"):"en"===e&&(e="mdy"===getMWDateFormat()?"en-US":"en-GB"),t.user.locales=Intl.DateTimeFormat.supportedLocalesOf([e,navigator.language])}return t.user.locales}function getMWDateFormat(){return mw.user.options.get("date")}function adjustDate(e,t){return new Date(+e+60*t*1e3)}function convertTimeZone(e,t){return new Date(e.toLocaleString("en-US",{timeZone:t}))}function formattedDate(e){if(useTimeOffset()){const t=adjustDate(e,getTimeOffset());return map(zeroFill,[t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate()]).join("-")}if("ISO 8601"===getMWDateFormat()){const t=convertTimeZone(e,getTimeZone());return map(zeroFill,[t.getFullYear(),t.getMonth()+1,t.getDate()]).join("-")}const t=getValueOf("popupDateFormatterOptions");return t.timeZone=getTimeZone(),e.toLocaleDateString(getLocales(),t)}function formattedTime(e){if(useTimeOffset()){const t=adjustDate(e,getTimeOffset());return map(zeroFill,[t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds()]).join(":")}if("ISO 8601"===getMWDateFormat()){const t=convertTimeZone(e,getTimeZone());return map(zeroFill,[t.getHours(),t.getMinutes(),t.getSeconds()]).join(":")}const t=getValueOf("popupTimeFormatterOptions");return t.timeZone=getTimeZone(),e.toLocaleTimeString(getLocales(),t)}function showAPIPreview(e,i,n,o,s){let r="popupPreview";switch(completedNavpopTask(o),e){case"imagelinks":case"category":r="popupPostPreview";break;case"userinfo":r="popupUserData";break;case"revision":return void function insertPreview(e){if(!e.owner)return;const i=t.re.redirect.exec(e.data);if(0===e.owner.redir&&i)!function loadPreviewFromRedir(e,t){const i=(new Title).fromWikiText(e[2]);t.article.anchor&&(i.anchor=t.article.anchor),t.redir++,t.redirTarget=i;const n=function redirLink(e,t){let i="";return getValueOf("popupAppendRedirNavLinks")&&getValueOf("popupNavLinks")?(i+="<hr />",getValueOf("popupFixRedirs")&&autoEdit?(i+=popupString("Redirects to: (Fix "),log(`redirLink: newTarget=${e}`),i+=addPopupShortcut(changeLinkTargetLink({newTarget:e,text:popupString("target"),hint:popupString("Fix this redirect, changing just the link target"),summary:simplePrintf(getValueOf("popupFixRedirsSummary"),[t.toString(),e]),oldTarget:t.toString(),clickButton:getValueOf("popupRedirAutoClick"),minor:!0,watch:getValueOf("popupWatchRedirredPages")}),"R"),i+=popupString(" or "),i+=addPopupShortcut(changeLinkTargetLink({newTarget:e,text:popupString("target & label"),hint:popupString("Fix this redirect, changing the link target and label"),summary:simplePrintf(getValueOf("popupFixRedirsSummary"),[t.toString(),e]),oldTarget:t.toString(),clickButton:getValueOf("popupRedirAutoClick"),minor:!0,watch:getValueOf("popupWatchRedirredPages"),alsoChangeLabel:!0}),"R"),i+=popupString(")")):i+=popupString("Redirects")+popupString(" to "),i):`<br> ${popupString("Redirects")}${popupString(" to ")}${titledWikiLink({article:(new Title).fromWikiText(e),action:"view",text:safeDecodeURI(e),title:popupString("Bypass redirect")})}`}(i,t.article);setPopupHTML(n,"popupWarnRedir",t.idNumber),t.article=i,fillEmptySpans({redir:!0,redirTarget:i,navpopup:t}),loadPreview(i,null,t)}(i,e.owner);else if(e.owner.visible||!getValueOf("popupLazyPreviews"))insertPreviewNow(e);else{const t=e.owner.redir?"PREVIEW_REDIR_HOOK":"PREVIEW_HOOK";e.owner.addHook(()=>(insertPreviewNow(e),!0),"unhide","after",t)}}(s)}setPopupTipsAndHTML(i,r,n)}function APIrevisionPreviewHTML(e,t){try{const e=anyChild(getJsObj(t.data).query.pages);if(e.missing)return void(t.owner=null);const i=e&&e.revisions&&"wikitext"===e.revisions[0].contentmodel?e.revisions[0].content:null;"string"==typeof i&&(t.data=i,t.lastModified=new Date(e.revisions[0].timestamp))}catch(e){return"Revision preview failed :("}}function APIbacklinksPreviewHTML(e,i){try{const e=getJsObj(i.data),n=e.query.backlinks;let o=[];if(!n)return popupString("No backlinks found");for(let e=0;e<n.length;e++){const i=new Title(n[e].title);o.push(`<a href="${t.wiki.titlebase}${i.urlString()}">${i.toString().entify()}</a>`)}return o=o.join(popupString("separator")),e.continue&&e.continue.blcontinue&&(o+=popupString(" and more")),o}catch(e){return"backlinksPreviewHTML went wonky"}}function APIimagepagePreviewHTML(e,i,n){try{const o=anyChild(getJsObj(i.data).query.pages),s=o&&o.revisions&&"wikitext"===o.revisions[0].contentmodel?o.revisions[0].content:null;let r="",p="";try{p=n.parentAnchor.childNodes[0].alt}catch{}if(p&&(r=`${r}<hr /><b>${popupString("Alt text:")}</b> ${t.escapeQuotesHTML(p)}`),"string"==typeof s){const t=prepPreviewmaker(s,e,n);if(t.makePreview(),t.html&&(r+=`<hr />${t.html}`),getValueOf("popupSummaryData")){const e=getPageInfo(s,i);log(e),setPopupTrailer(e,n.idNumber)}}if(o&&"shared"===o.imagerepository){const i=new Title(e),o=encodeURIComponent(`File:${i.stripNamespace()}`),s=`${t.wiki.apicommonsbase}?format=json&formatversion=2&callback=pg.fn.APIsharedImagePagePreviewHTML&requestid=${n.idNumber}&action=query&prop=revisions&rvprop=content&titles=${o}`;r=`${r}<hr />${popupString("Image from Commons")}: <a href="${t.wiki.commonsbase}?title=${o}">${popupString("Description page")}</a>`,mw.loader.load(s)}return showAPIPreview("imagelinks",function APIimagelinksPreviewHTML(e,t){try{const e=getJsObj(t.data).query.imageusage;if(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].title);return 0===t.length?popupString("No image links found"):`<h2>${popupString("File links")}</h2>${linkList(t)}`}return popupString("No image links found")}catch(e){return"Image links preview generation failed :("}}(0,i),n.idNumber,i),r}catch(e){return"API imagepage preview failed :("}}function APIcategoryPreviewHTML(e,t){try{const e=getJsObj(t.data),i=e.query.categorymembers;let n=[];for(let e=0;e<i.length;e++)n.push(i[e].title);return 0===n.length?popupString("Empty category"):(n=`<h2>${tprintf("Category members (%s shown)",[n.length])}</h2>${linkList(n)}`,e.continue&&e.continue.cmcontinue&&(n+=popupString(" and more")),n)}catch(e){return"Category preview failed :("}}function APIuserInfoPreviewHTML(e,i){let n=[],o={};try{o=getJsObj(i.data).query}catch(e){return"Userinfo preview failed :("}const s=anyChild(o.users);if(s){const e=o.globaluserinfo;if(""===s.invalid?n.push(popupString("Invalid user")):""===s.missing&&n.push(popupString("Not a registered username")),s.blockedby&&(s.blockpartial?n.push(`<b>${popupString("Has blocks")}</b>`):n.push(`<b>${popupString("BLOCKED")}</b>`)),e&&(Reflect.has(e,"locked")||Reflect.has(e,"hidden"))){let t=!0;for(let i=0;e.unattached&&i<e.unattached.length;i++)if(e.unattached[i].wiki===mw.config.get("wgDBname")){t=!1;break}t&&(Reflect.has(e,"locked")&&n.push(`<b><i>${popupString("LOCKED")}</i></b>`),Reflect.has(e,"hidden")&&n.push(`<b><i>${popupString("HIDDEN")}</i></b>`))}if(getValueOf("popupShowGender")&&s.gender)switch(s.gender){case"male":n.push(popupString("♂"));break;case"female":n.push(popupString("♀"))}if(s.groups){const e=[];s.groups.forEach(i=>{-1===["*","user","autoconfirmed"].indexOf(i)&&e.push(t.escapeQuotesHTML(mw.message(`group-${i}-member`,s.gender).text()))}),-1===s.groups.indexOf("autoconfirmed")&&e.push(`<b>${t.escapeQuotesHTML(popupString("group-no-autoconfirmed"))}</b>`),0===e.length&&e.push(t.escapeQuotesHTML(mw.message("group-user-member",s.gender).text())),n.push(e.join(popupString("separator")))}if(e&&e.groups){const i=[];e.groups.forEach(e=>{i.push(`<i>${t.escapeQuotesHTML(mw.message(`group-${e}-member`,s.gender).text())}</i>`)}),n.push(i.join(popupString("separator")))}s.registration&&n.push(t.escapeQuotesHTML((s.editcount?s.editcount:"0")+popupString(" edits since: ")+(s.registration?formattedDate(new Date(s.registration)):"")))}if(o.usercontribs&&o.usercontribs.length&&n.push(popupString("last edit on ")+formattedDate(new Date(o.usercontribs[0].timestamp))),o.blocks){n.push(popupString("IP user"));for(let e=0;e<o.blocks.length;e++){let t=o.blocks[e].rangestart===o.blocks[e].rangeend?"BLOCK":"RANGEBLOCK";t=Array.isArray(o.blocks[e].restrictions)?`${t}ED`:`Has ${t.toLowerCase()}s`,n.push(`<b>${popupString(t)}</b>`)}}return n=`<hr />${n.join(popupString("comma"))}`,n}function APIcontribsPreviewHTML(e,t,i){return APIhistoryPreviewHTML(e,t,0,!0)}function APIhistoryPreviewHTML(e,i,n,o){try{const n=getJsObj(i.data);let s=[];s=o?n.query.usercontribs:anyChild(n.query.pages).revisions;const r=function editPreviewTable(e,i,n){let o,s=["<table>"],r=null,p=e,a=null;if(n)o=function(e){let i="(";return i+=`<a href="${t.wiki.titlebase}${new Title(e.title).urlString()}&diff=prev&oldid=${e.revid}">${popupString("diff")}</a>`,i+="&nbsp;|&nbsp;",i+=`<a href="${t.wiki.titlebase}${new Title(e.title).urlString()}&action=history">${popupString("hist")}</a>`,i+=")",i};else{const e=i[0].revid;o=function(i){let n="(";return n+=`<a href="${t.wiki.titlebase}${new Title(p).urlString()}&diff=${e}&oldid=${i.revid}">${popupString("cur")}</a>`,n+="&nbsp;|&nbsp;",
n+=`<a href="${t.wiki.titlebase}${new Title(p).urlString()}&diff=prev&oldid=${i.revid}">${popupString("last")}</a>`,n+=")",n}}for(let e=0;e<i.length;++e){n&&(a=i[e].title,p=new Title(a));const u=i[e].minor?"<b>小 </b>":"",l=new Date(i[e].timestamp);let c=formattedDate(l);const g=formattedTime(l);c===r?c="":r=c,c&&s.push(`<tr><td colspan=3><span class="popup_history_date">${c}</span></td></tr>`),s.push(`<tr class="popup_history_row_${e%2?"odd":"even"}">`),s.push(`<td>${o(i[e])}</td>`),s.push(`<td><a href="${t.wiki.titlebase}${new Title(p).urlString()}&oldid=${i[e].revid}">${g}</a></td>`);let d="",h="";if(n)d=t.wiki.titlebase+p.urlString(),h=t.escapeQuotesHTML(a);else{const n=i[e].user;i[e].userhidden?(d=getValueOf("popupRevDelUrl"),h=t.escapeQuotesHTML(popupString("revdel"))):(d=t.re.ipUser.test(n)?`${t.wiki.titlebase+mw.config.get("wgFormattedNamespaces")[t.nsSpecialId]}:Contributions&target=${new Title(n).urlString()}`:`${t.wiki.titlebase+mw.config.get("wgFormattedNamespaces")[t.nsUserId]}:${new Title(n).urlString()}`,h=t.escapeQuotesHTML(n))}s.push(`<td>${n?u:""}<a href="${d}">${h}</a></td>`);let m="";const w=i[e].comment||(void 0!==i[e].slots?i[e].slots.main.content:null);w?m=new Previewmaker(w,new Title(p).toUrl()).editSummaryPreview():i[e].commenthidden&&(m=popupString("revdel")),s.push(`<td>${n?"":u}${m}</td>`),s.push("</tr>"),s=[s.join("")]}return s.push("</table>"),s.join("")}(e,s,o);return r}catch(e){return"History preview failed :-("}}function loadImage(e,i){if("function"!=typeof e.stripNamespace&&alert("loadImages bad"),!getValueOf("popupImages"))return;if(!isValidImageName(e))return!1;const n=e.urlString();let o=`${t.wiki.apiwikibase}?format=json&formatversion=2&action=query`;o+=`&prop=imageinfo&iiprop=url|mime&iiurlwidth=${getValueOf("popupImageSizeLarge")}`,o+=`&titles=${n}`,pendingNavpopTask(i);const callback=function(e){!function popupsInsertImage(e,i,n){let o;log("popupsInsertImage");try{const e=anyChild(getJsObj(n.data).query.pages);if(void 0===e.imageinfo)return;o=e.imageinfo[0]}catch(e){return void log("popupsInsertImage failed :(")}const s=document.getElementById(`popupImg${e}`);if(!s)return void log("could not find insertion point for image");s.width=getValueOf("popupImageSize"),s.style.display="inline",o.thumburl?s.src=o.thumburl:0===o.mime.indexOf("image")?(s.src=o.url,log("a thumb could not be found, using original image")):log("fullsize imagethumb, but not sure if it's an image");const r=document.getElementById(`popupImageLink${e}`);if(null===r)return null;switch(getValueOf("popupThumbAction")){case"imagepage":if(t.current.article.namespaceId()!==t.nsImageId){r.href=o.descriptionurl,popTipsSoonFn(`popupImage${e}`)();break}case"sizetoggle":return r.onclick=toggleSize,void(r.title=popupString("Toggle image size"));case"linkfull":r.href=o.url,r.title=popupString("Open full-size image")}}(i.idNumber,0,e)},go=function(){return getPageWithCaching(o,callback,i),!0};i.visible||!getValueOf("popupLazyDownloads")?go():i.addHook(go,"unhide","after","DOWNLOAD_IMAGE_QUERY_DATA")}function toggleSize(){if(!this)return void alert("imgContainer is null :/");const e=this.firstChild;e?e.style.width&&""!==e.style.width?e.style.width="":e.style.width="100%":alert("img is null :/")}function nsRe(e){const t=[];return jQuery.each(mw.config.get("wgNamespaceIds"),(i,n)=>{const o=upcaseFirst(i);n===e&&(t.push(mw.util.escapeRegExp(o).split(" ").join("[ _]")),t.push(mw.util.escapeRegExp(encodeURI(o))))}),`(?:${t.join("|")})`}function doSelectionPopup(){const e=function getEditboxSelection(){let e;try{e=document.editform.wpTextbox1}catch(e){return}if(document.selection)return document.selection.createRange().text;const t=e.selectionStart,i=e.selectionEnd;return e.value.substring(t,i)}(),i=e.indexOf("[["),n=e.indexOf("|"),o=e.indexOf("]]");if(-1===i||-1===n&&-1===o)return;if(-1!==n&&i>n||-1!==o&&i>o)return;const s=new Title(e.substring(i+2,n<0?o:n));if("boxpreview"===getValueOf("popupOnEditSelection"))return function doSeparateSelectionPopup(e){let t=document.getElementById("selectionPreview");if(!t){t=document.createElement("div"),t.id="selectionPreview";try{const e=document.editform.wpTextbox1;e.parentNode.insertBefore(t,e)}catch(e){return}}t.innerHTML=wiki2html(e),t.ranSetupTooltipsAlready=!1,popTipsSoonFn("selectionPreview")()}(e);if(o>0&&e.substring(o+2).indexOf("[[")>=0)return;const r=document.createElement("a");r.href=t.wiki.titlebase+s.urlString(),mouseOverWikiLink2(r),r.navpopup&&r.navpopup.addHook(()=>{!function runStopPopupTimer(e){e.stopPopupTimer||(e.stopPopupTimer=setInterval(posCheckerHook(e),500),e.addHook(()=>{clearInterval(e.stopPopupTimer)},"hide","before"))}(r.navpopup)},"unhide","after")}function delFmt(e){return e.length?`<del class='popupDiff'>${e.join("")}</del>`:""}function insFmt(e){return e.length?`<ins class='popupDiff'>${e.join("")}</ins>`:""}function countCrossings(e,t,i,n){if(!t[i].row&&0!==t[i].row)return-1;let o=0;for(let s=0;s<e.length;++s)if((e[s].row||0===e[s].row)&&(s-t[i].row)*(i-e[s].row)>0){if(n)return!0;o++}return o}function diffBugAlert(e){diffBugAlert.list[e]||(diffBugAlert.list[e]=1,alert(`Bad word: ${e}\n\nPlease report this bug.`))}function makeDiffHashtable(e){const t={};for(let i=0;i<e.length;i++){n.test(e[i])&&(e[i]+="\x3c!-- --\x3e"),t[e[i]]||(t[e[i]]=[]);try{t[e[i]].push(i)}catch(t){diffBugAlert(e[i])}}return t}function diff(e,t){const i=makeDiffHashtable(t),n=makeDiffHashtable(e);let o;for(o in i)1===i[o].length&&n[o]&&1===n[o].length&&(t[i[o][0]]={text:t[i[o][0]],row:n[o][0],paired:!0},e[n[o][0]]={text:e[n[o][0]],row:i[o][0],paired:!0});for(o=0;o<t.length-1;o++)t[o].paired&&!t[o+1].paired&&t[o].row+1<e.length&&!e[t[o].row+1].paired&&t[o+1]===e[t[o].row+1]&&(t[o+1]={text:t[o+1],row:t[o].row+1,paired:!0},e[t[o].row+1]={text:e[t[o].row+1],row:o+1,paired:!0});for(o=t.length-1;o>0;o--)t[o].paired&&!t[o-1].paired&&t[o].row>0&&!e[t[o].row-1].paired&&t[o-1]===e[t[o].row-1]&&(t[o-1]={text:t[o-1],row:t[o].row-1,paired:!0},e[t[o].row-1]={text:e[t[o].row-1],row:o-1,paired:!0});return{o:e,n:t}}function buildSpecialPageGroup(e){const t=[];return t.push(mw.util.escapeRegExp(e.realname)),t.push(mw.util.escapeRegExp(encodeURI(e.realname))),e.aliases.forEach(e=>{t.push(mw.util.escapeRegExp(e)),t.push(mw.util.escapeRegExp(encodeURI(e)))}),t.join("|")}function setupCache(){t.cache.pages=[]}function getMwApi(){return t.api.client||(t.api.userAgent=`Navigation popups/1.0 (${mw.config.get("wgServerName")})`,t.api.client=new mw.Api({ajax:{headers:{"Api-User-Agent":t.api.userAgent}}})),t.api.client}async function setupPopups(e){setupPopups.completed||(await async function fetchSpecialPageNames(){const e=await getMwApi().get({action:"query",meta:"siteinfo",siprop:"specialpagealiases",formatversion:2,uselang:"content",maxage:3600});t.wiki.specialpagealiases=e.query.specialpagealiases}(),function setupDebugging(){log("Initializing logger")}(),function setSiteInfo(){window.popupLocalDebug?t.wiki.hostname="en.wikipedia.org":t.wiki.hostname=location.hostname,t.wiki.wikimedia=RegExp("(wiki([pm]edia|source|books|news|quote|versity|species|voyage|data)|metawiki|wiktionary|mediawiki)[.]org").test(t.wiki.hostname),t.wiki.wikia=RegExp("[.]wikia[.]com$","i").test(t.wiki.hostname),t.wiki.isLocal=RegExp("^localhost").test(t.wiki.hostname),t.wiki.commons=t.wiki.wikimedia&&"commons.wikimedia.org"!==t.wiki.hostname?"commons.wikimedia.org":null,t.wiki.lang=mw.config.get("wgContentLanguage");const e=location.port?`:${location.port}`:"";t.wiki.sitebase=t.wiki.hostname+e}(),function setTitleBase(){const e=window.popupLocalDebug?"http:":location.protocol;t.wiki.articlePath=mw.config.get("wgArticlePath").replace(/\/\$1/,""),t.wiki.botInterfacePath=mw.config.get("wgScript"),t.wiki.APIPath=`${mw.config.get("wgScriptPath")}/api.php`;const i=`${t.wiki.botInterfacePath}?title=`;t.wiki.titlebase=`${e}//${t.wiki.sitebase}${i}`,t.wiki.wikibase=`${e}//${t.wiki.sitebase}${t.wiki.botInterfacePath}`,t.wiki.apiwikibase=`${e}//${t.wiki.sitebase}${t.wiki.APIPath}`,t.wiki.articlebase=`${e}//${t.wiki.sitebase}${t.wiki.articlePath}`,t.wiki.commonsbase=`${e}//${t.wiki.commons}${t.wiki.botInterfacePath}`,t.wiki.apicommonsbase=`${e}//${t.wiki.commons}${t.wiki.APIPath}`,t.re.basenames=RegExp(`^(${map(literalizeRegex,[t.wiki.titlebase,t.wiki.articlebase]).join("|")})`)}(),function setOptions(){let e=!1;if(mw.config.get("wgUserGroups"))for(let t=0;t<mw.config.get("wgUserGroups").length;++t)"sysop"===mw.config.get("wgUserGroups")[t]&&(e=!0);newOption("popupDelay",.5),newOption("popupHideDelay",.5),newOption("simplePopups",!1),newOption("popupStructure","shortmenus"),newOption("popupActionsMenu",!0),newOption("popupSetupMenu",!0),newOption("popupAdminLinks",e),newOption("popupShortcutKeys",!1),newOption("popupHistoricalLinks",!0),newOption("popupOnlyArticleLinks",!0),newOption("removeTitles",!0),newOption("popupMaxWidth",350),newOption("popupSimplifyMainLink",!0),newOption("popupAppendRedirNavLinks",!0),newOption("popupTocLinks",!1),newOption("popupSubpopups",!0),newOption("popupDragHandle",!1),newOption("popupLazyPreviews",!0),newOption("popupLazyDownloads",!0),newOption("popupAllDabsStubs",!1),newOption("popupDebugging",!1),newOption("popupActiveNavlinks",!0),newOption("popupModifier",!1),newOption("popupModifierAction","enable"),newOption("popupDraggable",!0),newOption("popupReview",!1),newOption("popupLocale",!1),newOption("popupDateTimeFormatterOptions",{year:"numeric",month:"2-digit",day:"2-digit",hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),newOption("popupDateFormatterOptions",{year:"numeric",month:"2-digit",day:"2-digit"}),newOption("popupTimeFormatterOptions",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),newOption("popupImages",!0),newOption("imagePopupsForImages",!0),newOption("popupNeverGetThumbs",!1),newOption("popupThumbAction","imagepage"),newOption("popupImageSize",60),newOption("popupImageSizeLarge",200),newOption("popupFixRedirs",!1),newOption("popupRedirAutoClick","wpDiff"),newOption("popupFixDabs",!1),newOption("popupDabsAutoClick","wpDiff"),newOption("popupRevertSummaryPrompt",!1),newOption("popupMinorReverts",!1),newOption("popupRedlinkRemoval",!1),newOption("popupRedlinkAutoClick","wpDiff"),
newOption("popupWatchDisambiggedPages",null),newOption("popupWatchRedirredPages",null),newOption("popupDabWiktionary","last"),newOption("popupNavLinks",!0),newOption("popupNavLinkSeparator"," &sdot; "),newOption("popupLastEditLink",!0),newOption("popupEditCounterTool","supercount"),newOption("popupEditCounterUrl",""),newOption("popupPreviews",!0),newOption("popupSummaryData",!0),newOption("popupMaxPreviewSentences",5),newOption("popupMaxPreviewCharacters",600),newOption("popupLastModified",!0),newOption("popupPreviewKillTemplates",!0),newOption("popupPreviewRawTemplates",!0),newOption("popupPreviewFirstParOnly",!0),newOption("popupPreviewCutHeadings",!0),newOption("popupPreviewButton",!1),newOption("popupPreviewButtonEvent","click"),newOption("popupPreviewDiffs",!0),newOption("popupDiffMaxLines",100),newOption("popupDiffContextLines",2),newOption("popupDiffContextCharacters",40),newOption("popupDiffDates",!0),newOption("popupDiffDatePrinter","toLocaleString"),newOption("popupReviewedSummary",popupString("defaultpopupReviewedSummary")),newOption("popupFixDabsSummary",popupString("defaultpopupFixDabsSummary")),newOption("popupExtendedRevertSummary",popupString("defaultpopupExtendedRevertSummary")),newOption("popupRevertSummary",popupString("defaultpopupRevertSummary")),newOption("popupRevertToPreviousSummary",popupString("defaultpopupRevertToPreviousSummary")),newOption("popupQueriedRevertSummary",popupString("defaultpopupQueriedRevertSummary")),newOption("popupQueriedRevertToPreviousSummary",popupString("defaultpopupQueriedRevertToPreviousSummary")),newOption("popupFixRedirsSummary",popupString("defaultpopupFixRedirsSummary")),newOption("popupRedlinkSummary",popupString("defaultpopupRedlinkSummary")),newOption("popupRmDabLinkSummary",popupString("defaultpopupRmDabLinkSummary")),newOption("popupHistoryLimit",50),newOption("popupFilters",[popupFilterStubDetect,popupFilterDisambigDetect,popupFilterPageSize,popupFilterCountLinks,popupFilterCountImages,popupFilterCountCategories,popupFilterLastModified]),newOption("extraPopupFilters",[]),newOption("popupOnEditSelection","cursor"),newOption("popupPreviewHistory",!0),newOption("popupImageLinks",!0),newOption("popupCategoryMembers",!0),newOption("popupUserInfo",!0),newOption("popupHistoryPreviewLimit",25),newOption("popupContribsPreviewLimit",25),newOption("popupRevDelUrl","//en.wikipedia.org/wiki/Wikipedia:Revision_deletion"),newOption("popupShowGender",!0),newOption("popupNewWindows",!1),newOption("popupLinksNewWindow",{lastContrib:!0,sinceMe:!0}),newOption("popupDabRegexp","\\{\\{\\s*(d(ab|isamb(ig(uation)?)?)|(((geo|hn|road?|school|number)dis)|[234][lc][acw]|(road|ship)index))\\s*(\\|[^}]*)?\\}\\}|is a .*disambiguation.*page"),newOption("popupAnchorRegexp","anchors?"),newOption("popupStubRegexp","(sect)?stub[}][}]|This .*-related article is a .*stub"),newOption("popupImageVarsRegexp","image|image_(?:file|skyline|name|flag|seal)|cover|badge|logo")}(),async function setUserInfo(){const e={action:"query",list:"users",ususers:mw.config.get("wgUserName"),usprop:"rights"};if(t.user.canReview=!1,getValueOf("popupReview")){const i=(await getMwApi().get(e)).query.users[0].rights;t.user.canReview=-1!==i.indexOf("review")}}(),function setNamespaces(){t.nsSpecialId=-1,t.nsMainspaceId=0,t.nsImageId=6,t.nsUserId=2,t.nsUsertalkId=3,t.nsCategoryId=14,t.nsTemplateId=10}(),function setInterwiki(){"zh"===t.wiki.lang?t.wiki.interwiki="en|ja":"en"===t.wiki.lang?t.wiki.interwiki="zh|ja":"ja"===t.wiki.lang&&(t.wiki.interwiki="zh|en"),t.re.interwiki=RegExp(`^${t.wiki.interwiki}:`)}(),function setRegexps(){!function setMainRegex(){let e=`${literalizeRegex(mw.config.get("wgScriptPath"))}/(?:index[.]php|wiki[.]phtml)[?]title=`;e+=`|${literalizeRegex(`${t.wiki.articlePath}/`)}`;const i=`(${e})([^&?#]*)[^#]*(?:#(.+))?`;t.re.main=RegExp("[^:]*://"+literalizeRegex(t.wiki.sitebase)+i)}();const e=nsRe(t.nsSpecialId);t.re.urlNoPopup=RegExp(`((title=|/)${e}(?:%3A|:)|section=[0-9]|^#$)`),t.wiki.specialpagealiases.forEach(i=>{"Contributions"===i.realname?t.re.contribs=RegExp(`(title=|/)${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})(&target=|/|/${nsRe(t.nsUserId)}:)(.*)`,"i"):"Diff"===i.realname?t.re.specialdiff=RegExp(`/${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})/([^?#]*)`,"i"):"Emailuser"===i.realname?t.re.email=RegExp(`(title=|/)${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})(&target=|/|/(?:${nsRe(t.nsUserId)}:)?)(.*)`,"i"):"Whatlinkshere"===i.realname&&(t.re.backlinks=RegExp(`(title=|/)${e}(?:%3A|:)(?:${buildSpecialPageGroup(i)})(&target=|/)([^&]*)`,"i"))});const i=function nsReImage(){return nsRe(t.nsImageId)}();t.re.image=RegExp(`(^|\\[\\[)${i}: *([^|\\]]*[^|\\] ])([^0-9\\]]*([0-9]+) *px)?|(?:\\n *[|]?|[|]) *(${getValueOf("popupImageVarsRegexp")}) *= *(?:\\[\\[ *)?(?:${i}:)?([^|]*?)(?:\\]\\])? *[|]? *\\n`,"img"),t.re.imageBracketCount=6,t.re.category=RegExp(`\\[\\[${nsRe(t.nsCategoryId)}: *([^|\\]]*[^|\\] ]) *`,"i"),t.re.categoryBracketCount=1,t.re.ipUser=RegExp("^(?::(?::|(?::[0-9A-Fa-f]{1,4}){1,7})|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6}::|[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){7})|(((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))$"),t.re.stub=RegExp(getValueOf("popupStubRegexp"),"im"),t.re.disambig=RegExp(getValueOf("popupDabRegexp"),"im"),t.re.oldid=RegExp("[?&]oldid=([^&]*)"),t.re.diff=RegExp("[?&]diff=([^&]*)")}(),function setRedirs(){const e="redirect",i="REDIRECT",n={ar:[i,"تحويل"],be:[e,"перанакіраваньне"],bg:[e,"пренасочване","виж"],bs:[e,"Preusmjeri","preusmjeri","PREUSMJERI"],bn:[i,"পুনর্নির্দেশ"],cs:[i,"PŘESMĚRUJ"],cy:[e,"ail-cyfeirio"],de:[i,"WEITERLEITUNG"],el:[i,"ΑΝΑΚΑΤΕΥΘΥΝΣΗ"],eo:[i,"ALIDIREKTU","ALIDIREKTI"],es:[i,"REDIRECCIÓN"],et:[e,"suuna"],ga:[e,"athsheoladh"],gl:[e,"REDIRECCIÓN","REDIRECIONAMENTO"],he:[i,"הפניה"],hu:[i,"ÁTIRÁNYÍTÁS"],is:[e,"tilvísun","TILVÍSUN"],it:[i,"RINVIA","Rinvia"],ja:[i,"転送"],mk:[e,"пренасочување","види"],nds:[e,"wiederleiden"],"nds-nl":[i,"DEURVERWIEZING","DUURVERWIEZING"],nl:[i,"DOORVERWIJZING"],nn:[e,"omdiriger"],pl:[i,"PATRZ","PRZEKIERUJ","TAM"],pt:[i,"redir"],ru:[i,"ПЕРЕНАПРАВЛЕНИЕ","ПЕРЕНАПР"],sk:[e,"presmeruj"],sr:[e,"Преусмери","преусмери","ПРЕУСМЕРИ","Preusmeri","preusmeri","PREUSMERI"],tt:[i,"yünältü","перенаправление","перенапр"],uk:[i,"ПЕРЕНАПРАВЛЕННЯ","ПЕРЕНАПР"],vi:[e,"đổi"],yi:[i,"ווייטערפירן"],zh:[i,"重定向"]}[t.wiki.lang]||[e,i];t.re.redirect=RegExp(`^\\s*[#](${n.join("|")}).*?\\[{2}([^\\|\\]]*)(|[^\\]]*)?\\]{2}\\s*(.*)`,"i")}(),function setMisc(){t.current.link=null,t.current.links=[],t.current.linksHash={},setupCache(),t.timer.checkPopupPosition=null,t.counter.loop=0,t.idNumber=0,t.misc.decodeExtras=[{from:"%2C",to:","},{from:"_",to:" "},{from:"%24",to:"$"},{from:"%26",to:"&"}]}(),function setupLivePreview(){var e;i.conf={baseUrl:"",user:{},wiki:{lang:t.wiki.lang,interwiki:t.wiki.interwiki,default_thumb_width:180},paths:{articles:`${t.wiki.articlePath}/`,math:"/math/",images:"//upload.wikimedia.org/wikipedia/en/",images_fallback:"//upload.wikimedia.org/wikipedia/commons/"},locale:{user:mw.config.get("wgFormattedNamespaces")[t.nsUserId],image:mw.config.get("wgFormattedNamespaces")[t.nsImageId],category:mw.config.get("wgFormattedNamespaces")[t.nsCategoryId],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}},(e=i.conf.user).name||(e.name="Wikipedian"),i.conf.user.signature=`[[${i.conf.locale.user}:${i.conf.user.name}|${i.conf.user.name}]]`,i.BLOCK_IMAGE=new RegExp(`^\\[\\[(?:File|Image|${i.conf.locale.image}):.*?\\|.*?(?:frame|thumbnail|thumb|none|right|left|center)`,"i")}(),setupTooltips(),log("In setupPopups(), just called setupTooltips()"),Navpopup.tracker.enable(),setupPopups.completed=!0),"function"==typeof e&&e()}function expandConditionalNavlinkString(e,i,n,o){const s=n.oldid,r=n.rcid,p=n.diff;let a=o;"number"!=typeof a&&(a=0);const u=RegExp("(;?\\s*if\\s*\\(\\s*([\\w]*)\\s*\\)\\s*\\{([^{}]*)\\}(\\s*else\\s*\\{([^{}]*?)\\}|))","i"),l=e.parenSplit(u);let c=l[0];for(let e=1;e<l.length;e=e+5+1){const n=l[e+2-1],o=l[e+3-1];let a=l[e+5-1];void 0!==a&&a||(a="");let u=null;switch(n){case"user":u=!!i.userName();break;case"talk":u=!i.talkPage();break;case"admin":u=!!getValueOf("popupAdminLinks");break;case"oldid":u=!(void 0===s||!s);break;case"rcid":u=!(void 0===r||!r);break;case"ipuser":u=!!i.isIpUser();break;case"mainspace_en":u=isInMainNamespace(i)&&"en.wikipedia.org"===t.wiki.hostname;break;case"wikimedia":u=!!t.wiki.wikimedia;break;case"diff":u=!(void 0===p||!p)}switch(u){case null:c+=l[e];break;case!0:c+=o;break;case!1:c+=a}c+=l[e+5]}return u.test(c)&&a<10?expandConditionalNavlinkString(c,i,n,a+1):c}function navlinkStringToArray(e,t,i){const n=expandConditionalNavlinkString(e,t,i).parenSplit(RegExp("<<(.*?)>>")),o=[];for(let e=0;e<n.length;++e)if(e%2){const s=new NavlinkTag,r=n[e].split("|");s.id=r[0];for(let e=1;e<r.length;++e){const t=r[e].split("=");t.length>1?s[t[0]]=t[1]:s.text=popupString(t[0])}s.article=t;const p=i.oldid,a=i.rcid,u=i.diff;null!=p&&(s.oldid=p),null!=a&&(s.rcid=a),null!=u&&(s.diff=u),s.text||"mainlink"===s.id||(s.text=popupString(s.id)),o.push(s)}else o.push(n[e]);return o}function navlinkSubstituteHTML(e){return e.split("*").join(getValueOf("popupNavLinkSeparator")).split("<menurow>").join('<li class="popup_menu_row">').split("</menurow>").join("</li>").split("<menu>").join('<ul class="popup_menu">').split("</menu>").join("</ul>")}function navlinkDepth(e,t){return t.split(`<${e}>`).length-t.split(`</${e}>`).length}function navlinkStringToHTML(e,t,i){const n=navlinkStringToArray(e,t,i);let o="",s=0,r=0;for(let e=0;e<n.length;++e)"string"==typeof n[e]?(o+=navlinkSubstituteHTML(n[e]),s+=navlinkDepth("menu",n[e]),r+=navlinkDepth("menurow",n[e])):void 0!==n[e].type&&"navlinkTag"===n[e].type&&(o+=s>0&&0===r?`<li class="popup_menu_item">${n[e].html()}</li>`:n[e].html());return o}function popupHandleKeypress(e){const i=window.event?window.event.keyCode:e.keyCode?e.keyCode:e.which;if(!i||!t.current.link||!t.current.link.navpopup)return;if(27===i)return killPopup(),!1;const n=String.fromCharCode(i),o=t.current.link.navpopup.mainDiv.getElementsByTagName("A");let s,r,p=0
;if(popupHandleKeypress.lastPopupLinkSelected)for(s=0;s<o.length;++s)o[s]===popupHandleKeypress.lastPopupLinkSelected&&(p=s);for(r=0;r<o.length;++r)if(s=(p+r+1)%o.length,o[s].getAttribute("popupkey")===n)return e&&e.preventDefault&&e.preventDefault(),o[s].trigger("focus"),popupHandleKeypress.lastPopupLinkSelected=o[s],!1;return!document.oldPopupOnkeypress||document.oldPopupOnkeypress(e)}function addPopupShortcuts(){document.onkeypress!==popupHandleKeypress&&(document.oldPopupOnkeypress=document.onkeypress),document.onkeypress=popupHandleKeypress}function rmPopupShortcuts(){popupHandleKeypress.lastPopupLinkSelected=null;try{if(document.oldPopupOnkeypress&&document.oldPopupOnkeypress===popupHandleKeypress)return void(document.onkeypress=null);document.onkeypress=document.oldPopupOnkeypress}catch{}}function addPopupShortcut(e,t){let i=t;if(!getValueOf("popupShortcutKeys"))return e;const n=function addLinkProperty(e,t){const i=e.indexOf(">");return i<0?e:`${e.substring(0,i)} ${t}${e.substring(i)}`}(e,`popupkey="${i}"`);return" "===i&&(i=popupString("spacebar")),n.replace(RegExp('^(.*?)(title=")(.*?)(".*)$',"i"),`$1$2$3 [${i}]$4`)}function doneDiff(e){if(!e.owner||!e.owner.diffData)return;const i=e.owner;completedNavpopTask(i);let n,o=[];try{n=getJsObj(e.data).query.pages;for(let e=0;e<n.length;e++)o=o.concat(n[e].revisions);for(let e=0;e<o.length;e++)o[e].revid===i.diffData.oldRev.revid?i.diffData.oldRev.revision=o[e]:o[e].revid===i.diffData.newRev.revid&&(i.diffData.newRev.revision=o[e])}catch(e){errlog("Could not get diff")}!function insertDiff(e){let i=e.diffData.oldRev.revision.content.split("\n"),n=e.diffData.newRev.revision.content.split("\n"),o=stripOuterCommonLines(i,n,getValueOf("popupDiffContextLines"));i=o.a,n=o.b;let s=!1;getValueOf("popupDiffMaxLines"),(i.length>t.option.popupDiffMaxLines||n.length>t.option.popupDiffMaxLines)&&(s=!0,o=stripOuterCommonLines(i.slice(0,t.option.popupDiffMaxLines),n.slice(0,t.option.popupDiffMaxLines),t.option.popupDiffContextLines),i=o.a,n=o.b);const r=diff(i,n),p=function rmBoringLines(e,t,i){let n=i;void 0===n&&(n=2);const o=[],s=[],r=[],p=[];let a,u;for(a=0;a<e.length;++a)e[a].paired?countCrossings(t,e,a,!0)&&(o[a]=1,r[e[a].row]=1):o[a]=1;for(a=0;a<t.length;++a)1!==r[a]&&(t[a].paired||(r[a]=1));for(a=0;a<t.length;++a)if(1===r[a])for(u=Math.max(0,a-n);u<Math.min(t.length,a+n);++u)r[u]||(r[u]=1,o[t[u].row]=.5);for(a=0;a<e.length;++a)if(1===o[a])for(u=Math.max(0,a-n);u<Math.min(e.length,a+n);++u)o[u]||(o[u]=1,r[e[u].row]=.5);for(a=0;a<r.length;++a)r[a]>0&&(t[a].paired?p.push(t[a].text):p.push(t[a]));for(a=0;a<o.length;++a)o[a]>0&&(e[a].paired?s.push(e[a].text):s.push(e[a]));return{a:s,b:p}}(r.o,r.n),a=p.a,u=p.b,l=!String.prototype.parenSplit.isNative;let c="<hr />";getValueOf("popupDiffDates")&&(c+=function diffDatesTable(e){let t='<table class="popup_diff_dates">';return t+=diffDatesTableRow(e.diffData.newRev.revision,tprintf("New revision")),t+=diffDatesTableRow(e.diffData.oldRev.revision,tprintf("Old revision")),t+="</table>",t}(e),c+="<hr />"),c+=function shortenDiffString(e,t){const i=RegExp("(<del[\\s\\S]*?</del>|<ins[\\s\\S]*?</ins>)"),n=e.parenSplit(i);let o=[""];for(let e=0;e<n.length;e+=2)n[e].length<2*t?(o[o.length-1]+=n[e],e+1<n.length&&(o[o.length-1]+=n[e+1])):(e>0&&(o[o.length-1]+=n[e].substring(0,t)),e+1<n.length&&o.push(n[e].substring(n[e].length-t)+n[e+1]));for(;o.length>0&&!o[0];)o=o.slice(1);return o}(function diffString(e,t,i){const n=RegExp("([[]{2}|[\\]]{2}|[{]{2,3}|[}]{2,3}|[|]|=|<|>|[*:]+|\\s|\\b)");let o,s,r;for(i?(s=e.split(/\b/),r=t.split(/\b/)):(s=e.parenSplit(n),r=t.parenSplit(n)),o=0;o<s.length;++o)s[o]=s[o].entify();for(o=0;o<r.length;++o)r[o]=r[o].entify();const p=diff(s,r);let a="",u=[],l=0;for(o=0;o<p.n.length;++o)p.n[o].paired&&(l>p.n[o].row&&(p.o[p.n[o].row]=p.o[p.n[o].row].text,p.n[o]=p.n[o].text),l<p.n[o].row&&(l=p.n[o].row));for(o=0;o<p.o.length&&!p.o[o].paired;++o)u.push(p.o[o]);for(a+=delFmt(u),u=[],o=0;o<p.n.length;++o){for(;o<p.n.length&&!p.n[o].paired;)u.push(p.n[o++]);if(a+=insFmt(u),u=[],o<p.n.length){a+=p.n[o].text;let e=p.n[o].row+1;for(;e<p.o.length&&!p.o[e].paired;)u.push(p.o[e++]);a+=delFmt(u),u=[]}}return a}(a.join("\n"),u.join("\n"),l),getValueOf("popupDiffContextCharacters")).join("<hr />"),setPopupTipsAndHTML(c.split("\n").join("<br>")+(s?`<hr /><b>${popupString("Diff truncated for performance reasons")}</b>`:""),"popupPreview",e.idNumber)}(i)}function stripOuterCommonLines(e,t,i){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)++n;let o=e.length-1,s=t.length-1;for(;o>=0&&s>=0&&e[o]===t[s];)--o,--s;return{a:e.slice(Math.max(0,n-1-i),Math.min(e.length+1,o+i+1)),b:t.slice(Math.max(0,n-1-i),Math.min(t.length+1,s+i+1))}}function diffDatesTableRow(e,t){let i="";return i=function formattedDateTime(e){if(useTimeOffset())return`${formattedDate(e)} ${formattedTime(e)}`;if("ISO 8601"===getMWDateFormat()){const t=convertTimeZone(e,getTimeZone());return`${map(zeroFill,[t.getFullYear(),t.getMonth()+1,t.getDate()]).join("-")}T${map(zeroFill,[t.getHours(),t.getMinutes(),t.getSeconds()]).join(":")}`}const t=getValueOf("popupDateTimeFormatterOptions");return t.timeZone=getTimeZone(),e.toLocaleString(getLocales(),t)}(new Date(e.timestamp)),simplePrintf("<tr><td>%s</td><td>%s</td></tr>",[generalLink({url:`${mw.config.get("wgScript")}?oldid=${e.revid}`,text:t,title:t}),i])}function titledDiffLink(e){return titledWikiLink({article:e.article,action:`${e.to}&oldid=${e.from}`,newWin:e.newWin,noPopup:e.noPopup,text:e.text,title:e.title,actionName:"diff"})}function wikiLink(e){if("object"!=typeof e.article||"string"!=typeof e.action||"string"!=typeof e.text)return null;void 0===e.oldid&&(e.oldid=null);const i=e.oldid;/^(edit|view|revert|render)$|^raw/.test(e.action)||(e.oldid=null);let n=popupString(`${e.action}Hint`);const o=[e.oldid,safeDecodeURI(e.article)];let s=tprintf("revision %s of %s",o);switch(log(`revisionString=${s}`),e.action){case"edit&section=new":n=popupString("newSectionHint");break;case"edit&undo=":e.diff&&"prev"!==e.diff&&i?e.action+=`${e.diff}&undoafter=${i}`:i&&(e.action+=i),n=popupString("undoHint");break;case"raw&ctype=text/css":n=popupString("rawHint");break;case"revert":{const i=parseParams(t.current.link.href);e.action=`edit&autoclick=wpSave&actoken=${autoClickToken()}&autoimpl=${popupString("autoedit_version")}&autosummary=${function revertSummary(e,t){let i="";return i=getValueOf("prev"===t?"popupQueriedRevertToPreviousSummary":"popupQueriedRevertSummary"),`${i}&autorv=${e}`}(e.oldid,i.diff)}`,"prev"===i.diff&&(e.action+="&direction=prev",s=tprintf("the revision prior to revision %s of %s",o)),getValueOf("popupRevertSummaryPrompt")&&(e.action+="&autosummaryprompt=true"),getValueOf("popupMinorReverts")&&(e.action+="&autominor=true"),log(`revisionString is now ${s}`);break}case"nullEdit":e.action=`edit&autoclick=wpSave&actoken=${autoClickToken()}&autoimpl=${popupString("autoedit_version")}&autosummary=${popupString("nullEditSummary")}`;break;case"historyfeed":e.action="history&feed=rss";break;case"markpatrolled":e.action=`markpatrolled&rcid=${e.rcid}`}return n=n?e.oldid?simplePrintf(n,[s]):simplePrintf(n,[safeDecodeURI(e.article)]):safeDecodeURI(`${e.article}&action=${e.action}`)+e.oldid?`&oldid=${e.oldid}`:"",titledWikiLink({article:e.article,action:e.action,text:e.text,newWin:e.newWin,title:n,oldid:e.oldid,noPopup:e.noPopup,onclick:e.onclick})}function titledWikiLink(e){if(void 0===e.article||void 0===e.action)return errlog("got undefined article or action in titledWikiLink"),null;const i=t.wiki.titlebase+e.article.urlString();let n=i;void 0!==e.actionName&&e.actionName||(e.actionName="action"),"view"!==e.action&&(n=`${i}&${e.actionName}=${e.action}`),"edit"===e.action&&(n+="&wpChangeTags=Popups%2CAutomation%20tool"),void 0!==e.oldid&&e.oldid&&(n+=`&oldid=${e.oldid}`);let o=t.misc.defaultNavlinkClassname;return void 0!==e.className&&e.className&&(o=e.className),generalNavLink({url:n,newWin:e.newWin,title:void 0!==e.title?e.title:null,text:void 0!==e.text?e.text:null,className:o,noPopup:e.noPopup,onclick:e.onclick})}function displayUrl(e,t){t?window.open(e):document.location=e}function processAllPopups(e,i){for(let n=0;t.current.links&&n<t.current.links.length;++n)t.current.links[n].navpopup&&((e||i)&&t.current.links[n].navpopup.banish(),t.current.links[n].simpleNoMore=!1,e&&(t.current.links[n].navpopup=null))}function magicWatchLink(e){return e.onclick=simplePrintf("pg.fn.modifyWatchlist('%s','%s');return false;",[e.article.toString(!0).split("\\").join("\\\\").split("'").join("\\'"),this.id]),wikiLink(e)}function magicHistoryLink(e){let t="",i="",n="";switch(e.id){case"lastContrib":n=simplePrintf("pg.fn.getLastContrib('%s',%s)",[e.article.toString(!0).split("\\").join("\\\\").split("'").join("\\'"),e.newWin]),i=popupString("lastContribHint");break;case"sinceMe":n=simplePrintf("pg.fn.getDiffSinceMyEdit('%s',%s)",[e.article.toString(!0).split("\\").join("\\\\").split("'").join("\\'"),e.newWin]),i=popupString("sinceMeHint")}return t=`javascript:${n}`,n+=";return false;",generalNavLink({url:t,newWin:!1,title:i,text:e.text,noPopup:e.noPopup,onclick:n})}function popupMenuLink(e){const t=simplePrintf("javascript:pg.fn.%s()",[e.id]),i=popupString(simplePrintf("%sHint",[e.id])),n=simplePrintf("pg.fn.%s();return false;",[e.id]);return generalNavLink({url:t,newWin:!1,title:i,text:e.text,noPopup:e.noPopup,onclick:n})}function specialLink(e){if(void 0===e.specialpage||!e.specialpage)return null;const i=`${t.wiki.titlebase+mw.config.get("wgFormattedNamespaces")[t.nsSpecialId]}:${e.specialpage}`;void 0!==e.sep&&null!==e.sep||(e.sep="&target=");let n=e.article.urlString({keepSpaces:"Search"===e.specialpage}),o=popupString(`${e.specialpage}Hint`);switch(e.specialpage){case"Log":switch(e.sep){case"&user=":o=popupString("userLogHint");break;case"&type=block&page=":o=popupString("blockLogHint");break;case"&page=":o=popupString("pageLogHint");break;case"&type=protect&page=":o=popupString("protectLogHint");break;case"&type=delete&page=":o=popupString("deleteLogHint");break;default:log(`Unknown log type, sep=${e.sep}`),o="Missing hint (FIXME)"}break;case"PrefixIndex":n+="/"}
return o=o?simplePrintf(o,[safeDecodeURI(e.article)]):safeDecodeURI(`${e.specialpage}:${e.article}`),generalNavLink({url:i+e.sep+n,title:o,text:e.text,newWin:e.newWin,noPopup:e.noPopup})}function generalLink(e){if(void 0===e.url)return null;let i,n=`<a href="${e.url.split('"').join("%22")}"`;return void 0!==e.title&&e.title&&(n+=` title="${t.escapeQuotesHTML(e.title)}"`),void 0!==e.onclick&&e.onclick&&(n+=` onclick="${t.escapeQuotesHTML(e.onclick)}"`),e.noPopup&&(n+=" noPopup=1"),i=void 0===e.newWin||null===e.newWin?getValueOf("popupNewWindows"):e.newWin,i&&(n+=' target="_blank"'),void 0!==e.className&&e.className&&(n+=` class="${e.className}"`),n+=">","string"==typeof e.text&&(n+=t.escapeQuotesHTML(t.unescapeQuotesHTML(e.text))),n+="</a>",n}function changeLinkTargetLink(e){e.newTarget&&log(`changeLinkTargetLink: newTarget=${e.newTarget}`),e.oldTarget!==decodeURIComponent(e.oldTarget)&&log(`This might be an input problem: ${e.oldTarget}`);const t=mw.util.escapeRegExp(e.oldTarget);let i=t.charAt(0).toUpperCase();i=`[${i}${i.toLowerCase()}]`;let n=i+t.substring(1);n=n.split(RegExp("(?:[_ ]+|%20)","g")).join("(?:[_ ]+|%20)").split("\\(").join("(?:%28|\\()").split("\\)").join("(?:%29|\\))"),n=`\\s*(${n}(?:#[^\\[\\|]*)?)\\s*`;const o=e.title||mw.config.get("wgPageName").split("_").join(" "),s=titledWikiLink({article:new Title(o),newWin:e.newWin,action:"edit",text:e.text,title:e.hint,className:"popup_change_title_link"});let r="";if(e.newTarget){const t=e.newTarget,i=mw.util.escapeRegExp(e.newTarget);e.alsoChangeLabel?(r+=`s~\\[\\[${n}\\]\\]~[[${t}]]~g;`,r+=`s~\\[\\[${n}[|]~[[${t}|~g;`,r+=`s~\\[\\[${i}\\|${i}\\]\\]~[[${t}]]~g`):(r+=`s~\\[\\[${n}\\]\\]~[[${t}|$1]]~g;`,r+=`s~\\[\\[${n}[|]~[[${t}|~g;`,r+=`s~\\[\\[${i}\\|${i}\\]\\]~[[${t}]]~g`)}else r+=`s~\\[\\[${n}\\]\\]~$1~g;`,r+=`s~\\[\\[${n}[|](.*?)\\]\\]~$2~g`;return r=`autoedit=${encodeURIComponent(r)}`,r+=`&autoclick=${encodeURIComponent(e.clickButton)}&actoken=${encodeURIComponent(autoClickToken())}`,r+=null===e.minor?"":`&autominor=${encodeURIComponent(e.minor)}`,r+=null===e.watch?"":`&autowatch=${encodeURIComponent(e.watch)}`,r+=`&autosummary=${encodeURIComponent(e.summary)}`,r+=`&autoimpl=${encodeURIComponent(popupString("autoedit_version"))}`,function appendParamsToLink(e,t){const i=e.parenSplit(RegExp('(href="[^"]+?)"',"i"));if(i.length<2)return null;let n=i.shift()+i.shift();return n+=`&${t}"`,n+=i.join(""),n}(s,r)}function arinLink(e){if(!saneLinkCheck(e))return null;if(!e.article.isIpUser()||!t.wiki.wikimedia)return null;const i=e.article.userName();return generalNavLink({url:`http://ws.arin.net/cgi-bin/whois.pl?queryinput=${encodeURIComponent(i)}`,newWin:e.newWin,title:tprintf("Look up %s in ARIN whois database",[i]),text:e.text,noPopup:1})}function toolDbName(e){let t=mw.config.get("wgDBname");return e||(t+="_p"),t}function saneLinkCheck(e){return"object"==typeof e.article&&"string"==typeof e.text}function editCounterLink(e){if(!saneLinkCheck(e))return null;if(!t.wiki.wikimedia)return null;const i=e.article.userName(),n=getValueOf("popupEditCounterTool");let o;const s=`https://xtools.wmflabs.org/ec?user=$1&project=$2.$3&uselang=${mw.config.get("wgUserLanguage")}`;if("custom"===n)o=simplePrintf(getValueOf("popupEditCounterUrl"),[encodeURIComponent(i),toolDbName()]);else{const e=t.wiki.hostname.split(".");o=simplePrintf(s,[encodeURIComponent(i),e[0],e[1]])}return generalNavLink({url:o,title:tprintf("editCounterLinkHint",[i]),newWin:e.newWin,text:e.text,noPopup:1})}function globalSearchLink(e){return saneLinkCheck(e)?generalNavLink({url:`https://global-search.toolforge.org/?uselang=${mw.config.get("wgUserLanguage")}&q=`+e.article.urlString({keepSpaces:!0}),newWin:e.newWin,title:tprintf("globalSearchHint",[safeDecodeURI(e.article)]),text:e.text,noPopup:1}):null}function googleLink(e){return saneLinkCheck(e)?generalNavLink({url:`https://www.google.com/search?q=%22${e.article.urlString({keepSpaces:!0})}%22`,newWin:e.newWin,title:tprintf("googleSearchHint",[safeDecodeURI(e.article)]),text:e.text,noPopup:1}):null}function editorListLink(e){if(!saneLinkCheck(e))return null;const i=e.article.articleFromTalkPage()||e.article;return generalNavLink({url:`https://xtools.wmflabs.org/articleinfo/${encodeURI(t.wiki.hostname)}/${i.urlString()}?uselang=${mw.config.get("wgUserLanguage")}`,title:tprintf("editorListHint",[i]),newWin:e.newWin,text:e.text,noPopup:1})}function generalNavLink(e){return e.className=null===e.className?"popupNavLink":e.className,generalLink(e)}function getHistoryInfo(e,i){log("getHistoryInfo"),function getHistory(e,i){log("getHistory");const n=`${t.wiki.apiwikibase}?format=json&formatversion=2&action=query&prop=revisions&titles=${new Title(e).urlString()}&rvlimit=${getValueOf("popupHistoryLimit")}`;log(`getHistory: url=${n}`),startDownload(n,`${t.idNumber}history`,i)}(e,i?e=>{i(processHistory(e))}:processHistory)}function processHistory(e){const t=getJsObj(e.data);try{const e=anyChild(t.query.pages).revisions,i=[];for(let t=0;t<e.length;++t)i.push({oldid:e[t].revid,editor:e[t].user});return log(`processed ${i.length} edits`),finishProcessHistory(i,mw.config.get("wgUserName"))}catch(e){return log("Something went wrong with JSON business"),finishProcessHistory([])}}function finishProcessHistory(e,t){const i={};i.edits=e,i.userName=t;for(let n=0;n<e.length;++n)void 0===i.myLastEdit&&t&&e[n].editor===t&&(i.myLastEdit={index:n,oldid:e[n].oldid,previd:0===n?null:e[n-1].oldid}),void 0===i.firstNewEditor&&e[n].editor!==e[0].editor&&(i.firstNewEditor={index:n,oldid:e[n].oldid,previd:0===n?null:e[n-1].oldid});return i}function newOption(e,i){t.optionDefault[e]=i}function getValueOf(e){return function defaultize(e){null!==t.option[e]&&void 0!==t.option[e]||(void 0!==window[e]?t.option[e]=window[e]:t.option[e]=t.optionDefault[e])}(e),t.option[e]}function popupString(t){return e&&e[t]?e[t]:(o.has(t)||"string"==typeof t&&(t.includes("&autoimpl=np20140416&actoken=")||t.endsWith("Hint"))||(o.add(t),console.info("popupNoTranslation",o)),t)}function tprintf(e,t){let i=t;return"object"!=typeof i&&(i=[i]),simplePrintf(popupString(e),i)}function run(){autoEdit(),setupPopups()}const e={article:wgULS("条目","條目"),category:wgULS("个分类","個分類"),categories:wgULS("个分类","個分類"),image:wgULS("个文件","個檔案"),images:wgULS("个文件","個檔案"),stub:wgULS("小作品","小作品"),"section stub":wgULS("小章节","小章節"),"Empty page":wgULS("空页面","空頁面"),kB:wgULS("千字节<sub>(以1000为一进)</sub>","千位元組<sub>(以1000為一進)</sub>"),bytes:wgULS("字节","位元組"),day:wgULS("天","天"),days:wgULS("天","天"),hour:wgULS("小时","小時"),hours:wgULS("小时","小時"),minute:wgULS("分","分"),minutes:wgULS("分","分"),second:wgULS("秒","秒"),seconds:wgULS("秒","秒"),week:wgULS("周","周"),weeks:wgULS("周","周"),month:wgULS("月","月"),months:wgULS("月","月"),year:wgULS("年","年"),years:wgULS("年","年"),search:wgULS("搜索","搜尋"),SearchHint:wgULS("搜索包含 %s 的页面","搜尋包含 %s 的頁面"),web:"Google",global:wgULS("全域","全域"),"more...":wgULS("更多……","更多……"),actions:wgULS("操作","動作"),popupsMenu:wgULS("Popups","Popups"),"disable previews":wgULS("禁用预览","禁用預覽"),togglePreviewsHint:wgULS("切换本页 Popups 的预览开关","切換本頁 Popups 的預覽開關"),"toggle previews":wgULS("切换预览开关","切換預覽開關"),reset:wgULS("复位","複位"),disable:wgULS("禁用 Popups","禁用 Popups"),disablePopupsHint:wgULS("在本页禁用 Popups,刷新页面以重新启用。","在本頁禁用 Popups,重新整理頁面以重新啟用。"),purgePopupsHint:wgULS("复位 Popups,清除所有缓存数据。","複位 Popups,清除所有快取資料。"),PopupsHint:wgULS("复位 Popups,清除所有缓存数据。","複位 Popups,清除所有快取資料。"),spacebar:wgULS("空格","空格"),view:wgULS("查看","檢視"),"view article":wgULS("查看条目","檢視條目"),viewHint:wgULS("前往 %s","前往 %s"),talk:wgULS("讨论","討論"),"talk page":wgULS("讨论页","討論頁"),"this&nbsp;revision":wgULS("此修订版本","此修訂版本"),"revision %s of %s":wgULS("页面 $2 的修订版本 $1","頁面 $2 的修訂版本 $1"),"Revision %s of %s":wgULS("页面 $2 的修订版本 $1","頁面 $2 的修訂版本 $1"),"the revision prior to revision %s of %s":wgULS("页面 $2 的修订版本 $1 之前的修订版本","頁面 $2 的修訂版本 $1 之前的修訂版本"),"Toggle image size":wgULS("点击切换图片大小","點擊切換圖片大小"),del:wgULS("删除","删除"),delete:wgULS("删除","删除"),deleteHint:wgULS("删除 %s","删除 %s"),undeleteShort:wgULS("恢复","恢復"),UndeleteHint:wgULS("恢复 %s","恢復 %s"),protect:wgULS("保护","保護"),protectHint:wgULS("保护 %s","保護 %s"),unprotectShort:wgULS("解除","解除"),unprotectHint:wgULS("解除对 %s 的保护","解除對 %s 的保護"),move:wgULS("移动","移動"),"move page":wgULS("移动页面","移動頁面"),MovepageHint:wgULS("修改 %s 的标题","修改 %s 的標題"),edit:wgULS("编辑","編輯"),"edit article":wgULS("编辑条目","編輯條目"),editHint:wgULS("修改 %s 的内容","修改 %s 的內容"),"edit talk":wgULS("编辑讨论页","編輯對話頁",null,null,"編輯討論頁"),new:wgULS("新","新"),"new topic":wgULS("新话题","新話題"),newSectionHint:wgULS("在 %s 增加新的讨论话题","在 %s 增加新的討論話題"),"null edit":wgULS("空编辑","空編輯"),nullEditHint:wgULS("进行一次对 %s 的空编辑","製造一次對 %s 的空編輯"),hist:wgULS("历史","歷史"),history:wgULS("历史","歷史"),historyHint:wgULS("%s 的修订历史","%s 的修訂歷史"),last:wgULS("之前","之前"),lastEdit:wgULS("最近更改","最近更改"),"show last edit":wgULS("最近一次更改","最新一次修訂"),"Show the last edit":wgULS("显示最近一次更改的差异","顯示最新一次修訂的差異"),lastContrib:wgULS("最近编辑","最近編輯"),"last set of edits":wgULS("最近编辑","最近編輯"),lastContribHint:wgULS("显示由最后一位编辑者造成的差异","顯示由最後一位編輯者製造的差異"),cur:wgULS("当前","當前"),diffCur:wgULS("与当前版本的差异","與目前版本的差異"),"Show changes since revision %s":wgULS("显示自修订版本 %s 的差异","顯示自修訂版本 %s 的差異"),"%s old":wgULS("%s 前的最后版本","%s 前的最后版本"),oldEdit:wgULS("旧编辑","舊編輯"),purge:wgULS("清除缓存","清除快取"),purgeHint:wgULS("清除服务器中 %s 的缓存","清除伺服器中 %s 的快取"),raw:wgULS("源代码","原始碼"),rawHint:wgULS("查看 %s 的源代码","檢視 %s 的原始碼"),render:wgULS("仅正文","僅正文"),renderHint:wgULS("显示 %s 的纯HTML解析(仅正文内容)","顯示 %s 的純HTML解析(僅正文內容)"),"Show the edit made to get revision":wgULS("显示编辑以得到修订版本","顯示編輯以得到修訂版本"),sinceMe:wgULS("自我","自我"),"changes since mine":wgULS("自我修订的差异","自我修訂的差異"),sinceMeHint:wgULS("显示自我上次修改以来的差异","顯示自我上次修改以來的差異"),"Couldn't find an edit by %s\nin the last %s edits to\n%s":wgULS("在 $3 最近 $2 次编辑中找不到 $1 做出的修改","在 $3 最近 $2 次編輯中找不到 $1 做出的修改"),eds:wgULS("编辑","編輯"),editors:wgULS("编辑者","編輯者"),editorListHint:wgULS("列出编辑过 %s 的用户","列出編輯過 %s 的使用者",null,null,"列出編輯過 %s 的用戶"),related:wgULS("相关","相關"),relatedChanges:wgULS("相关更改","相關更改"),"related changes":wgULS("相关更改","相關更改"),RecentchangeslinkedHint:wgULS("显示相关 %s 的修改","顯示相關 %s 的修改"),editOld:wgULS("编辑旧版","編輯舊版"),rv:wgULS("回退","恢復"),revert:wgULS("回退","恢復"),revertHint:wgULS("回退到 %s","恢復到 %s"),undo:wgULS("撤销","撤銷"),undoHint:wgULS("撤销这次编辑","撤銷這次編輯"),
defaultpopupRedlinkSummary:wgULS("移除到空页面[[%s]]的链接 ——[[Help:Popups小工具|Popups]]","移除到空頁面[[%s]]的連結 ——[[Help:Popups小工具|Popups]]"),defaultpopupFixDabsSummary:wgULS("消歧义[[%s]]到[[%s]] ——[[Help:Popups小工具|Popups]]","消歧義[[%s]]到[[%s]] ——[[Help:Popups小工具|Popups]]"),defaultpopupFixRedirsSummary:wgULS("忽略从[[%s]]到[[%s]]的重定向 ——[[Help:Popups小工具|Popups]]","忽略從[[%s]]到[[%s]]的重新導向 ——[[Help:Popups小工具|Popups]]"),defaultpopupExtendedRevertSummary:wgULS("回退到$2在$1时编辑的修订版本$3 ——[[Help:Popups小工具|Popups]]","還原到$2在$1時製作的修訂版本$3 ——[[Help:Popups小工具|Popups]]"),defaultpopupRevertToPreviousSummary:wgULS("回退到修订版本%s的上一个版本 ——[[Help:Popups小工具|Popups]]","還原到修訂版本%s的上一個版本 ——[[Help:Popups小工具|Popups]]"),defaultpopupRevertSummary:wgULS("回退到修订版本%s ——[[Help:Popups小工具|Popups]]","還原到修訂版本%s ——[[Help:Popups小工具|Popups]]"),defaultpopupQueriedRevertToPreviousSummary:wgULS("回退到修订版本$1的上一个版本,由$3在$2时编辑 ——[[Help:Popups小工具|Popups]]","還原到修訂版本$1的上一個版本,由$3在$2時製作 ——[[Help:Popups小工具|Popups]]"),defaultpopupQueriedRevertSummary:wgULS("回退到$3在$2时编辑的修订版本$1 ——[[Help:Popups小工具|Popups]]","還原到$3在$2時製作的修訂版本$1 ——[[Help:Popups小工具|Popups]]"),defaultpopupRmDabLinkSummary:wgULS("移除到消歧义页[[%s]]的链接 ——[[Help:Popups小工具|Popups]]","移除到消歧義頁[[%s]]的連結 ——[[Help:Popups小工具|Popups]]"),Redirects:wgULS("重定向","重定向"),"Bypass redirect":wgULS("忽略重定向","忽略重新導向"),"Fix this redirect":wgULS("修复重定向","修復重新導向"),disambig:wgULS("消歧义","消歧義"),disambigHint:wgULS("消歧义这个链接到 [[%s]]","消歧義這個連結到 [[%s]]"),"Click to disambiguate this link to:":wgULS("点击以消歧义这个链接到:","點擊以消歧義這個連結到:"),"remove this link":wgULS("移除链接","移除連結"),"remove all links to this page from this article":wgULS("移除此条目到这页的所有链接","移除此條目到這頁的所有連結"),"remove all links to this disambig page from this article":wgULS("移除此条目到这消歧义的所有链接","移除此條目到這消歧義的所有連結"),mainlink:wgULS("主链接","主連結"),wikiLink:wgULS("个内部链接","個內部連結"),wikiLinks:wgULS("个内部链接","個內部連結"),"links here":wgULS("链入","鏈入"),whatLinksHere:wgULS("链入页面","鏈入頁面"),"what links here":wgULS("链入页面","鏈入頁面"),WhatlinkshereHint:wgULS("显示链接到 %s 的页面","顯示連結到 %s 的頁面"),unwatchShort:wgULS("取消","取消"),watchThingy:wgULS("监视","監視"),watchHint:wgULS("加入 %s 到我的监视列表","加入 %s 到我的監視列表"),unwatchHint:wgULS("从我的监视列表移除 %s","從我的監視列表移除 %s"),"Only found one editor: %s made %s edits":wgULS("仅找到一位编者:%s 制造了 %s 次编辑","僅找到一位編者:%s 製造了 %s 次編輯"),"%s seems to be the last editor to the page %s":wgULS("%s 看上去是 %s 这页的最后一位编者","%s 看上去是 %s 這頁的最後一位編者"),rss:wgULS("RSS","RSS"),"Diff truncated for performance reasons":wgULS("出于性能考虑,差异已被截断","出於效能考慮,差異已被截斷"),"Old revision":wgULS("旧版本","舊版本"),"New revision":wgULS("新版本","新版本"),"Something went wrong :-(":wgULS("出问题了 :-(","出問題了 :-("),"Empty revision, maybe non-existent":wgULS("空的修订,可能并不存在","空的修訂,可能並不存在"),"Unknown date":wgULS("未知日期","未知日期"),"Empty category":wgULS("空的分类","空的分類"),"Category members (%s shown)":wgULS("分类成员(%s 显示)","分類成員(%s 顯示)"),"No image links found":wgULS("未找到文件链接","未找到檔案連結"),"File links":wgULS("文件链接","檔案連結"),"not commons":wgULS("维基共享中无此名称的文件。","維基共享中無此名稱的檔案。"),"commons only":wgULS("此文件来自维基共享。","此檔案來自維基共享。"),"No image found":wgULS("找不到文件","找不到檔案"),"commons dupe":wgULS("维基共享中存在此文件的副本。","維基共享中存在此檔案的副本。"),"commons conflict":wgULS("维基共享中存在此文件名称不同的副本。","維基共享中存在此檔名稱不同的副本。"),user:wgULS("用户","使用者",null,null,"用戶"),"user&nbsp;page":wgULS("用户页","使用者頁",null,null,"用戶頁"),"user talk":wgULS("用户讨论","使用者對話",null,null,"用戶討論"),"edit user talk":wgULS("编辑用户讨论","編輯使用者對話",null,null,"編輯用戶討論"),"leave comment":wgULS("留言","留言"),email:wgULS("电邮","電郵"),"email user":wgULS("电邮用户","電郵使用者"),EmailuserHint:wgULS("给 %s 发送电子邮件","給 %s 發送電子郵件"),space:wgULS("子页面","子頁面"),PrefixindexHint:wgULS("显示 %s 的用户页子页面","顯示 %s 的使用者頁子頁面",null,null,"顯示 %s 的用戶頁子頁面"),count:wgULS("统计","統計"),"edit counter":wgULS("编辑次数","編輯次數"),katelinkHint:wgULS("%s 的编辑次数","%s 的編輯次數"),contribs:wgULS("贡献","貢獻"),contributions:wgULS("贡献","貢獻"),deletedContribs:wgULS("已删除的贡献","已刪除的貢獻"),ContributionsHint:wgULS("%s 的用户贡献","%s 的使用者貢獻",null,null,"%s 的用戶貢獻"),tree:wgULS("树","樹"),contribsTreeHint:wgULS("根据命名空间查看 %s 的贡献","根據命名空間檢視 %s 的貢獻"),log:wgULS("日志","日誌"),"user log":wgULS("用户日志","使用者日誌",null,null,"用戶日誌"),userLogHint:wgULS("显示 %s 的用户日志","顯示 %s 的使用者日誌",null,null,"顯示 %s 的用戶日誌"),arin:wgULS("ARIN 查询","ARIN 查詢"),"Look up %s in ARIN whois database":wgULS("在 ARIN Whois 数据库中查询 %s","在 ARIN Whois 數據庫中查詢 %s"),unblockShort:wgULS("解除","解除"),block:wgULS("封禁","封鎖"),"block user":wgULS("封禁用户","封鎖使用者",null,null,"封鎖用戶"),IpblocklistHint:wgULS("解封 %s","解封 %s"),BlockipHint:wgULS("封禁 %s","封鎖 %s"),"block log":wgULS("封禁日志","封鎖日誌"),blockLogHint:wgULS("显示 %s 的封禁日志","顯示 %s 的封鎖日誌"),protectLogHint:wgULS("显示 %s 的保护日志","顯示 %s 的保護日誌"),pageLogHint:wgULS("显示 %s 的日志","顯示 %s 的日誌"),deleteLogHint:wgULS("显示 %s 的删除日志","顯示 %s 的刪除日誌"),"Invalid %s %s":wgULS("选项 %s 不可用:%s","選項 %s 不可用:%s"),m:wgULS("小","小"),"Enter a non-empty edit summary or press cancel to abort":wgULS("输入编辑摘要,或按取消中止操作","輸入編輯摘要,或按取消中止操作"),"Failed to get revision information, please edit manually.\n\n":wgULS("获取修订版本信息失败,请手动修改。\n\n","獲取修訂版本資訊失敗,請手動修改。\n\n"),"The %s button has been automatically clicked. Please wait for the next page to load.":wgULS("按钮 %s 已被自动点击,请等待下一个页面加载。","按鈕 %s 已被自動點擊,請等待下一個頁面載入。"),"Could not find button %s. Please check the settings in your javascript file.":wgULS("找不到按钮 %s,请检查您 JavaScript 文件中的设置。","找不到按鈕 %s,請檢查您 JavaScript 檔案中的設定。"),"Open full-size image":wgULS("查看全尺寸图像","檢視全尺寸影像"),zxy:wgULS("zxy","zxy"),globalSearchHint:wgULS("在维基百科其他语言搜索“%s”","在維基百科其他語言搜尋「%s」"),googleSearchHint:wgULS("在 Google 上搜索“%s”","在 Google 上搜尋「%s」"),"enable previews":wgULS("启用预览","啟用預覽"),"show preview":wgULS("禁用预览","禁用預覽"),historyfeedHint:wgULS("该页面的近期更改 RSS feed","該頁面的近期更改 RSS feed"),"send thanks":wgULS("发送感谢","傳送感謝"),ThanksHint:wgULS("向该用户发送一封感谢消息","向該使用者傳送一封感謝訊息"),"mark patrolled":wgULS("标记为已巡查","標記為已巡查"),markpatrolledHint:wgULS("标记该编辑为已巡查","標記該編輯為已巡查"),"Could not marked this edit as patrolled":wgULS("无法标记该编辑为已巡查","無法標記該編輯為已巡查"),defaultpopupReviewedSummary:wgULS("标记从版本%s到%s间的编辑为已巡查","標記從版本%s到%s間的編輯為已巡查"),"Image from Commons":wgULS("来自维基共享的图片","來自維基共用的圖片"),"Description page":wgULS("图片描述页","圖片描述頁"),"Alt text:":wgULS("替换文本(Alt):","替換文字(Alt):"),revdel:wgULS("历史版本被隐藏","歷史版本被隱藏"),editCounterLinkHint:wgULS("用户%s的编辑次数","使用者%s的編輯次數"),DeletedcontributionsHint:wgULS("用户%s的被删除编辑次数","使用者%s的被刪除編輯次數"),"No backlinks found":wgULS("找不到链入页面","找不到鏈入頁面")," and more":wgULS("以及其他页面","以及其他頁面"),"Download preview data":wgULS("下载预览数据","下載預覽資料"),"Invalid or IP user":wgULS("错误的用户名或IP用户","錯誤的使用者名稱或IP使用者"),"Not a registered username":wgULS("非已注册的用户","非已註冊的使用者"),BLOCKED:wgULS("被封禁","被封鎖"),"Has blocks":wgULS("被部分封禁","被部分封鎖")," edits since: ":wgULS("次编辑,注册日期为","次編輯,註冊日期為"),"last edit on ":wgULS("最后一次编辑于","最後一次編輯於"),EmailUserHint:wgULS("给 %s 发送电子邮件","給 %s 發送電子郵件"),RANGEBLOCKED:wgULS("IP段被封禁","IP段被封鎖"),"IP user":wgULS("IP用户","IP使用者"),"♀":"♀","♂":"♂",HIDDEN:wgULS("全域隐藏","全域隱藏"),LOCKED:wgULS("全域锁定","全域鎖定"),"Invalid user":wgULS("非法用户名","非法使用者名稱"),diff:wgULS("差异","差異")," to ":wgULS("至","至"),autoedit_version:"np20140416",PrefixIndexHint:wgULS("显示用户%s的子页面","顯示使用者%s的子頁面",null,null,"顯示用戶%s的子頁面"),nullEditSummary:wgULS("进行一次零编辑","進行一次零編輯"),"group-no-autoconfirmed":wgULS("非自动确认用户","非自動確認使用者",null,null,"非自動確認用戶"),separator:"、",comma:","},t={api:{},re:{},ns:{},string:{},wiki:{},user:{},misc:{},option:{},optionDefault:{},flag:{},cache:{},structures:{},timer:{},counter:{},current:{},fn:{},endoflist:null};if(window.pg&&!(window.pg instanceof HTMLElement))return;window.pg=t,mw.util.escapeRegExp||(mw.util.escapeRegExp=mw.RegExp.escape);const log=(...e)=>window.popupDebug&&console.log(...e),errlog=(...e)=>window.popupDebug&&console.error(...e);class Drag{constructor(){this.startCondition=null,this.endHook=null}fixE(e){let t=e;return void 0===t&&(t=window.event),void 0===t.layerX&&(t.layerX=t.offsetX),void 0===t.layerY&&(t.layerY=t.offsetY),t}init(e,t){const i=this;this.obj=e,e.onmousedown=function(e){i.start.bind(i)(e)},e.dragging=!1,e.popups_draggable=!0,e.hmode=!0,e.vmode=!0,e.root=t||e,isNaN(parseInt(e.root.style.left,10))&&(e.root.style.left="0px"),isNaN(parseInt(e.root.style.top,10))&&(e.root.style.top="0px"),e.root.onthisStart=function(){},e.root.onthisEnd=function(){},e.root.onthis=function(){}}start(e){let t=e;const i=this.obj;if(t=this.fixE(t),this.startCondition&&!this.startCondition(t))return;const n=parseInt(i.vmode?i.root.style.top:i.root.style.bottom,10),o=parseInt(i.hmode?i.root.style.left:i.root.style.right,10);i.root.onthisStart(o,n),i.lastMouseX=t.clientX,i.lastMouseY=t.clientY;const s=this;return i.onmousemoveDefault=document.onmousemove,i.dragging=!0,document.onmousemove=function(e){s.drag.bind(s)(e)},document.onmouseup=function(e){s.end.bind(s)(e)},!1}drag(e){let t=e;t=this.fixE(t);const i=this.obj,n=t.clientY,o=t.clientX,s=parseInt(i.vmode?i.root.style.top:i.root.style.bottom,10),r=parseInt(i.hmode?i.root.style.left:i.root.style.right,10)+(o-i.lastMouseX)*(i.hmode?1:-1),p=s+(n-i.lastMouseY)*(i.vmode?1:-1);return this.obj.root.style[i.hmode?"left":"right"]=`${r}px`,this.obj.root.style[i.vmode?"top":"bottom"]=`${p}px`,this.obj.lastMouseX=o,this.obj.lastMouseY=n,this.obj.root.onthis(r,p),!1}end(){document.onmousemove=this.obj.onmousemoveDefault,document.onmouseup=null,this.obj.dragging=!1,this.endHook&&this.endHook(parseInt(this.obj.root.style[this.obj.hmode?"left":"right"],10),parseInt(this.obj.root.style[this.obj.vmode?"top":"bottom"],10))}}t.structures.original={},t.structures.original.popupLayout=function(){return["popupError","popupImage","popupTopLinks","popupTitle","popupUserData","popupData","popupOtherLinks","popupRedir",["popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"],"popupMiscTools",["popupRedlink"],"popupPrePreviewSep","popupPreview","popupSecondPreview","popupPreviewMore","popupPostPreview","popupFixDab"]},t.structures.original.popupRedirSpans=function(){return["popupRedir","popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"]},t.structures.original.popupTitle=function(e){return log("defaultstructure.popupTitle"),getValueOf("popupNavLinks")?"":navlinkStringToHTML("<b><<mainlink>></b>",e.article,e.params)},t.structures.original.popupTopLinks=function(e){return log("defaultstructure.popupTopLinks"),getValueOf("popupNavLinks")?function navLinksHTML(e,t,i){return navlinkStringToHTML(`<span class="popupNavLinks">${function defaultNavlinkSpec(){let e=""
;e+="<b><<mainlink|shortcut= >></b>",getValueOf("popupLastEditLink")&&(e+="*<<lastEdit|shortcut=/>>|<<lastContrib>>|<<sinceMe>>if(oldid){|<<oldEdit>>|<<diffCur>>}"),e+="if(user){<br><<contribs|shortcut=c>>*<<userlog|shortcut=L|log>>",e+="if(ipuser){*<<arin>>}if(wikimedia){*<<count|shortcut=#>>}",e+="if(ipuser){}else{*<<email|shortcut=E>>}if(admin){*<<block|shortcut=b>>|<<blocklog|log>>}}";const t="if(oldid){<<editOld|shortcut=e>>|<<revert|shortcut=v|rv>>|<<edit|cur>>}else{<<edit|shortcut=e>>}",i="<<history|shortcut=h>>|<<editors|shortcut=E|>>",n="<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>";return e+=`<br>if(talk){${t}|<<new|shortcut=+>>*${i}*${n}*<b><<article|shortcut=a>></b>|<<editArticle|edit>>}else{${t}*${i}*${n}*<b><<talk|shortcut=t>></b>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>}`,e+="<br><<whatLinksHere|shortcut=l>>*<<relatedChanges|shortcut=r>>*<<move|shortcut=m>>",e+="if(admin){<br><<unprotect|unprotectShort>>|<<protect|shortcut=p>>|<<protectlog|log>>*<<undelete|undeleteShort>>|<<delete|shortcut=d>>|<<deletelog|log>>}",e}()}</span>`,e,i)}(e.article,e.hint,e.params):""},t.structures.original.popupImage=function(e){return log(`original.popupImage, x.article=${e.article}, x.navpop.idNumber=${e.navpop.idNumber}`),function imageHTML(e,t){return simplePrintf('<a id="popupImageLink$1"><img align="right" valign="top" id="popupImg$1" style="display: none;"></img></a>',[t])}(e.article,e.navpop.idNumber)},t.structures.original.popupRedirTitle=t.structures.original.popupTitle,t.structures.original.popupRedirTopLinks=t.structures.original.popupTopLinks,copyStructure("original","nostalgia"),t.structures.nostalgia.popupTopLinks=function(e){let t="";t+="<b><<mainlink|shortcut= >></b>",t+="if(user){<br><<contribs|shortcut=c>>",t+="if(wikimedia){*<<count|shortcut=#>>}",t+="if(ipuser){}else{*<<email|shortcut=E>>}if(admin){*<<block|shortcut=b>>}}";const i="if(oldid){<<editOld|shortcut=e>>|<<revert|shortcut=v|rv>>|<<edit|cur>>}else{<<edit|shortcut=e>>}",n="<<history|shortcut=h>>",o="<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>";return t+=`<br>if(talk){${i}|<<new|shortcut=+>>*${n}*${o}*<b><<article|shortcut=a>></b>|<<editArticle|edit>>}else{${i}*${n}*${o}*<b><<talk|shortcut=t>></b>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>}`,t+="<br><<whatLinksHere|shortcut=l>>*<<relatedChanges|shortcut=r>>",t+="if(admin){<br>}else{*}<<move|shortcut=m>>",t+="if(admin){*<<unprotect|unprotectShort>>|<<protect|shortcut=p>>*<<undelete|undeleteShort>>|<<delete|shortcut=d>>}",navlinkStringToHTML(t,e.article,e.params)},t.structures.nostalgia.popupRedirTopLinks=t.structures.nostalgia.popupTopLinks,copyStructure("original","fancy"),t.structures.fancy.popupTitle=function(e){return navlinkStringToHTML("<font size=+0><<mainlink>></font>",e.article,e.params)},t.structures.fancy.popupTopLinks=function(e){const t="<<history|shortcut=h|hist>>|<<lastEdit|shortcut=/|last>>|<<editors|shortcut=E|eds>>",i="<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>",n="<<move|shortcut=m|move>>";return navlinkStringToHTML(`if(talk){<<edit|shortcut=e>>|<<new|shortcut=+|+>>*${t}*<<article|shortcut=a>>|<<editArticle|edit>>*${i}*${n}}else{<<edit|shortcut=e>>*${t}*<<talk|shortcut=t|>>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>*${i}*${n}}<br>`,e.article,e.params)},t.structures.fancy.popupOtherLinks=function(e){let t="<<contribs|shortcut=c>>if(wikimedia){|<<count|shortcut=#|#>>}";return t+=`if(ipuser){|<<arin>>}else{*<<email|shortcut=E|${popupString("email")}>>}if(admin){*<<block|shortcut=b>>}`,navlinkStringToHTML(`<br>if(user){${t}*}if(admin){<<unprotect|unprotectShort>>|<<protect|shortcut=p>>*<<undelete|undeleteShort>>|<<delete|shortcut=d|del>>if(user){<br>}else{*}}<<whatLinksHere|shortcut=l|links here>>*<<relatedChanges|shortcut=r|related>>`,e.article,e.params)},t.structures.fancy.popupRedirTitle=t.structures.fancy.popupTitle,t.structures.fancy.popupRedirTopLinks=t.structures.fancy.popupTopLinks,t.structures.fancy.popupRedirOtherLinks=t.structures.fancy.popupOtherLinks,copyStructure("fancy","fancy2"),t.structures.fancy2.popupTopLinks=function(e){return`<br>${t.structures.fancy.popupTopLinks(e).replace(RegExp("<br>$","i"),"")}`},t.structures.fancy2.popupLayout=function(){return["popupError","popupImage","popupTitle","popupUserData","popupData","popupTopLinks","popupOtherLinks","popupRedir",["popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"],"popupMiscTools",["popupRedlink"],"popupPrePreviewSep","popupPreview","popupSecondPreview","popupPreviewMore","popupPostPreview","popupFixDab"]},copyStructure("original","menus"),t.structures.menus.popupLayout=function(){return["popupError","popupImage","popupTopLinks","popupTitle","popupOtherLinks","popupRedir",["popupWarnRedir","popupRedirTopLinks","popupRedirTitle","popupRedirData","popupRedirOtherLinks"],"popupUserData","popupData","popupMiscTools",["popupRedlink"],"popupPrePreviewSep","popupPreview","popupSecondPreview","popupPreviewMore","popupPostPreview","popupFixDab"]},t.structures.menus.popupTopLinks=function(e,t){const i=[],n='<div class="popup_drop">',o="</div>";let s="<<history|shortcut=h>>";t||(s=`<menurow>${s}|<<historyfeed|rss>>|<<editors|shortcut=E>></menurow>`),getValueOf("popupActionsMenu")?i.push(`<<mainlink>>*${n}${menuTitle("actions")}`):i.push(`${n}<<mainlink>>`),i.push("<menu>"),i.push("if(oldid){<menurow><<edit|shortcut=e>>|<<editOld|shortcut=e|this&nbsp;revision>></menurow><menurow><<revert|shortcut=v>>|<<undo>></menurow>}else{<<edit|shortcut=e>>}if(rcid){<<markpatrolled|mark patrolled>>}if(talk){<<new|shortcut=+|new topic>>}"+s+"<<lastEdit|shortcut=/|show last edit>>if(diff){<<thank|send thanks>>}"),t||i.push("<<lastContrib|last set of edits>><<sinceMe|changes since mine>>"),i.push("<<move|shortcut=m|move page>><<whatLinksHere|shortcut=l|what links here>><<relatedChanges|shortcut=r|related changes>>"),t||i.push("<menurow><<nullEdit|shortcut=n|null edit>>|<<purge|shortcut=P>></menurow><menurow><<search|shortcut=s>>if(wikimedia){|<<globalsearch|shortcut=g|global>>}|<<google|shortcut=G|web>></menurow>"),t||i.push("<menurow><<view|shortcut=v>>|<<render|shortcut=S>>|<<raw>></menurow>"),i.push("<hr /><menurow><<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>></menurow>if(admin){<menurow><<unprotect|unprotectShort>>|<<protect|shortcut=p>>|<<protectlog|log>></menurow><menurow><<undelete|undeleteShort>>|<<delete|shortcut=d>>|<<deletelog|log>></menurow>}"),i.push(`<hr />if(talk){<<article|shortcut=a|view article>><<editArticle|edit article>>}else{<<talk|shortcut=t|talk page>><<editTalk|edit talk>><<newTalk|shortcut=+|new topic>>}</menu>${o}`);const r="<<email|shortcut=E|email user>>";return i.push(`if(user){*${n}${menuTitle("user")}`),i.push("<menu>"),i.push("<menurow><<userPage|shortcut=u|user&nbsp;page>>|<<userSpace|space>></menurow>"),i.push("<<userTalk|shortcut=t|user talk>><<editUserTalk|edit user talk>><<newUserTalk|shortcut=+|leave comment>>"),t?i.push(`if(ipuser){}else{${r}}`):i.push(`if(ipuser){<<arin>>}else{${r}}`),i.push("<hr />if(wikimedia){<menurow>}<<contribs|shortcut=c|contributions>>if(wikimedia){</menurow>}if(admin){<menurow><<deletedContribs>></menurow>}<<userlog|shortcut=L|user log>>"),i.push("if(wikimedia){<<count|shortcut=#|edit counter>>}"),i.push("if(admin){<menurow><<unblock|unblockShort>>|<<block|shortcut=b|block user>></menurow>}"),i.push("<<blocklog|shortcut=B|block log>>"),i.push(`</menu>${o}}`),getValueOf("popupSetupMenu")&&!e.navpop.hasPopupMenu&&(e.navpop.hasPopupMenu=!0,i.push(`*${n}${menuTitle("popupsMenu")}<menu>`),i.push("<<togglePreviews|toggle previews>>"),i.push("<<purgePopups|reset>>"),i.push("<<disablePopups|disable>>"),i.push(`</menu>${o}`)),navlinkStringToHTML(i.join(""),e.article,e.params)},t.structures.menus.popupRedirTitle=t.structures.menus.popupTitle,t.structures.menus.popupRedirTopLinks=t.structures.menus.popupTopLinks,copyStructure("menus","shortmenus"),t.structures.shortmenus.popupTopLinks=function(e){return t.structures.menus.popupTopLinks(e,!0)},t.structures.shortmenus.popupRedirTopLinks=t.structures.shortmenus.popupTopLinks,t.structures.lite={},t.structures.lite.popupLayout=function(){return["popupTitle","popupPreview"]},t.structures.lite.popupTitle=function(e){return log(`${e.article}: structures.lite.popupTitle`),`<div><span class="popup_mainlink"><b>${e.article.toString()}</b></span></div>`};class Downloader{constructor(e){this.id=null,this.lastModified=null,this.callbackFunction=null,this.onFailure=null,this.aborted=!1,this.method="GET",this.async=!0,"undefined"!=typeof XMLHttpRequest&&(this.http=new XMLHttpRequest),this.url=e}send(e){return this.http?this.http.send(e):null}abort(){return this.http?(this.aborted=!0,this.http.abort()):null}getData(){return this.http?this.http.responseText:null}setTarget(){if(!this.http)return null;this.http.open(this.method,this.url,this.async),this.http.setRequestHeader("Api-User-Agent",t.api.userAgent)}getReadyState(){return this.http?this.http.readyState:null}start(){this.http&&(t.misc.downloadsInProgress[this.id]=this,this.http.send(null))}getLastModifiedDate(){if(!this.http)return null;let e=null;try{e=this.http.getResponseHeader("Last-Modified")}catch{}return e?new Date(e):null}setCallback(e){this.http&&(this.http.onreadystatechange=e)}getStatus(){return this.http?this.http.status:null}}t.misc.downloadsInProgress={};const i={dump:function(e,t){let i=e,n=t;"string"==typeof i&&(i=document.getElementById(i)),"string"==typeof n&&(n=document.getElementById(n)),n.innerHTML=this.convert(i.value)},convert:function(e){function remain(){return t.length}function sh(){return t.shift()}function ps(e){o+=e}function f(...e){let t,i,n=1,o=e[0],s="";for(;n<e.length&&(i=o.indexOf("?"))+1;n++)n-=t="?"===o.charAt(i+1)?1:0,s+=o.substring(0,i)+(t?"?":e[n]),o=o.substr(i+1+t);return s+o}function html_entities(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function htmlescape_text(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/:/g,"&#58;").replace(/\[/g,"&#91;").replace(/]/g,"&#93;")}function htmlescape_attr(e){return htmlescape_text(e).replace(/'/g,"&#39;").replace(/"/g,"&quot;")}function str_imatch(e,t){const i=Math.min(e.length,t.length);let n
;for(n=0;n<i&&e.charAt(n)===t.charAt(n);n++);return n}function compareLineStringOrReg(e){return"string"==typeof e?t[0]&&t[0].substr(0,e.length)===e:n=t[0]&&t[0].match(e)}function compareLineString(e){return t[0]===e}function charAtPoint(e){return t[0].charAt(e)}function endl(e){ps(e),sh()}function parse_list(){let e="";for(;remain()&&compareLineStringOrReg(/^([*#:;]+)(.*)$/);){const i=n;sh();const o=str_imatch(e,i[1]);for(let t=e.length-1;t>=o;t--){const n=e.charAt(t);"*"===n?ps("</ul>"):"#"===n?ps("</ol>"):$.inArray(i[1].charAt(t),["","*","#"])&&ps("</dl>")}for(let t=o;t<i[1].length;t++){const n=i[1].charAt(t);"*"===n?ps("<ul>"):"#"===n?ps("<ol>"):$.inArray(e.charAt(t),["","*","#"])&&ps("<dl>")}switch(i[1].charAt(i[1].length-1)){case"*":case"#":ps(`<li>${parse_inline_nowiki(i[2])}`);break;case";":{ps("<dt>");const e=i[2].match(/(.*?)(:.*?)$/);e?(ps(parse_inline_nowiki(e[1])),t.unshift(e[2])):ps(parse_inline_nowiki(i[2]));break}case":":ps(`<dd>${parse_inline_nowiki(i[2])}`)}e=i[1]}for(let t=e.length-1;t>=0;t--)ps(f("</?>","*"===e.charAt(t)?"ul":"#"===e.charAt(t)?"ol":"dl"))}function parse_table(){for(endl(f("<table>",compareLineStringOrReg(/^\{\|( .*)$/)?n[1]:""));remain();)if(compareLineStringOrReg("|"))switch(charAtPoint(1)){case"}":return void endl("</table>");case"-":endl(f("<tr>",compareLineStringOrReg(/\|-*(.*)/)[1]));break;default:parse_table_data()}else compareLineStringOrReg("!")?parse_table_data():sh()}function parse_table_data(){let e,n;const o=sh().match(/^(\|\+|\||!)((?:([^[|]*?)\|(?!\|))?(.*))$/);if("|+"===o[1]?ps("<caption"):ps("<t"+("|"===o[1]?"d":"h")),n=void 0!==o[3]?4:2,ps(">"),"|+"!==o[1])for(e=o[n].split("|"===o[1]?"||":/(?:\|\||!!)/),ps(parse_inline_nowiki(e.shift()));e.length;)t.unshift(o[1]+e.pop());else ps(parse_inline_nowiki(o[n]));let s=0;const r=[];for(;remain();)if(r.push(sh()),compareLineStringOrReg("|")){if(!s)break;"}"===charAtPoint(1)&&s--}else{if(!s&&compareLineStringOrReg("!"))break;compareLineStringOrReg("{|")&&s++}r.length&&ps(i.convert(r))}function parse_pre(){ps("<pre>");do{endl(`${parse_inline_nowiki(t[0].substring(1))}\n`)}while(remain()&&compareLineStringOrReg(" "));ps("</pre>")}function parse_block_image(){ps(parse_image(sh()))}function parse_image(e){let t=e.substring(e.indexOf(":")+1,e.length-2);const i=[];if(t.match(/\|/)){let e,n=0;for(let i=t.length-1;i>0;i--){if("|"===t.charAt(i)&&!n){e=t.substr(i+1),t=t.substring(0,i);break}switch(t.substr(i-1,2)){case"]]":n++,i--;break;case"[[":n--,i--}}i.length=0,i.push(...t.split(/\s*\|\s*/)),i.push(e)}return""}function parse_inline_nowiki(e){let t,i,n,o,s=0,r=0,p=0,a="";for(;-1!==(t=e.indexOf("<nowiki>",r));){a+=parse_inline_wiki(e.substring(s,t)),t+=8,r=t,o=!0;do{if(i=e.indexOf("<nowiki>",r),n=e.indexOf("</nowiki>",r),n<=i||-1===i){if(-1===n)return a+html_entities(e.substr(t));r=n+9,p?p--:(s=r,a+=html_entities(e.substring(t,s-9)),o=!1)}else r=i+8,p++}while(o)}return a+parse_inline_wiki(e.substr(s))}function parse_inline_wiki(e){let t=e;t=function parse_inline_images(e){let t,n,o,s,r,p,a=e,u=0,l=0;for(;-1!==(t=a.indexOf("[[",u))&&a.substr(t+2).match(RegExp(`^(Image|File|${i.conf.locale.image}):`,"i"));){n=!0,u=t;do{if(u+=2,o=a.indexOf("]]",u),s=a.indexOf("[[",u),o<=s||-1===s){if(-1===o)return a;u=o,l?l--:(r=a.substring(t,o+2),p=parse_image(r),a=a.replace(r,p),u=t+p.length,n=!1)}else u=s,l++}while(n)}return a}(t),t=t.replace(/<(?:)math>(.*?)<\/math>/gi,"");let n=new Date,o=n.getUTCMinutes();return o<10&&(o=`0${o}`),n=f("?:?, ? ? ? (UTC)",n.getUTCHours(),o,n.getUTCDate(),i.conf.locale.months[n.getUTCMonth()],n.getUTCFullYear()),t=t.replace(/~{5}(?!~)/g,n).replace(/~{4}(?!~)/g,`${i.conf.user.name} ${n}`).replace(/~{3}(?!~)/g,i.conf.user.name).replace(RegExp(`\\[\\[:((?:${i.conf.locale.category}|Image|File|${i.conf.locale.image}|${i.conf.wiki.interwiki}):[^|]*?)\\]\\](\\w*)`,"gi"),(e,t,n)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(t)+htmlescape_text(n))).replace(RegExp(`\\[\\[(?:${i.conf.locale.category}|${i.conf.wiki.interwiki}):.*?\\]\\]`,"gi"),"").replace(RegExp(`\\[\\[:((?:${i.conf.locale.category}|Image|File|${i.conf.locale.image}|${i.conf.wiki.interwiki}):.*?)\\|([^\\]]+?)\\]\\](\\w*)`,"gi"),(e,t,n,o)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(n)+htmlescape_text(o))).replace(/\[\[(\/[^|]*?)\]\]/g,(e,t)=>f("<a href='?'>?</a>",i.conf.baseUrl+htmlescape_attr(t),htmlescape_text(t))).replace(/\[\[(\/.*?)\|(.+?)\]\]/g,(e,t,n)=>f("<a href='?'>?</a>",i.conf.baseUrl+htmlescape_attr(t),htmlescape_text(n))).replace(/\[\[([^[|]*?)\]\](\w*)/g,(e,t,n)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(t)+htmlescape_text(n))).replace(/\[\[([^[]*?)\|([^\]]+?)\]\](\w*)/g,(e,t,n,o)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t),htmlescape_text(n)+htmlescape_text(o))).replace(/\[\[([^\]]*?:)?(.*?)( *\(.*?\))?\|\]\]/g,(e,t,n,o)=>f("<a href='?'>?</a>",i.conf.paths.articles+htmlescape_attr(t)+htmlescape_attr(n)+htmlescape_attr(o),htmlescape_text(n))).replace(/\[(https?|news|ftp|mailto|gopher|irc):(\/*)([^\]]*?) (.*?)\]/g,(e,t,i,n,o)=>f("<a class='external' href='?:?'>?</a>",htmlescape_attr(t),htmlescape_attr(i)+htmlescape_attr(n),htmlescape_text(o))).replace(/\[http:\/\/(.*?)\]/g,(e,t)=>f("<a class='external' href='http://?'>[#]</a>",htmlescape_attr(t))).replace(/\[(news|ftp|mailto|gopher|irc):(\/*)(.*?)\]/g,(e,t,i,n)=>f("<a class='external' href='?:?'>?:?</a>",htmlescape_attr(t),htmlescape_attr(i)+htmlescape_attr(n),htmlescape_text(t),htmlescape_text(i)+htmlescape_text(n))).replace(/(^| )(https?|news|ftp|mailto|gopher|irc):(\/*)([^ $]*[^.,!?;: $])/g,(e,t,i,n,o)=>f("?<a class='external' href='?:?'>?:?</a>",htmlescape_text(t),htmlescape_attr(i),htmlescape_attr(n)+htmlescape_attr(o),htmlescape_text(i),htmlescape_text(n)+htmlescape_text(o))).replace("__NOTOC__","").replace("__NOINDEX__","").replace("__INDEX__","").replace("__NOEDITSECTION__",""),function parse_inline_formatting(e){let t,i,n,o,s="";for(;(n=e.indexOf("''",o))+1;)s+=e.substring(o,n),o=n+2,"'"===e.charAt(n+2)?(o++,i=!i,s+=i?"<strong>":"</strong>"):(t=!t,s+=t?"<em>":"</em>");return s+e.substr(o)}(t)}const t="string"==typeof e?e.replace(/\r/g,"").split(/\n/):e;let n,o="",s=0;for(;remain();)compareLineStringOrReg(/^(={1,6})(.*)\1(.*)$/)?(s=0,endl(f("<h?>?</h?>?",n[1].length,parse_inline_nowiki(n[2]),n[1].length,n[3]))):compareLineStringOrReg(/^[*#:;]/)?(s=0,parse_list()):compareLineStringOrReg(" ")?(s=0,parse_pre()):compareLineStringOrReg("{|")?(s=0,parse_table()):compareLineStringOrReg(/^----+$/)?(s=0,endl("<hr />")):compareLineStringOrReg(i.BLOCK_IMAGE)?(s=0,parse_block_image()):(compareLineString("")?(s=remain()>1&&""===t[1],s&&endl("<p><br>")):(s||(ps("<p>"),s=1),ps(`${parse_inline_nowiki(t[0])} `)),sh());return o}};class Stringwrapper{indexOf(e){return this.toString().indexOf(e)}toString(){return this.value}parenSplit(e){return this.toString().parenSplit(e)}substring(e,t){return void 0===t?this.toString().substring(e):this.toString().substring(e,t)}split(e){return this.toString().split(e)}replace(e,t){return this.toString().replace(e,t)}}class Title extends Stringwrapper{constructor(e){super(),this.value=null,this.anchor="",this.setUtf(e)}static fromURL(e){return(new Title).fromURL(e)}static fromAnchor(e){return(new Title).fromAnchor(e)}static fromWikiText(e){return(new Title).fromWikiText(e)}toString(e){return this.value+(!e&&this.anchor?`#${this.anchorString()}`:"")}anchorString(){if(!this.anchor)return"";const e=this.anchor.parenSplit(/((?:[.][0-9A-F]{2})+)/),t=e.length;let i;for(let n=1;n<t;n+=2){i=e[n].split(".").join("%");try{i=decodeURIComponent(i)}catch{}e[n]=i.split("_").join(" ")}return e.join("")}urlAnchor(){const e=this.anchor.parenSplit("/((?:[%][0-9A-F]{2})+)/"),t=e.length;for(let i=1;i<t;i+=2)e[i]=e[i].split("%").join(".");return e.join("")}anchorFromUtf(e){this.anchor=encodeURIComponent(e.split(" ").join("_")).split("%3A").join(":").split("'").join("%27").split("%").join(".")}decodeNasties(e){try{let t=decodeURI(this.decodeEscapes(e));return t=t.replace(/[_ ]*$/,""),t}catch(t){return e}}decodeEscapes(e){const t=e.parenSplit(/((?:[%][0-9A-Fa-f]{2})+)/),i=t.length;if(1===i)return t[0].replace(/%(?![0-9a-fA-F][0-9a-fA-F])/g,"%25");for(let e=1;e<i;e+=2)t[e]=decodeURIComponent(t[e]);return t.join("")}hintValue(){return this.value?safeDecodeURI(this.value):""}toUserName(e){this.namespaceId()===t.nsUserId||this.namespaceId()===t.nsUsertalkId?this.value=(e?`${mw.config.get("wgFormattedNamespaces")[t.nsUserId]}:`:"")+this.stripNamespace().split("/")[0]:this.value=null}userName(e){const t=new Title(this.value);return t.toUserName(e),t.value?t:null}toTalkPage(){if(null===this.value)return null;const e=this.namespaceId();if(e>=0&&e%2==0){const t=mw.config.get("wgFormattedNamespaces")[e+1];if(void 0!==t)return this.value=""===t?this.stripNamespace():`${t.split(" ").join("_")}:${this.stripNamespace()}`,this.value}return this.value=null,null}namespace(){return mw.config.get("wgFormattedNamespaces")[this.namespaceId()]}namespaceId(){try{const e=this.value.indexOf(":");if(e<0)return 0;const t=mw.config.get("wgNamespaceIds")[this.value.substring(0,e).split(" ").join("_").toLowerCase()];return void 0===t?0:t}catch(e){return console.error(e,this),0}}talkPage(){const e=new Title(this.value);return e.toTalkPage(),e.value?e:null}isTalkPage(){return null===this.talkPage()}toArticleFromTalkPage(){if(null===this.value)return null;const e=this.namespaceId();if(e>=0&&e%2==1){const t=mw.config.get("wgFormattedNamespaces")[e-1];if(void 0!==t)return this.value=""===t?this.stripNamespace():`${t.split(" ").join("_")}:${this.stripNamespace()}`,this.value}return this.value=null,null}articleFromTalkPage(){const e=new Title(this.value);return e.toArticleFromTalkPage(),e.value?e:null}articleFromTalkOrArticle(){const e=new Title(this.value);return e.toArticleFromTalkPage()?e:this}isIpUser(){return t.re.ipUser.test(this.userName())}stripNamespace(){const e=this.value.indexOf(":");return e<0||this.namespaceId()===t.nsMainspaceId?this.value:this.value.substring(e+1)}setUtf(e){if(!e)return void(this.value="");const t=e.indexOf("#");if(t<0)return this.value=e.split("_").join(" "),void(this.anchor="")
;this.value=e.substring(0,t).split("_").join(" "),this.anchor=e.substring(t+1),this.ns=null}setUrl(e){const t=e.indexOf("#");this.value=safeDecodeURI(e.substring(0,t)),this.anchor=this.value.substring(t+1)}append(e){this.setUtf(this.value+e)}urlString(e){let t=e;t||(t={});let i=this.toString(!0);return!t.omitAnchor&&this.anchor&&(i+=`#${this.urlAnchor()}`),t.keepSpaces||(i=i.split(" ").join("_")),encodeURI(i).split("&").join("%26").split("?").join("%3F").split("+").join("%2B")}removeAnchor(){return new Title(this.toString(!0))}toUrl(){return t.wiki.titlebase+this.urlString()}fromURL(e){let i=e;if("string"!=typeof i)return this.value=null,this;const n=i.split("?");n[0]=n[0].split("&").join("%26"),i=n.join("?");const o=t.re.contribs.exec(i);if(o){"title="===o[1]&&(o[3]=o[3].split("+").join(" "));const e=new Title(o[3]);return this.setUtf(this.decodeNasties(`${mw.config.get("wgFormattedNamespaces")[t.nsUserId]}:${e.stripNamespace()}`)),this}const s=t.re.email.exec(i);if(s)return this.setUtf(this.decodeNasties(`${mw.config.get("wgFormattedNamespaces")[t.nsUserId]}:${new Title(s[3]).stripNamespace()}`)),this;const r=t.re.backlinks.exec(i);if(r)return this.setUtf(this.decodeNasties(new Title(r[3]))),this;if(t.re.specialdiff.exec(i))return this.setUtf(this.decodeNasties(new Title(`${mw.config.get("wgFormattedNamespaces")[t.nsSpecialId]}:Diff`))),this;const p=t.re.main.exec(i);if(null===p)this.value=null;else{/[?](.+[&])?title=/.test(i)&&(p[2]=p[2].split("+").join("_"));const e=p[2]+(p[3]?`#${p[3]}`:"");t.flag.isSafari&&/%25[0-9A-Fa-f]{2}/.test(e)?this.setUtf(decodeURIComponent(unescape(e))):this.setUtf(this.decodeNasties(e))}return this}fromAnchor(e){return e?this.fromURL(e.href):(this.value=null,this)}fromWikiText(e){let t=e;return t=myDecodeURI(t),this.setUtf(t),this}}"a,b,c"!=`${"abc".split(/(b)/)}`?String.prototype.parenSplit=function(e){const t=function nonGlobalRegex(e){const t=e.toString();let i="",n=t.length;for(;"/"!==t.charAt(n);--n)"g"!==t.charAt(n)&&(i+=t.charAt(n));const o=t.substring(1,n);return RegExp(o,i)}(e);let i=this,n=t.exec(i),o=[];for(;n&&i;){for(let e=0;e<n.length;++e)void 0===n[e]&&(n[e]="");o.push(i.substring(0,n.index)),o=o.concat(n.slice(1)),i=i.substring(n.index+n[0].length),n=t.exec(i)}return o.push(i),o}:(String.prototype.parenSplit=function(e){return this.split(e)},String.prototype.parenSplit.isNative=!0),String.prototype.entify=function(){return this.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;")},t.escapeQuotesHTML=function(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},t.unescapeQuotesHTML=function(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value},emptySpanHTML.classAliases={popupSecondPreview:"popupPreview"};class Previewmaker{constructor(e,t,i){this.maxCharacters=getValueOf("popupMaxPreviewCharacters"),this.maxSentences=getValueOf("popupMaxPreviewSentences"),this.originalData=e,this.baseUrl=t,this.owner=i,this.setData()}setData(){const e=Math.max(1e4,2*this.maxCharacters);this.data=this.originalData.substring(0,e)}killComments(){this.data=this.data.replace(RegExp("^\x3c!--[^$]*?--\x3e\\n|\\n\x3c!--[^$]*?--\x3e(?=\\n)|\x3c!--[^$]*?--\x3e","g"),"")}killDivs(){this.data=this.data.replace(RegExp("< *div[^>]* *>[\\s\\S]*?< */ *div *>","gi"),"")}killGalleries(){this.data=this.data.replace(RegExp("< *gallery[^>]* *>[\\s\\S]*?< */ *gallery *>","gi"),"")}kill(e,t,i,n,o){let s=this.data,r=this.killStuff(this.data,e,t,i,n,o);for(;r.length<s.length;)s=r,r=this.killStuff(r,e,t,i,n,o);this.data=r}killStuff(e,t,i,n,o,s){let r=e;const p=this.makeRegexp(t),a=this.makeRegexp(i,"^"),u=n?this.makeRegexp(n,"^"):null,l=o?this.makeRegexp(o,"^"):a;if(!p||!a)return void alert("Navigation Popups error: op or cl is null! something is wrong.");if(!p.test(r))return r;let c="";const g=p.exec(r);c=r.substring(0,g.index),r=r.substring(g.index+g[0].length);let d=1;for(;r.length>0;){let e=0;if(1===d&&a.test(r)?(d--,e=a.exec(r)[0].length):d>1&&l.test(r)?(d--,e=l.exec(r)[0].length):u&&u.test(r)&&(d++,e=u.exec(r)[0].length),e||(e=1),r=r.substring(e),0===d)break}return c+(s||"")+r}makeRegexp(e,t,i){const n=t||"",o=i||"";let s="",r="";if(isString(e))s=n+literalizeRegex(e)+o;else if(function isRegExp(e){return e instanceof RegExp}(e)){let t=e.toString().substring(1);const i=t.split("/");r=i[i.length-1],i[i.length-1]="",t=i.join("/"),t=t.substring(0,t.length-1),s=n+t+o}else log("makeRegexp failed");return log(`makeRegexp: got reStr=${s}, flags=${r}`),RegExp(s,r)}killBoxTemplates(){this.kill(RegExp("[{][{][^{}\\s|]*?(float|box)[_ ](begin|start)","i"),/[}][}]\s*/,"{{"),this.kill(RegExp("[{][{][^{}\\s|]*?(infobox|elementbox|frame)[_ ]","i"),/[}][}]\s*/,"{{")}killTemplates(){this.kill("{{","}}","{","}"," ")}killTables(){this.kill("{|",/[|]}\s*/,"{|"),this.kill(/<table.*?>/i,/<\/table.*?>/i,/<table.*?>/i),this.data=this.data.replace(RegExp("^[|].*$","mg"),"")}killImages(){const e=[];jQuery.each(mw.config.get("wgNamespaceIds"),(i,n)=>{n!==t.nsImageId&&n!==t.nsCategoryId||e.push(i.split(" ").join("[ _]"))}),this.kill(RegExp(`[[][[]\\s*(${e.join("|")})\\s*:`,"i"),/\]\]\s*/,"[","]")}killHTML(){this.kill(/<ref\b[^/>]*?>/i,/<\/ref>/i),this.data=this.data.replace(RegExp("(^|\\n) *<.*","g"),"\n");const e=this.data.parenSplit(/(<[\w\W]*?(?:>|$|(?=<)))/),t=e.length;for(let i=1;i<t;i+=2)switch(e[i]){case"<nowiki>":case"</nowiki>":case"<blockquote>":case"</blockquote>":break;default:e[i]=""}this.data=e.join("")}killChunks(){const e=new RegExp("((^|\\n)\\s*:*\\s*''[^']([^']|'''|'[^']){20}(.|\\n[^\\n])*''[.!?\\s]*\\n)+","g");this.data=this.data.replace(e,"\n")}mopup(){this.data=this.data.replace(RegExp("^-{4,}","mg"),""),this.data=this.data.replace(RegExp("(^|\\n) *:[^\\n]*","g"),""),this.data=this.data.replace(RegExp("^__[A-Z_]*__ *$","gmi"),"")}firstBit(){let e=this.data;if(getValueOf("popupPreviewCutHeadings")){this.data=this.data.replace(RegExp("\\s*(==+[^=]*==+)\\s*","g"),"\n\n$1 "),this.data=this.data.replace(RegExp("([:;]) *\\n{2,}","g"),"$1\n"),this.data=this.data.replace(RegExp("^[\\s\\n]*"),"");const t=RegExp("^([^\\n]|\\n[^\\n\\s])*").exec(this.data);t&&(e=t[0]),getValueOf("popupPreviewFirstParOnly")||(e=this.data),e=e.replace(RegExp("(==+[^=]*==+)\\s*","g"),"$1\n\n")}e=e.parenSplit(RegExp("([!?.]+[\"']*\\s)","g")),e[0]=e[0].replace(RegExp("^\\s*"),"");const t=RegExp("([^.][a-z][.] *[a-z]|etc|sic|Dr|Mr|Mrs|Ms|St|no|op|cit|\\[[^\\]]*|\\s[A-Zvclm])$","i");e=this.fixSentenceEnds(e,t),this.fullLength=e.join("").length;let i=this.maxSentences,n=this.firstSentences(e,i);do{n=this.firstSentences(e,i),--i}while(n.length>this.maxCharacters&&0!==i);this.data=n}fixSentenceEnds(e,t){for(let i=0;i<e.length-2;++i)if(t.test(e[i])){const n=[];for(let t=0;t<e.length;++t)t<i&&(n[t]=e[t]),t===i&&(n[i]=e[i]+e[i+1]+e[i+2]),t>i+2&&(n[t-2]=e[t]);return this.fixSentenceEnds(n,t)}return e}firstSentences(e,t){return e.slice(0,2*t).join("")}killBadWhitespace(){this.data=this.data.replace(RegExp("^ *'+ *$","gm"),"")}makePreview(){this.owner.article.namespaceId()!==t.nsTemplateId&&this.owner.article.namespaceId()!==t.nsImageId?(this.killComments(),this.killDivs(),this.killGalleries(),this.killBoxTemplates(),getValueOf("popupPreviewKillTemplates")?this.killTemplates():this.killMultilineTemplates(),this.killTables(),this.killImages(),this.killHTML(),this.killChunks(),this.mopup(),this.firstBit(),this.killBadWhitespace()):this.killHTML(),this.html=wiki2html(this.data,this.baseUrl),this.fixHTML(),this.stripLongTemplates()}esWiki2HtmlPart(e){const n=/(?:\[\[([^|\]]*)(?:\|([^|\]]*))*]]([a-z]*))/gi;n.lastIndex=0;let o="",s=0,r=n.exec(e);for(;r;)o+=`${t.escapeQuotesHTML(e.substring(s,r.index))}<a href="${i.conf.paths.articles}${t.escapeQuotesHTML(r[1])}">${t.escapeQuotesHTML((r[2]?r[2]:r[1])+r[3])}</a>`,s=n.lastIndex,r=n.exec(e);return o+=t.escapeQuotesHTML(e.substring(s)),o}editSummaryPreview(){const e=/\/\* *(.*?) *\*\//g;e.lastIndex=0;const n=e.exec(this.data);if(n){const o=this.data.substring(0,n.index-1),s=n[1],r=this.data.substring(e.lastIndex);let p="<span class='autocomment'>",a="</span>";o.length>0&&(p=`${this.esWiki2HtmlPart(o)} ${p}- `),r.length>0&&(a=`: ${a}${this.esWiki2HtmlPart(r)}`);const u=(new Title).fromURL(this.baseUrl);return u.anchorFromUtf(s),`${p}<a href="${i.conf.paths.articles+t.escapeQuotesHTML(u.toString(!0))}#${t.escapeQuotesHTML(u.anchor)}">&rarr;</a> ${t.escapeQuotesHTML(s)}${a}`}return this.esWiki2HtmlPart(this.data)}fixHTML(){if(!this.html)return;let e=this.html;e=e.replace(RegExp(`(<a href="${t.wiki.articlePath}/[^"]*)[?](.*?")`,"g"),"$1%3F$2"),e=e.replace(RegExp(`(<a href='${t.wiki.articlePath}/[^']*)[?](.*?')`,"g"),"$1%3F$2"),this.html=e}showPreview(){this.makePreview(),"string"==typeof this.html&&(RegExp("^\\s*$").test(this.html)||(setPopupHTML("<hr />","popupPrePreviewSep",this.owner.idNumber),setPopupTipsAndHTML(this.html,"popupPreview",this.owner.idNumber,{owner:this.owner}),setPopupHTML(this.fullLength>this.data.length?this.moreLink():"","popupPreviewMore",this.owner.idNumber)))}moreLink(){const e=document.createElement("a");e.className="popupMoreLink",e.innerHTML=popupString("more...");const t=this;return e.onclick=function(){t.maxCharacters+=2e3,t.maxSentences+=20,t.setData(),t.showPreview()},e}stripLongTemplates(){this.html=this.html.replace(RegExp("^.{0,1000}[{][{][^}]*?(<(p|br)( /)?>\\s*){2,}([^{}]*?[}][}])?","gi"),""),this.html=this.html.split("\n").join(" "),this.html=this.html.replace(RegExp("[{][{][^}]*<pre>[^}]*[}][}]","gi"),"")}killMultilineTemplates(){this.kill("{{{","}}}"),this.kill(RegExp("\\s*[{][{][^{}]*\\n"),"}}","{{")}}t.fn.APIsharedImagePagePreviewHTML=function APIsharedImagePagePreviewHTML(e){log("APIsharedImagePagePreviewHTML");const i=e.requestid;if(e.query&&e.query.pages){const n=anyChild(e.query.pages),o=n&&n.revisions&&"wikitext"===n.revisions[0].contentmodel?n.revisions[0].content:null;if("string"==typeof o&&t&&t.current&&t.current.link&&t.current.link.navpopup){const e=new Previewmaker(o,t.current.link.navpopup.article,t.current.link.navpopup);e.makePreview(),setPopupHTML(e.html,"popupSecondPreview",i)}}};class Navpopup{constructor(){this.uid=Navpopup.uid++,this.visible=!1,this.noshow=!1,this.hooks={
create:[],unhide:[],hide:[]},this.hookIds={},this.downloads=[],this.pending=null,this.fuzz=5,this.constrained=!0,this.width=0,this.height=0,this.mainDiv=null,this.createMainDiv()}isVisible(){return this.visible}reposition(e,t,i){log(`reposition(${e},${t},${i})`),null!=e&&(this.left=e),null!=t&&(this.top=t),void 0!==this.left&&void 0!==this.top&&(this.mainDiv.style.left=`${this.left}px`,this.mainDiv.style.top=`${this.top}px`),i||this.limitHorizontalPosition()}limitHorizontalPosition(){if(!this.constrained||this.tooWide)return;this.updateDimensions();const e=this.left,t=this.width,i=document.body.clientWidth;if(e+t>=i||e>0&&this.maxWidth&&this.width<this.maxWidth&&this.height>this.width&&e>i-this.maxWidth){this.mainDiv.style.left="-10000px",this.mainDiv.style.width=`${this.maxWidth}px`;const e=parseInt(this.mainDiv.offsetWidth,10);let t=i-e-1;t<0&&(t=0,this.tooWide=!0),log(`limitHorizontalPosition: moving to (${t},${this.top}); naturalWidth=${e}, clientWidth=${i}`),this.reposition(t,null,!0)}}raise(){this.mainDiv.style.zIndex=Navpopup.highest+1,++Navpopup.highest}show(){this.noshow||(this.reposition(),this.raise(),this.unhide())}showSoonIfStable(e){log(`showSoonIfStable, time=${e}`),this.visible||(this.noshow=!1,this.stable_x=-1e4,this.stable_y=-1e4,this.showSoonStableTimer=setInterval(()=>{log("stableShow called");const e=Navpopup.tracker.x,t=Navpopup.tracker.y,i=this.stable_x-e,n=this.stable_y-t;if(i*i<=0&&n*n<=0)return log("mouse is stable"),clearInterval(this.showSoonStableTimer),this.reposition.bind(this)(e+2,t+2),this.show.bind(this)(),void this.limitHorizontalPosition.bind(this)();this.stable_x=e,this.stable_y=t},e/2))}banish(){log("banish called"),this.noshow=!0,this.showSoonStableTimer&&(log("clearing showSoonStableTimer"),clearInterval(this.showSoonStableTimer)),this.hide()}runHooks(e,t){if(!this.hooks[e])return;const i=this.hooks[e],n=i.length;for(let e=0;e<n;++e)i[e]&&i[e].when===t&&i[e].hook.bind(this)()&&(i[e].hookId&&Reflect.deleteProperty(this.hookIds,i[e].hookId),i[e]=null)}addHook(e,t,i,n){const o=i||"after";if(!this.hooks[t])return;let s=null;if(n){if(s=[t,o,n].join("|"),this.hookIds[s])return;this.hookIds[s]=!0}this.hooks[t].push({hook:e,when:o,hookId:s})}createMainDiv(){if(this.mainDiv)return;this.runHooks("create","before");const e=document.createElement("div"),t=this;e.onclick=function(e){t.onclickHandler(e)},e.className=this.className?this.className:"navpopup_maindiv",e.id=e.className+this.uid,e.style.position="absolute",e.style.minWidth="350px",e.style.display="none",e.className="navpopup",e.navpopup=this,this.mainDiv=e,document.body.appendChild(e),this.runHooks("create","after")}onclickHandler(){this.raise()}makeDraggable(e){this.mainDiv||this.createMainDiv();const t=new Drag;let i;e||(t.startCondition=function(e){try{if(!e.shiftKey)return!1}catch(e){return!1}return!0}),e&&(i=document.getElementById(e)),i||(i=this.mainDiv);const n=this;t.endHook=function(e,t){Navpopup.tracker.dirty=!0,n.reposition(e,t)},t.init(i,this.mainDiv)}hide(){this.runHooks("hide","before"),this.abortDownloads(),void 0!==this.visible&&this.visible&&(this.mainDiv.style.display="none",this.visible=!1),this.runHooks("hide","after")}unhide(){this.runHooks("unhide","before"),void 0===this.visible||this.visible||(this.mainDiv.style.display="inline",this.visible=!0),this.runHooks("unhide","after")}setInnerHTML(e){this.mainDiv.innerHTML=e}updateDimensions(){this.width=parseInt(this.mainDiv.offsetWidth,10),this.height=parseInt(this.mainDiv.offsetHeight,10)}isWithin(e,t){if(!this.visible)return!1;this.updateDimensions();const i=this.fuzz||0;return e+i>=this.left&&e-i<=this.left+this.width&&t+i>=this.top&&t-i<=this.top+this.height}addDownload(e){e&&this.downloads.push(e)}abortDownloads(){for(let e=0;e<this.downloads.length;++e){const t=this.downloads[e];t&&t.abort&&t.abort()}this.downloads=[]}}Navpopup.uid=0,Navpopup.highest=1e3,Navpopup.tracker=new class Mousetracker{constructor(){this.loopDelay=400,this.timer=null,this.active=!1,this.dirty=!0,this.hooks=[]}addHook(e){this.hooks.push(e)}runHooks(){if(!this.hooks||!this.hooks.length)return;let e=!1;const t={},i=this.x,n=this.y,o=this.hooks.length;for(let s=0;s<o;++s)!0===this.hooks[s](i,n)&&(e=!0,t[s]=!0);e&&this.removeHooks(t)}removeHooks(e){const t=[],i=this.hooks.length;for(let n=0;n<i;++n)e[n]||t.push(this.hooks[n]);this.hooks=t}track(e){let t,i,n=e;if(n||(n=window.event),n){if(n.pageX)t=n.pageX,i=n.pageY;else{if(void 0===n.clientX)return;{let e,o;const s=document.documentElement;s&&(e=s.scrollLeft),e||(e=document.body.scrollLeft||document.scrollLeft||0),s&&(o=s.scrollTop),o||(o=document.body.scrollTop||document.scrollTop||0),t=n.clientX+e,i=n.clientY+o}}this.setPosition(t,i)}}setPosition(e,t){if(this.x=e,this.y=t,this.dirty||0===this.hooks.length)return void(this.dirty=!1);"number"!=typeof this.lastHook_x&&(this.lastHook_x=-100,this.lastHook_y=-100);let i=(this.lastHook_x-e)*(this.lastHook_y-t);i=i>=0?i:-i,i>1&&(this.lastHook_x=e,this.lastHook_y=t,this.dirty?this.dirty=!1:this.runHooks())}enable(){if(this.active)return;this.active=!0,this.savedHandler=document.onmousemove;const e=this;document.onmousemove=function(t){e.track.bind(e)(t)},this.loopDelay&&(this.timer=setInterval(()=>{e.runHooks()},this.loopDelay))}disable(){this.active&&("function"==typeof this.savedHandler?document.onmousemove=this.savedHandler:Reflect.deleteProperty(document,"onmousemove"),this.timer&&clearInterval(this.timer),this.active=!1)}};const n=RegExp("^(constructor|prototype|__((define|lookup)[GS]etter)__|eval|hasOwnProperty|propertyIsEnumerable|to(Source|String|LocaleString)|(un)?watch|valueOf)$");diffBugAlert.list={};class NavlinkTag{constructor(){this.type="navlinkTag"}html(){this.getNewWin(),this.getPrintFunction();let e,t,i="";const n="span";return e=`<${n} class="popup_${this.id}">`,t=`</${n}>`,"function"!=typeof this.print?errlog(`Oh dear - invalid print function for a navlinkTag, id=${this.id}`):(i=this.print(this),"string"!=typeof i?i="":void 0!==this.shortcut&&(i=addPopupShortcut(i,this.shortcut))),e+i+t}getNewWin(){getValueOf("popupLinksNewWindow"),void 0===t.option.popupLinksNewWindow[this.id]&&(this.newWin=null),this.newWin=t.option.popupLinksNewWindow[this.id]}getPrintFunction(){if("string"==typeof this.id&&"object"==typeof this.article){switch(this.noPopup=1,this.id){case"contribs":case"history":case"whatLinksHere":case"userPage":case"monobook":case"userTalk":case"talk":case"article":case"lastEdit":this.noPopup=null}switch(this.id){case"email":case"contribs":case"block":case"unblock":case"userlog":case"userSpace":case"deletedContribs":this.article=this.article.userName()}switch(this.id){case"userTalk":case"newUserTalk":case"editUserTalk":case"userPage":case"monobook":case"editMonobook":case"blocklog":this.article=this.article.userName(!0);case"pagelog":case"deletelog":case"protectlog":Reflect.deleteProperty(this,"oldid")}switch("editMonobook"!==this.id&&"monobook"!==this.id||this.article.append("/monobook.js"),"mainlink"!==this.id&&(this.article=this.article.removeAnchor()),this.id){case"undelete":this.print=specialLink,this.specialpage="Undelete",this.sep="/";break;case"whatLinksHere":this.print=specialLink,this.specialpage="Whatlinkshere";break;case"relatedChanges":this.print=specialLink,this.specialpage="Recentchangeslinked";break;case"move":this.print=specialLink,this.specialpage="Movepage";break;case"contribs":this.print=specialLink,this.specialpage="Contributions";break;case"deletedContribs":this.print=specialLink,this.specialpage="Deletedcontributions";break;case"email":this.print=specialLink,this.specialpage="EmailUser",this.sep="/";break;case"block":this.print=specialLink,this.specialpage="Blockip",this.sep="&ip=";break;case"unblock":this.print=specialLink,this.specialpage="Ipblocklist",this.sep="&action=unblock&ip=";break;case"userlog":this.print=specialLink,this.specialpage="Log",this.sep="&user=";break;case"blocklog":this.print=specialLink,this.specialpage="Log",this.sep="&type=block&page=";break;case"pagelog":this.print=specialLink,this.specialpage="Log",this.sep="&page=";break;case"protectlog":this.print=specialLink,this.specialpage="Log",this.sep="&type=protect&page=";break;case"deletelog":this.print=specialLink,this.specialpage="Log",this.sep="&type=delete&page=";break;case"userSpace":this.print=specialLink,this.specialpage="PrefixIndex",this.sep="&namespace=2&prefix=";break;case"search":this.print=specialLink,this.specialpage="Search",this.sep="&fulltext=Search&search=";break;case"thank":this.print=specialLink,this.specialpage="Thanks",this.sep="/",this.article.value="prev"!==this.diff?this.diff:this.oldid;break;case"unwatch":case"watch":this.print=magicWatchLink,this.action=`${this.id}&autowatchlist=1&autoimpl=${popupString("autoedit_version")}&actoken=${autoClickToken()}`;break;case"history":case"historyfeed":case"unprotect":case"protect":this.print=wikiLink,this.action=this.id;break;case"delete":if(this.print=wikiLink,this.action="delete",this.article.namespaceId()===t.nsImageId){const e=this.article.stripNamespace();this.action+=`&image=${e}`}break;case"markpatrolled":case"edit":Reflect.deleteProperty(this,"oldid");case"view":case"purge":case"render":this.print=wikiLink,this.action=this.id;break;case"raw":this.print=wikiLink,this.action="raw";break;case"new":this.print=wikiLink,this.action="edit&section=new";break;case"mainlink":if(void 0===this.text&&(this.text=this.article.toString().entify()),getValueOf("popupSimplifyMainLink")&&function isInStrippableNamespace(e){return 0!==e.namespaceId()}(this.article)){const e=this.text.split("/");this.text=e[e.length-1],""===this.text&&e.length>1&&(this.text=e[e.length-2])}this.print=titledWikiLink,void 0===this.title&&t.current.link&&void 0!==t.current.link.href&&(this.title=safeDecodeURI(t.current.link.originalTitle?t.current.link.originalTitle:this.article),void 0!==this.oldid&&this.oldid&&(this.title=tprintf("Revision %s of %s",[this.oldid,this.title]))),this.action="view";break;case"userPage":case"article":case"monobook":case"editMonobook":case"editArticle":Reflect.deleteProperty(this,"oldid"),this.article=this.article.articleFromTalkOrArticle(),this.print=wikiLink,0===this.id.indexOf("edit")?this.action="edit":this.action="view";break
;case"userTalk":case"talk":this.article=this.article.talkPage(),Reflect.deleteProperty(this,"oldid"),this.print=wikiLink,this.action="view";break;case"arin":this.print=arinLink;break;case"count":this.print=editCounterLink;break;case"google":this.print=googleLink;break;case"editors":this.print=editorListLink;break;case"globalsearch":this.print=globalSearchLink;break;case"lastEdit":this.print=titledDiffLink,this.title=popupString("Show the last edit"),this.from="prev",this.to="cur";break;case"oldEdit":this.print=titledDiffLink,this.title=`${popupString("Show the edit made to get revision")} ${this.oldid}`,this.from="prev",this.to=this.oldid;break;case"editOld":this.print=wikiLink,this.action="edit";break;case"undo":this.print=wikiLink,this.action="edit&undo=";break;case"revert":this.print=wikiLink,this.action="revert";break;case"nullEdit":this.print=wikiLink,this.action="nullEdit";break;case"diffCur":this.print=titledDiffLink,this.title=tprintf("Show changes since revision %s",[this.oldid]),this.from=this.oldid,this.to="cur";break;case"editUserTalk":case"editTalk":Reflect.deleteProperty(this,"oldid"),this.article=this.article.talkPage(),this.action="edit",this.print=wikiLink;break;case"newUserTalk":case"newTalk":this.article=this.article.talkPage(),this.action="edit&section=new",this.print=wikiLink;break;case"lastContrib":case"sinceMe":this.print=magicHistoryLink;break;case"togglePreviews":this.text=popupString(t.option.simplePopups?"enable previews":"disable previews");case"disablePopups":case"purgePopups":this.print=popupMenuLink;break;default:this.print=function(){return`Unknown navlink type: ${this.id}`}}}}}t.fn.getLastContrib=function getLastContrib(e,i){getHistoryInfo(e,n=>{!function processLastContribInfo(e,i){e.edits&&e.edits.length?e.firstNewEditor?displayUrl(`${t.wiki.titlebase+new Title(i.page).urlString()}&diff=cur&oldid=${e.firstNewEditor.oldid}`,i.newWin):alert(tprintf("Only found one editor: %s made %s edits",[e.edits[0].editor,e.edits.length])):alert("Popups: an odd thing happened. Please retry.")}(n,{page:e,newWin:i})})},t.fn.getDiffSinceMyEdit=function getDiffSinceMyEdit(e,i){getHistoryInfo(e,n=>{!function processDiffSinceMyEdit(e,i){if(!e.edits||!e.edits.length)return void alert("Popups: something fishy happened. Please try again.");const n=i.page.split("_").join(" ");e.myLastEdit?0!==e.myLastEdit.index?displayUrl(`${t.wiki.titlebase+new Title(i.page).urlString()}&diff=cur&oldid=${e.myLastEdit.oldid}`,i.newWin):alert(tprintf("%s seems to be the last editor to the page %s",[e.userName,n])):alert(tprintf("Couldn't find an edit by %s\nin the last %s edits to\n%s",[e.userName,getValueOf("popupHistoryLimit"),n]))}(n,{page:e,newWin:i})})},t.fn.purgePopups=function purgePopups(){processAllPopups(!0),setupCache(),t.option={},abortAllDownloads()},t.fn.disablePopups=function disablePopups(){processAllPopups(!1,!0),setupTooltips(null,!0)},t.fn.togglePreviews=function togglePreviews(){processAllPopups(!0,!0),t.option.simplePopups=!t.option.simplePopups,abortAllDownloads()},t.fn.modifyWatchlist=async function modifyWatchlist(e,t){const i={action:"watch",formatversion:2,titles:e,uselang:mw.config.get("wgUserLanguage")};"unwatch"===t&&(i.unwatch=!0);const n=mw.Title.newFromText(e);let o;o=n&&n.getNamespaceId()>0&&n.getNamespaceId()%2==1?"watch"===t?"addedwatchtext-talk":"removedwatchtext-talk":"watch"===t?"addedwatchtext":"removedwatchtext",await Promise.all([getMwApi().postWithToken("watch",i),getMwApi().loadMessagesIfMissing([o])]),mw.notify(mw.message(o,e).parseDom())},t.string={article:"article",category:"category",categories:"categories",image:"image",images:"images",stub:"stub","section stub":"section stub","Empty page":"Empty page",kB:"kB",bytes:"bytes",day:"day",days:"days",hour:"hour",hours:"hours",minute:"minute",minutes:"minutes",second:"second",seconds:"seconds",week:"week",weeks:"weeks",search:"search",SearchHint:"Find English Wikipedia articles containing %s",web:"web",global:"global",globalSearchHint:"Search across Wikipedias in different languages for %s",googleSearchHint:"Google for %s",actions:"actions",popupsMenu:"popups",togglePreviewsHint:"Toggle preview generation in popups on this page","enable previews":"enable previews","disable previews":"disable previews","toggle previews":"toggle previews","show preview":"show preview",reset:"reset","more...":"more...",disable:"disable popups",disablePopupsHint:"Disable popups on this page. Reload page to re-enable.",historyfeedHint:"RSS feed of recent changes to this page",purgePopupsHint:"Reset popups, clearing all cached popup data.",PopupsHint:"Reset popups, clearing all cached popup data.",spacebar:"space",view:"view","view article":"view article",viewHint:"Go to %s",talk:"talk","talk page":"talk page","this&nbsp;revision":"this&nbsp;revision","revision %s of %s":"revision %s of %s","Revision %s of %s":"Revision %s of %s","the revision prior to revision %s of %s":"the revision prior to revision %s of %s","Toggle image size":"Click to toggle image size",del:"del",delete:"delete",deleteHint:"Delete %s",undeleteShort:"un",UndeleteHint:"Show the deletion history for %s",protect:"protect",protectHint:"Restrict editing rights to %s",unprotectShort:"un",unprotectHint:"Allow %s to be edited by anyone again","send thanks":"send thanks",ThanksHint:"Send a thank you notification to this user",move:"move","move page":"move page",MovepageHint:"Change the title of %s",edit:"edit","edit article":"edit article",editHint:"Change the content of %s","edit talk":"edit talk",new:"new","new topic":"new topic",newSectionHint:"Start a new section on %s","null edit":"null edit",nullEditHint:"Submit an edit to %s, making no changes ",hist:"hist",history:"history",historyHint:"List the changes made to %s",last:"prev",lastEdit:"lastEdit","mark patrolled":"mark patrolled",markpatrolledHint:"Mark this edit as patrolled","Could not marked this edit as patrolled":"Could not marked this edit as patrolled","show last edit":"most recent edit","Show the last edit":"Show the effects of the most recent change",lastContrib:"lastContrib","last set of edits":"latest edits",lastContribHint:"Show the net effect of changes made by the last editor",cur:"cur",diffCur:"diffCur","Show changes since revision %s":"Show changes since revision %s","%s old":"%s old",oldEdit:"oldEdit",purge:"purge",purgeHint:"Demand a fresh copy of %s",raw:"source",rawHint:"Download the source of %s",render:"simple",renderHint:"Show a plain HTML version of %s","Show the edit made to get revision":"Show the edit made to get revision",sinceMe:"sinceMe","changes since mine":"diff my edit",sinceMeHint:"Show changes since my last edit","Couldn't find an edit by %s\nin the last %s edits to\n%s":"Couldn't find an edit by %s\nin the last %s edits to\n%s",eds:"eds",editors:"editors",editorListHint:"List the users who have edited %s",related:"related",relatedChanges:"relatedChanges","related changes":"related changes",RecentchangeslinkedHint:"Show changes in articles related to %s",editOld:"editOld",rv:"rv",revert:"revert",revertHint:"Revert to %s",defaultpopupReviewedSummary:"Accepted by reviewing the [[Special:diff/%s/%s|difference]] between this version and previously accepted version using [[:en:Wikipedia:Tools/Navigation_popups|popups]]",defaultpopupRedlinkSummary:"Removing link to empty page [[%s]] using [[:en:Wikipedia:Tools/Navigation_popups|popups]]",defaultpopupFixDabsSummary:"Disambiguate [[%s]] to [[%s]] using [[:en:Wikipedia:Tools/Navigation_popups|popups]]",defaultpopupFixRedirsSummary:"Redirect bypass from [[%s]] to [[%s]] using [[:en:Wikipedia:Tools/Navigation_popups|popups]]",defaultpopupExtendedRevertSummary:"Revert to revision dated %s by %s, oldid %s using [[:en:Wikipedia:Tools/Navigation_popups|popups]]",defaultpopupRevertToPreviousSummary:"Revert to the revision prior to revision %s using [[:en:Wikipedia:Tools/Navigation_popups|popups]]",defaultpopupRevertSummary:"Revert to revision %s using [[:en:Wikipedia:Tools/Navigation_popups|popups]]",defaultpopupQueriedRevertToPreviousSummary:"Revert to the revision prior to revision $1 dated $2 by $3 using [[:en:Wikipedia:Tools/Navigation_popups|popups]]",defaultpopupQueriedRevertSummary:"Revert to revision $1 dated $2 by $3 using [[:en:Wikipedia:Tools/Navigation_popups|popups]]",defaultpopupRmDabLinkSummary:"Remove link to dab page [[%s]] using [[:en:Wikipedia:Tools/Navigation_popups|popups]]",Redirects:"Redirects"," to ":" to ","Bypass redirect":"Bypass redirect","Fix this redirect":"Fix this redirect",disambig:"disambig",disambigHint:"Disambiguate this link to [[%s]]","Click to disambiguate this link to:":"Click to disambiguate this link to:","remove this link":"remove this link","remove all links to this page from this article":"remove all links to this page from this article","remove all links to this disambig page from this article":"remove all links to this disambig page from this article",mainlink:"mainlink",wikiLink:"wikiLink",wikiLinks:"wikiLinks","links here":"links here",whatLinksHere:"whatLinksHere","what links here":"what links here",WhatlinkshereHint:"List the pages that are hyperlinked to %s",unwatchShort:"un",watchThingy:"watch",watchHint:"Add %s to my watchlist",unwatchHint:"Remove %s from my watchlist","Only found one editor: %s made %s edits":"Only found one editor: %s made %s edits","%s seems to be the last editor to the page %s":"%s seems to be the last editor to the page %s",rss:"rss","Diff truncated for performance reasons":"Diff truncated for performance reasons","Old revision":"Old revision","New revision":"New revision","Something went wrong :-(":"Something went wrong :-(","Empty revision, maybe non-existent":"Empty revision, maybe non-existent","Unknown date":"Unknown date","Empty category":"Empty category","Category members (%s shown)":"Category members (%s shown)","No image links found":"No image links found","File links":"File links","No image found":"No image found","Image from Commons":"Image from Commons","Description page":"Description page","Alt text:":"Alt text:",revdel:"Hidden revision",user:"user","user&nbsp;page":"user&nbsp;page","user talk":"user talk","edit user talk":"edit user talk","leave comment":"leave comment",email:"email",
"email user":"email user",EmailuserHint:"Send an email to %s",space:"space",PrefixIndexHint:"Show pages in the userspace of %s",count:"count","edit counter":"edit counter",editCounterLinkHint:"Count the contributions made by %s",contribs:"contribs",contributions:"contributions",deletedContribs:"deleted contributions",DeletedcontributionsHint:"List deleted edits made by %s",ContributionsHint:"List the contributions made by %s",log:"log","user log":"user log",userLogHint:"Show %s's user log",arin:"ARIN lookup","Look up %s in ARIN whois database":"Look up %s in the ARIN whois database",unblockShort:"un",block:"block","block user":"block user",IpblocklistHint:"Unblock %s",BlockipHint:"Prevent %s from editing","block log":"block log",blockLogHint:"Show the block log for %s",protectLogHint:"Show the protection log for %s",pageLogHint:"Show the page log for %s",deleteLogHint:"Show the deletion log for %s","Invalid %s %s":"The option %s is invalid: %s","No backlinks found":"No backlinks found"," and more":" and more",undo:"undo",undoHint:"undo this edit","Download preview data":"Download preview data","Invalid or IP user":"Invalid or IP user","Not a registered username":"Not a registered username",BLOCKED:"BLOCKED","Has blocks":"Has blocks"," edits since: ":" edits since: ","last edit on ":"last edit on ","Enter a non-empty edit summary or press cancel to abort":"Enter a non-empty edit summary or press cancel to abort","Failed to get revision information, please edit manually.\n\n":"Failed to get revision information, please edit manually.\n\n","The %s button has been automatically clicked. Please wait for the next page to load.":"The %s button has been automatically clicked. Please wait for the next page to load.","Could not find button %s. Please check the settings in your javascript file.":"Could not find button %s. Please check the settings in your javascript file.","Open full-size image":"Open full-size image",zxy:"zxy",autoedit_version:"np20140416"},localStorage.removeItem("popupNoTranslation");const o=new Set;window.popupNoTranslation=o,"complete"===document.readyState?run():$(window).on("load",run),function(){function dynamicContentHandler(i){"mw-content-text"===i.attr("id")&&e?e=!1:setupPopups(function doIt(){!function registerHooksForVisibleNavpops(){for(let e=0;t.current.links&&e<t.current.links.length;++e){const i=t.current.links[e].navpopup;i&&i.isVisible()&&Navpopup.tracker.addHook(posCheckerHook(i))}}(),i.each(function(){this.ranSetupTooltipsAlready=!1,setupTooltips(this)})})}let e=!0;mw.hook("wikipage.content").add(dynamicContentHandler),mw.hook("ext.echo.overlay.beforeShowingOverlay").add(e=>{dynamicContentHandler(e.find(".mw-echo-state"))})}()}); 

/* </pre> */