resources/dist/mobile.common.js
(self.webpackChunkmfModules=self.webpackChunkmfModules||[]).push([[569],{"./src/mobile.init/fakeToolbar.js":(t,e,n)=>{var i=n("./src/mobile.startup/icons.js");t.exports=function(){var t=i.cancel().$el,e=i.spinner({tagName:"span",isIconOnly:!1,label:mw.msg("mobile-frontend-editor-loading")}).$el;return $("<div>").addClass("ve-mobile-fakeToolbar-container").append($("<div>").addClass("ve-mobile-fakeToolbar-header").addClass("overlay-header").append($("<div>").addClass("ve-mobile-fakeToolbar").append(t,e)))}},"./src/mobile.startup/Anchor.js":(t,e,n)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}function s(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}function a(t,e,n){return e=l(e),function(t,e){if(e&&("object"==i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(o=function(){return!!t})()}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}var u=n("./src/mobile.startup/View.js"),p=n("./src/mobile.startup/util.js"),d=function(t){"use strict";function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(e,t),n=e,(i=[{key:"isTemplateMode",get:function(){return!0}},{key:"defaults",get:function(){return{progressive:void 0,destructive:void 0,additionalClassNames:"",href:void 0,label:void 0}}},{key:"template",get:function(){return p.template('\n<a {{#href}}href="{{href}}"{{/href}} class="mw-mf-anchor\n\t{{#progressive}} mw-mf-anchor-progressive{{/progressive}}\n\t{{#destructive}} mw-mf-anchor-destructive{{/destructive}}\n\t {{additionalClassNames}}">{{label}}</a>\n\t')}}])&&r(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(u);t.exports=d},"./src/mobile.startup/Browser.js":(t,e,n)=>{var i,r=n("./src/mobile.startup/util.js");function s(t){var e=function(){var n=this["__cache"+e.cacheId]||(this["__cache"+e.cacheId]={}),i=[].join.call(arguments,"|");return Object.prototype.hasOwnProperty.call(n,i)?n[i]:n[i]=t.apply(this,arguments)};return e.cacheId=Date.now().toString()+Math.random().toString(),e}function a(t,e){this.userAgent=t,this.$el=e}a.prototype={isIos:s((function(t){var e=this.userAgent,n=/ipad|iphone|ipod/i.test(e);if(!n||!t)return n;switch(t){case 8:return/OS 8_/.test(e)||/Version\/8/.test(e);case 4:return/OS 4_/.test(e);case 5:return/OS 5_/.test(e);default:return!1}})),isWideScreen:s((function(){var t=parseInt(mw.config.get("wgMFDeviceWidthTablet"),10);return window.innerWidth>=t})),supportsTouchEvents:s((function(){return"ontouchstart"in window}))},a.getSingleton=function(){var t;return i||(t=r.getDocument(),i=new a(window.navigator.userAgent,t)),i},t.exports=a},"./src/mobile.startup/Button.js":(t,e,n)=>{var i=n("./src/mobile.startup/mfExtend.js"),r=n("./src/mobile.startup/util.js"),s=n("./src/mobile.startup/View.js"),a=n("./src/mobile.startup/IconButton.js");function o(t){s.call(this,t)}i(o,s,{preRender:function(){var t="default";this.options.progressive?t="progressive":this.options.destructive&&(t="destructive");var e=this.options.quiet?"quiet":"normal";(this.options.progressive||this.options.destructive)&&(e="primary"),this.options.block&&(this.options.additionalClassNames+=" mf-button-block");var n=r.extend({weight:e,action:t,isIconOnly:!1,icon:null},this.options);this._button=new a(n),this.options._buttonHTML=this._button.$el.get(0).outerHTML},isTemplateMode:!0,defaults:{tagName:"a",disabled:!1,block:void 0,progressive:void 0,destructive:void 0,quiet:void 0,additionalClassNames:"",href:void 0,label:void 0,size:"medium"},template:r.template("{{{_buttonHTML}}}")}),t.exports=o},"./src/mobile.startup/CtaDrawer.js":(t,e,n)=>{var i=n("./src/mobile.startup/Drawer.js"),r=n("./src/mobile.startup/util.js"),s=n("./src/mobile.startup/Button.js"),a=n("./src/mobile.startup/Anchor.js");function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=l(t.queryParams,t.returnTo);return new i(r.extend({children:[r.parseHTML("<p>").text(t.content),new s(r.extend({progressive:!0,href:mw.util.getUrl("Special:UserLogin",e),label:mw.msg("mobile-frontend-watchlist-cta-button-login")},t.progressiveButton)).$el,r.parseHTML("<div>").addClass("cta-drawer__anchors").append(new a(r.extend({href:mw.util.getUrl("Special:UserLogin",c(e,t.signupQueryParams)),progressive:!0,label:mw.msg("mobile-frontend-watchlist-cta-button-signup")},t.actionAnchor)).$el)]},t))}function l(t,e){return r.extend({returnto:e||mw.config.get("wgPageName")},t)}function c(){return[].push.call(arguments,{type:"signup"}),r.extend.apply(r,arguments)}o.prototype.test={redirectParams:l,signUpParams:c},t.exports=o},"./src/mobile.startup/Drawer.js":(t,e,n)=>{var i=n("./src/mobile.startup/mfExtend.js"),r=n("./src/mobile.startup/View.js"),s=n("./src/mobile.startup/util.js"),a=n("./src/mobile.startup/IconButton.js");function o(t){this.drawerClassName=t.className||"",this.collapseIcon=new a({icon:"expand",additionalClassNames:"cancel",label:mw.msg("mobile-frontend-drawer-arrow-label")}),r.call(this,s.extend({onBeforeHide:function(){},showCollapseIcon:!0},t,{className:"drawer-container"},{events:s.extend({"click .drawer-container__mask":function(){this.hide()}.bind(this),"click .cancel":function(t){t.preventDefault(),this.hide()}.bind(this),click:function(t){t.stopPropagation()}},t.events)}))}i(o,r,{$mask:null,show:function(){var t=s.Deferred();this.$el.prepend(this.$mask),this.$el.width();var e=this.$el.find(".drawer");return this.$mask.addClass("drawer-container__mask--visible"),e.hasClass("visible")?t.resolve():(e.addClass("visible"),mw.hook("mobileFrontend.loadLazyImages").fire(this.$el),this.options.onShow&&this.options.onShow(t),requestAnimationFrame((function(){return t.resolve()}))),t.promise()},hide:function(){var t=this;this.$el.find(".drawer").removeClass("visible"),this.$mask.removeClass("drawer-container__mask--visible"),setTimeout((function(){t.$mask.detach()}),100),requestAnimationFrame((function(){t.options.onBeforeHide(t)}))},postRender:function(){this.$mask=s.parseHTML("<div>").addClass("drawer-container__mask");var t=this.options,e=s.parseHTML("<div>").addClass("drawer drawer-container__drawer position-fixed ".concat(this.drawerClassName).trim());t.showCollapseIcon&&e.prepend(this.collapseIcon.$el),t.children&&e.append(t.children),this.$el.append(e)}}),t.exports=o},"./src/mobile.startup/Icon.js":(t,e,n)=>{var i=n("./src/mobile.startup/mfExtend.js"),r=n("./src/mobile.startup/util.js"),s=n("./src/mobile.startup/View.js");function a(t){s.call(this,t)}i(a,s,{preRender:function(){this.options._iconClasses=this.getIconClasses()},getRotationClass:function(){var t="";if(this.options.rotation)switch(this.options.rotation){case-180:case 180:t="mf-icon-rotate-flip";break;case-90:t="mf-icon-rotate-anti-clockwise";break;case 90:t="mf-icon-rotate-clockwise";break;case 0:break;default:throw new Error("Bad value for rotation given. Must be ±90, 0 or ±180.")}return t},getIconClasses:function(){var t=this.options.base,e=this.options.icon,n=this.options.isSmall,i=this.getRotationClass(),r=this.options.additionalClassNames,s=t+" ";return e&&(s+=this.getGlyphClassName()+" "),n&&(s+="mf-icon--small "),r&&(s+=r+" "),s+i},isTemplateMode:!0,defaults:{base:"mf-icon",glyphPrefix:null,icon:"",rotation:0,isSmall:!1,additionalClassNames:null},getClassName:function(){return this.$el.attr("class")},getGlyphClassName:function(){return this.options.glyphPrefix?"mf-icon-"+this.options.glyphPrefix+"-"+this.options.icon:"mf-icon-"+this.options.icon},template:r.template('<span class="{{_iconClasses}}"> </span>')}),t.exports=a},"./src/mobile.startup/IconButton.js":(t,e,n)=>{var i=n("./src/mobile.startup/mfExtend.js"),r=n("./src/mobile.startup/util.js"),s=n("./src/mobile.startup/View.js"),a=n("./src/mobile.startup/Icon.js");function o(t){t.href&&(t.tagName="a"),"button"===t.tagName&&(t.isTypeButton=!0),s.call(this,t)}i(o,s,{preRender:function(){this.options._buttonClasses=this.getButtonClasses(),this.options._iconHTML="",this.options.icon&&(this._icon=new a({base:this.options.base,glyphPrefix:this.options.glyphPrefix,icon:this.options.icon,rotation:this.options.rotation,isSmall:this.options.isSmall}),this.options._iconHTML=this._icon.$el.get(0).outerHTML)},getButtonClasses:function(){var t=this.options.additionalClassNames,e=this.options.size,n=this.options.weight,i=this.options.action,r=this.options.isIconOnly,s="cdx-button ";return"button"!==this.options.tagName&&(s+="cdx-button--fake-button cdx-button--fake-button--enabled "),e&&(s+="cdx-button--size-".concat(e," ")),n&&(s+="cdx-button--weight-".concat(n," ")),i&&(s+="cdx-button--action-".concat(i," ")),r&&(s+="cdx-button--icon-only "),s+t},isTemplateMode:!0,defaults:{tagName:"button",href:void 0,additionalClassNames:"",title:"",size:"large",weight:"quiet",action:"",isIconOnly:!0,disabled:!1,base:"mf-icon",icon:"",rotation:0,isSmall:!1},getClassName:function(){return this.$el.attr("class")},getIcon:function(){return this._icon},template:r.template('\n\t\t<{{tagName}}\n\t\t\ttype="button"\n\t\t\t{{#isTypeButton}}{{#disabled}}disabled{{/disabled}}{{/isTypeButton}}\n\t\t\tclass="{{_buttonClasses}}"\n\t\t\t{{#id}}id="{{id}}"{{/id}}\n\t\t\t{{#href}}href="{{href}}"{{/href}}\n\t\t\t{{#title}}title="{{title}}"{{/title}}>\n\t\t\t\t{{{_iconHTML}}}\n\t\t\t\t<span>{{label}}</span>\n\t\t</{{tagName}}>\n\t')}),t.exports=o},"./src/mobile.startup/MessageBox.js":(t,e,n)=>{var i=n("./src/mobile.startup/View.js"),r=n("./src/mobile.startup/util.js");function s(){i.apply(this,arguments)}n("./src/mobile.startup/mfExtend.js")(s,i,{isTemplateMode:!0,defaults:{},template:r.template('\n<div\n class="cdx-message cdx-message--block cdx-message--{{type}} {{className}}"\n aria-live="polite"\n>\n \x3c!-- Empty span for message icon. --\x3e\n <span class="cdx-message__icon"></span>\n \x3c!-- Div for content. --\x3e\n <div class="cdx-message__content">\n {{#heading}}<h2>{{heading}}</h2>{{/heading}}\n {{{msg}}}\n </div>\n</div>\n\t')}),t.exports=s},"./src/mobile.startup/Overlay.js":(t,e,n)=>{var i=n("./src/mobile.startup/View.js"),r=n("./src/mobile.startup/headers.js").header,s=n("./src/mobile.startup/Anchor.js"),a=n("./src/mobile.startup/util.js"),o=n("./src/mobile.startup/Browser.js").getSingleton();function l(t){this.isIos=o.isIos(),i.call(this,a.extend(!0,{headerChrome:!1,className:"overlay"},t,{events:a.extend({"click .cancel, .confirm, .initial-header .back":"onExitClick",click:function(t){return t.stopPropagation()}},t.events)}))}n("./src/mobile.startup/mfExtend.js")(l,i,{template:a.template('\n{{^noHeader}}\n<div class="overlay-header-container header-container{{#headerChrome}}\n\theader-chrome{{/headerChrome}} position-fixed">\n</div>\n{{/noHeader}}\n<div class="overlay-content">\n\t{{>content}}\n</div>\n<div class="overlay-footer-container position-fixed"></div>\n\t'),hideTimeout:null,showSpinner:function(){this.$el.find(".spinner").removeClass("hidden")},hideSpinner:function(){this.$el.find(".spinner").addClass("hidden")},postRender:function(){var t=this.options.footerAnchor;this.$overlayContent=this.$el.find(".overlay-content"),this.isIos&&this.$el.addClass("overlay-ios"),t&&this.$el.find(".overlay-footer-container").append(new s(t).$el);var e=this.options.headers||[r(this.options.heading,this.options.headerActions)];this.$el.find(".overlay-header-container").append(e)},onExitClick:function(t){var e=function(){this.hide()}.bind(this);t.preventDefault(),t.stopPropagation(),this.options.onBeforeExit?this.options.onBeforeExit(e,(function(){})):e()},show:function(){var t=a.getDocument();this.scrollTop=window.pageYOffset,t.addClass("overlay-enabled"),window.scrollTo(0,1),this.$el.addClass("visible"),null!==this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},hide:function(){var t=this;return a.getDocument().removeClass("overlay-enabled"),window.scrollTo(window.pageXOffset,this.scrollTop),this.hideTimeout=setTimeout((function(){t.$el.detach(),t.hideTimeout=null}),0),this.emit("hide"),!0},showHidden:function(t){this.$el.find(".hideable").addClass("hidden"),this.$el.find(t).removeClass("hidden")}}),l.make=function(t,e){var n=new l(t);return n.$el.find(".overlay-content").append(e.$el),n},t.exports=l},"./src/mobile.startup/OverlayManager.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=null,s="MobileFrontend OverlayManager was here!";function a(t,e){t.on("route",this._checkRoute.bind(this)),this.router=t,this.entries={},this.stack=[],this.hideCurrent=!0,this.container=e}function o(t){t.on("hide",(function(){return t.emit("_om_hide")}))}a.prototype={_onHideOverlayOutsideOverlayManager:function(){if(this.stack.length){var t=this.stack[0].route,e="string"==typeof t,n=this.router.getPath(),i=e&&n===t||n.match(t);this.hideCurrent=!1,i&&this.router.back()}},_attachOverlay:function(t){t.$el.parents().length||this.container.appendChild(t.$el[0])},_show:function(t){window.history.replaceState(s,null,window.location.href),t.once("_om_hide",this._onHideOverlayOutsideOverlayManager.bind(this)),this._attachOverlay(t),t.show()},_hideOverlay:function(t,e){var n;function i(){n=!0,t.hide()}return t.off("_om_hide"),t.options&&t.options.onBeforeExit?t.options.onBeforeExit(i,e):i(),n||t.once("_om_hide",this._onHideOverlayOutsideOverlayManager.bind(this)),n},_processMatch:function(t){if(t)if(t.overlay)this._show(t.overlay);else{var e=t.factoryResult;e&&(t.overlay=e,o(t.overlay),this._show(e))}},_checkRoute:function(t){var e=this,n=this.stack[0];if(n||(this.scrollTop=window.pageYOffset),!n||void 0===n.overlay||!this.hideCurrent||this._hideOverlay(n.overlay,(function(){t.preventDefault()}))){var i=Object.keys(this.entries).reduce((function(n,i){return n||e._matchRoute(t.path,e.entries[i])}),null);i||(this.stack=[],window.scrollTo(window.pageXOffset,this.scrollTop)),this.hideCurrent=!0,this._processMatch(i)}},_matchRoute:function(t,e){var n,i,r,s=this.stack[1],a=this;if("string"==typeof e.route?(n=e.route===t,i=[]):i=(n=!!(r=t.match(e.route)))?r.slice(1):[],n){if(s&&s.path===t)return a.stack.shift(),s;var o={path:t,route:e.route,factoryResult:e.factory.apply(a,i)};return this.stack[0]&&o.path===this.stack[0].path?a.stack[0]=o:a.stack.unshift(o),o}return null},add:function(t,e){var n=this,r={route:t,factory:e};this.entries[t]=r,i.docReady((function(){return n._processMatch(n._matchRoute(n.router.getPath(),r))}))},replaceCurrent:function(t){if(0===this.stack.length)throw new Error("Trying to replace OverlayManager's current overlay, but stack is empty");var e=this.stack[0].overlay;e&&this._hideOverlay(e),this.stack[0].overlay=t,o(t),this._show(t)}},a.getSingleton=function(){if(!r){var t=require("mediawiki.router"),e=document.createElement("div"),n=t.getPath(),i=window.history.state;e.className="mw-overlays-container",document.body.appendChild(e),n&&i!==s&&(window.history.replaceState(null,null,"#"),window.history.pushState(s,null,"#".concat(n))),r=new a(t,e)}return r},a.test={MANAGED_STATE:s,__clearCache:function(){r=null}},t.exports=a},"./src/mobile.startup/Page.js":(t,e,n)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}function s(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}var a=mw.html,o=n("./src/mobile.startup/util.js"),l=function(){"use strict";return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=e.title||"";o.extend(this,{id:e.id||0,title:n,relevantTitle:e.relevantTitle||n,titleObj:e.titleObj,displayTitle:e.displayTitle||a.escape(n),namespaceNumber:e.namespaceNumber||0,protection:e.protection,url:e.url||mw.util.getUrl(n),wikidataDescription:e.wikidataDescription,_isMainPage:e.isMainPage||!1,isMissing:void 0!==e.isMissing?e.isMissing:0===e.id,anchor:e.anchor,revId:e.revId,_isWatched:e.isWatched,thumbnail:!!Object.prototype.hasOwnProperty.call(e,"thumbnail")&&e.thumbnail}),this.thumbnail&&this.thumbnail.width&&(this.thumbnail.isLandscape=this.thumbnail.width>this.thumbnail.height)},(e=[{key:"getDisplayTitle",value:function(){return this.displayTitle}},{key:"inNamespace",value:function(t){return this.namespaceNumber===mw.config.get("wgNamespaceIds")[t]}},{key:"isWikiText",value:function(){return"wikitext"===mw.config.get("wgPageContentModel")}},{key:"isVEAvailable",value:function(){return!!mw.config.get("wgVisualEditorConfig")&&!mw.config.get("wgVisualEditorDisabledByHook")&&this.isWikiText()}},{key:"isVEVisualAvailable",value:function(){return!!this.isVEAvailable()&&-1!==(mw.config.get("wgVisualEditorConfig").namespaces||[]).indexOf(mw.config.get("wgNamespaceNumber"))}},{key:"isVESourceAvailable",value:function(){return this.isVEAvailable()&&mw.config.get("wgMFEnableVEWikitextEditor")}},{key:"isMainPage",value:function(){return this._isMainPage}},{key:"isWatched",value:function(){return this._isWatched}},{key:"getRevisionId",value:function(){return this.revId}},{key:"getTitle",value:function(){return this.title}},{key:"getNamespaceId",value:function(){var t=this.title.split(":");return t[1]&&mw.config.get("wgNamespaceIds")[t[0].toLowerCase().replace(" ","_")]||0}}])&&r(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();t.exports=l},"./src/mobile.startup/PageHTMLParser.js":(t,e,n)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}function s(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}var a=n("./src/mobile.startup/Thumbnail.js"),o=mw.config.get("wgMFMobileFormatterHeadings",["h1","h2","h3","h4","h5"]).join(","),l=["noviewer","metadata"],c=l.map((function(t){return":not(.".concat(t,")")})).join(""),u=["a.image","a.thumbimage, a.mw-file-description"].map((function(t){return"".concat(t).concat(c)})).join(","),p=function(){"use strict";return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$el=e,this.$headings=this.$el.find(o)},(e=[{key:"findSectionHeadingByIndex",value:function(t){return t<1?$([]):this.$headings.filter('.mw-parser-output > *, [class^="mf-section-"] > *').eq(t-1)}},{key:"findChildInSectionLead",value:function(t,e){var n,i,r=o;function s(t){return t.find(e).addBack()}if(0===t){var a=this.getLeadSectionElement();if(a&&a.length){var l=a.find('section[data-mw-section-id="0"]');return l.length?s(l.children(e)):s(a.children(e))}return(n=this.findSectionHeadingByIndex(1)).length?s(n.prevAll(e)):this.$el.find(e)}if((n=this.findSectionHeadingByIndex(t)).hasClass("section-heading")){var c=n.next();return(i=c.find(r).eq(0)).length?s(i.prevAll(e)):s(c.children(e))}return i=n.eq(0).nextAll(r).eq(0),n.nextUntil(i,e)}},{key:"getLeadSectionElement",value:function(){var t=this.$el.find(".mf-section-0");return t.length?t:null}},{key:"getThumbnail",value:function(t){var e="."+l.join(",."),n=t.find(".lazy-image-placeholder"),i=t.attr("href"),r=i&&new URL(i,location.href),s=r&&r.searchParams.get("title"),o=r&&r.pathname.match(/[^/]+$/),c=0===t.parents(e).length&&0===t.find(e).length;return n.length&&c&&(c=!new RegExp("\\b("+l.join("|")+")\\b").test(n.data("class"))),c&&(null!==s||o)?new a({el:t,filename:mw.util.percentDecodeFragment(null!==s?s:o[0])}):null}},{key:"getThumbnails",value:function(t){var e=this,n=[];return(t=t||this.$el).find(u).each((function(){var i=t.find(this),r=e.getThumbnail(i);r&&n.push(r)})),n}},{key:"getRedLinks",value:function(){return this.$el.find(".new")}},{key:"getLanguages",value:function(t){var e=function(e){var n,i=" – ",r=e.textContent,s=e.getAttribute("title")||t;return s.indexOf(i)>-1&&(n=(s=s.split(i)).pop(),s=s.join(i)),n||(n=r),{lang:e.getAttribute("hreflang"),autonym:r,langname:n,title:s,url:e.getAttribute("href")}};return{languages:Array.prototype.map.call(document.querySelectorAll("#p-lang .interlanguage-link a"),e),variants:Array.prototype.map.call(document.querySelectorAll("#p-variants li a"),e)}}}])&&r(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();p.HEADING_SELECTOR=o,p.THUMB_SELECTOR=u,t.exports=p},"./src/mobile.startup/PageList.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=n("./src/mobile.startup/mfExtend.js"),s=n("./src/mobile.startup/View.js"),a=n("./src/mobile.startup/Browser.js").getSingleton();function o(){s.apply(this,arguments)}r(o,s,{defaults:{pages:[]},renderPageImages:function(){var t=this;setTimeout((function(){t.$el.find(".list-thumb").each((function(){var e=t.$el.find(this).data("style");t.$el.find(this).attr("style",e)}))}),a.isWideScreen()?0:1e3)},postRender:function(){this.renderPageImages()},template:i.template('\n<ul class="mw-mf-page-list thumbs actionable">\n\t{{#pages}}\n\t\t{{>item}}\n\t{{/pages}}\n</ul>\n\t'),templatePartials:{item:i.template('\n<li title="{{title}}" data-id="{{id}}" class="page-summary">\n <a href="{{url}}" class="title {{#isMissing}}new{{/isMissing}}"\n {{#anchor}}name="{{anchor}}"{{/anchor}}\n {{#latitude}}data-latlng="{{latitude}},{{longitude}}"{{/latitude}}\n data-title="{{title}}">\n <div class="list-thumb\n {{#thumbnail.isLandscape}}list-thumb-y{{/thumbnail.isLandscape}}\n {{^thumbnail.isLandscape}}list-thumb-x{{/thumbnail.isLandscape}}"\n {{#thumbnail}}data-style="background-image: url( {{thumbnail.source}} )"{{/thumbnail}}>\n {{^thumbnail}}<span class="mf-icon-image"></span>{{/thumbnail}}\n\t</div>\n <h3>{{{displayTitle}}}</h3>\n {{#wikidataDescription}}\n <div class="wikidata-description">{{wikidataDescription}}</div>\n {{/wikidataDescription}}\n {{#proximity}}\n <div class="info proximity">{{proximity}}</div>\n {{/proximity}}\n </a>\n</li>\n\t')}}),t.exports=o},"./src/mobile.startup/Skin.js":(t,e,n)=>{var i,r=n("./src/mobile.startup/Browser.js").getSingleton(),s=n("./src/mobile.startup/View.js"),a=n("./src/mobile.startup/util.js"),o=n("./src/mobile.startup/currentPage.js"),l=n("./src/mobile.startup/eventBusSingleton.js");function c(t){var e=a.extend({},t);this.page=e.page,this.name=e.name,this.eventBus=e.eventBus,e.isBorderBox=!1,s.call(this,e)}n("./src/mobile.startup/mfExtend.js")(c,s,{defaults:{page:void 0},postRender:function(){var t=this,e=this.$el;r.supportsTouchEvents()&&e.addClass("touch-events"),this.$el.find("#mw-mf-page-center").on("click",(function(e){t.emit("click",e)}))},getLicenseLinks:function(){var t=mw.message("mobile-frontend-license-links"),e=t.exists()&&t.text();return"qqx"===mw.config.get("wgUserLanguage")||e?t.parseDom():this.$el.find("#footer-info-copyright a").clone()},getLicenseMsg:function(){var t,e=this.getLicenseLinks();if(e.length){var n=mw.language.convertNumber(e.filter("a").length);if(this.$el.find("#footer-places-terms-use").length>0){var i=mw.message("mobile-frontend-editor-terms-link",this.$el.find("#footer-places-terms-use a").attr("href")).parseDom();t=mw.message("mobile-frontend-editor-licensing-with-terms",i,e,n).parse()}else t=mw.message("mobile-frontend-editor-licensing",e,n).parse()}return t}}),c.getSingleton=function(){return i||(i=new c({el:"body",page:o(),eventBus:l})),i},t.exports=c},"./src/mobile.startup/Thumbnail.js":(t,e,n)=>{var i=n("./src/mobile.startup/mfExtend.js"),r=n("./src/mobile.startup/util.js"),s=n("./src/mobile.startup/View.js");function a(t){s.call(this,r.extend({isBorderBox:!1},t))}i(a,s,{defaults:{filename:void 0},postRender:function(){this.options.description=this.$el.siblings(".thumbcaption, figcaption").prop("innerText")||""},getDescription:function(){return this.options.description},getFileName:function(){return this.options.filename}}),t.exports=a},"./src/mobile.startup/View.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=n("./src/mobile.startup/mfExtend.js"),s=/^(\S+)\s*(.*)$/,a=0;function o(){this.initialize.apply(this,arguments)}OO.mixinClass(o,OO.EventEmitter),r(o,{tagName:"div",isTemplateMode:!1,template:void 0,templatePartials:{},defaults:{},initialize:function(t){var e,n,r=this;OO.EventEmitter.call(this),t=i.extend({},this.defaults,t),this.options=t,this.cid=(e="view",n=(++a).toString(),e?e+n:n),"string"==typeof this.template&&(this.template=mw.template.compile(this.template)),t.el?this.$el=$(t.el):this.$el=this.parseHTML("<"+this.tagName+">"),this.$el.length?this._postInitialize(t):i.docReady((function(){r.$el=$(t.el),r._postInitialize(t)}))},_postInitialize:function(t){this.$el.addClass(t.className),!1!==t.isBorderBox&&this.$el.addClass("view-border-box"),this.render({})},preRender:function(){},postRender:function(){},render:function(t){var e,n;return i.extend(this.options,t),this.preRender(),this.undelegateEvents(),this.template&&!this.options.skipTemplateRender&&(n=this.template.render(this.options,this.templatePartials),this.isTemplateMode?(e=$(n),this.$el.replaceWith(e),this.$el=e):this.$el.html(n)),this.postRender(),this.delegateEvents(),this},delegateEvents:function(t){var e,n,i;if(t=t||this.options.events)for(n in this.undelegateEvents(),t)"function"!=typeof(i=t[n])&&(i=this[t[n]]),i&&(e=n.match(s),this.delegate(e[1],e[2],i.bind(this)))},delegate:function(t,e,n){this.$el.on(t+".delegateEvents"+this.cid,e,n)},undelegateEvents:function(){this.$el&&this.$el.off(".delegateEvents"+this.cid)},undelegate:function(t,e,n){this.$el.off(t+".delegateEvents"+this.cid,e,n)},parseHTML:function(t){return i.parseHTML(t,document)}}),["append","prepend","appendTo","prependTo","after","before","insertAfter","insertBefore","remove","detach"].forEach((function(t){o.prototype[t]=function(){return this.$el[t].apply(this.$el,arguments),this}})),o.make=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],e=new o(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return t.forEach((function(t){return e.append(t)})),e},t.exports=o},"./src/mobile.startup/actionParams.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r={action:"query",formatversion:2};t.exports=function(t){var e=mw.config.get("wgMFScriptPath");return i.extend({},r,{origin:e?"*":void 0},t)}},"./src/mobile.startup/amcOutreach/AmcEnableForm.js":(t,e,n)=>{function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}function s(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}function a(t,e,n){return e=l(e),function(t,e){if(e&&("object"==i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,o()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}function o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(o=function(){return!!t})()}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}var u=n("./src/mobile.startup/Button.js"),p=n("./src/mobile.startup/util.js"),d=function(t){"use strict";function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(e,t),n=e,(i=[{key:"isTemplateMode",get:function(){return!0}},{key:"template",get:function(){return p.template('\n<form class="amc-enable-form" action="{{postUrl}}" method="POST">\n\t{{#fields}}\n\t\t<input type="hidden" name="{{name}}" value="{{value}}">\n\t{{/fields}}\n</form>\n\t\t')}},{key:"postRender",value:function(){this.$el.append(new u({tagName:"button",progressive:!0,label:this.options.buttonLabel}).$el)}}])&&r(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i}(n("./src/mobile.startup/View.js"));t.exports=d},"./src/mobile.startup/amcOutreach/amcOutreach.js":(t,e,n)=>{var i,r=n("./src/mobile.startup/showOnPageReload.js"),s=n("./src/mobile.startup/promoCampaign/promoCampaign.js"),a=n("./src/mobile.startup/amcOutreach/amcOutreachDrawer.js"),o={onDesktopLink:"onDesktopLink",onHistoryLink:"onHistoryLink",onTalkLink:"onTalkLink"};t.exports={loadCampaign:function(){return i||(i=s((function(t,e,n,s){return a(t,i,mw.message,mw.util,r,mw.user.tokens.get("csrfToken"),e,n,s)}),o,"amc-outreach",!!mw.config.get("wgMFAmcOutreachActive"),!!mw.config.get("wgMFAmcOutreachUserEligible"),mw.storage))},ACTIONS:o}},"./src/mobile.startup/amcOutreach/amcOutreachDrawer.js":(t,e,n)=>{var i=n("./src/mobile.startup/Drawer.js"),r=n("./src/mobile.startup/Anchor.js"),s=n("./src/mobile.startup/util.js"),a=n("./src/mobile.startup/amcOutreach/AmcEnableForm.js");t.exports=function(t,e,n,o,l,c,u,p,d){return new i({className:"amc-outreach-drawer",children:[s.parseHTML("<div>").addClass("amc-outreach-image"),s.parseHTML("<p>").append(s.parseHTML("<strong>").text(n("mobile-frontend-amc-outreach-intro").text())),s.parseHTML("<p>").text(n("mobile-frontend-amc-outreach-description").text()),new a({postUrl:o.getUrl("Special:MobileOptions",{returnto:p,returntoquery:d||""}),fields:[{name:"updateSingleOption",value:"enableAMC"},{name:"enableAMC",value:"1"},{name:"token",value:c}],buttonLabel:n("mobile-frontend-amc-outreach-enable").text(),events:{submit:function(){e.makeActionIneligible(t),l.showOnPageReload(n("mobile-frontend-amc-outreach-enabled-message").text())}}}).$el,new r({href:"#",additionalClassNames:"cancel",progressive:!0,label:n("mobile-frontend-amc-outreach-no-thanks").text()}).$el],onBeforeHide:function(){e.makeActionIneligible(t),u()}})}},"./src/mobile.startup/currentPage.js":(t,e,n)=>{var i,r=n("./src/mobile.startup/Page.js");t.exports=function(){if(i)return i;var t=[].concat(mw.config.get("wgRestrictionEdit",[])),e=mw.Title.newFromText(mw.config.get("wgRelevantPageName")),n=mw.Title.newFromText(mw.config.get("wgPageName"));return 0===t.length&&t.push("*"),i=new r({title:n.getPrefixedText(),titleObj:n,relevantTitle:e.getPrefixedText(),protection:{edit:t},revId:mw.config.get("wgRevisionId"),isMainPage:mw.config.get("wgIsMainPage"),isWatched:$("#ca-watch").hasClass("watched"),isMissing:0===mw.config.get("wgArticleId"),id:mw.config.get("wgArticleId"),namespaceNumber:mw.config.get("wgNamespaceNumber")})}},"./src/mobile.startup/currentPageHTMLParser.js":(t,e,n)=>{var i,r=n("./src/mobile.startup/PageHTMLParser.js");t.exports=function(){return i||(i=new r($("#content #bodyContent")))}},"./src/mobile.startup/eventBusSingleton.js":t=>{t.exports=new OO.EventEmitter},"./src/mobile.startup/extendSearchParams.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=n("./src/mobile.startup/actionParams.js");t.exports=function(t){var e=mw.config.get("wgMFDisplayWikibaseDescriptions")||{search:!0,watchlist:!0,tagline:!1},n=mw.config.get("wgMFScriptPath");if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error('"'+t+"\" isn't a feature that shows Wikibase descriptions.");var s=Array.prototype.slice.call(arguments,1);s.unshift({prop:[]}),s.push(mw.config.get("wgMFSearchAPIParams"));var a=i.extend.apply({},s);return a.prop=a.prop.concat(mw.config.get("wgMFQueryPropModules")),e[t]&&-1===a.prop.indexOf("description")&&a.prop.push("description"),n&&(a.origin="*"),r(a)}},"./src/mobile.startup/headers.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=n("./src/mobile.startup/Button.js"),s=n("./src/mobile.startup/icons.js");function a(t,e,n,r){var a="string"==typeof t?t:void 0,o={hasActions:e&&e.length,isHidden:!1,heading:a},l=i.template('\n<div class="overlay-header header '.concat(r||"",' hideable">\n\t<ul class="header-cancel">\n\t\t<li></li>\n\t</ul>\n\t{{{heading}}}\n\t{{#hasActions}}\n\t<div class="header-action"></div>\n\t{{/hasActions}}\n</div>\n\t\t')).render(o);n=n||s.cancel();var c=i.parseHTML(l);return c.find("h2 span").addClass("truncated-text"),c.find(".header-cancel li").append(n.$el),void 0===a&&t.$el.insertAfter(c.find(".header-cancel")),e&&e.length&&c.find(".header-action").append(e.map((function(t){return t.$el}))),c[0]}function o(t,e,n,i){return a(t='<div class="overlay-title"><h2>'.concat(t,"</h2></div>"),e,n,i)}t.exports={savingHeader:function(t){return o(t,[s.spinner({additionalClassNames:"savespinner loading"})],s.cancel(),"saving-header hidden")},saveHeader:function(t,e){return o(t,[new r({tagName:"button",additionalClassNames:"save submit",disabled:!0,label:i.saveButtonMessage(),size:"large"})],s.back(),e)},formHeader:function(t,e,n,i){return a(t,e,n,i)},header:o}},"./src/mobile.startup/icons.js":(t,e,n)=>{var i="close",r=n("./src/mobile.startup/Icon.js"),s=n("./src/mobile.startup/IconButton.js"),a={CANCEL_GLYPH:i,Icon:r,IconButton:s,back:function(){return new a.IconButton({tagName:"button",icon:"previous",additionalClassNames:"back",label:mw.msg("mobile-frontend-overlay-close")})},cancel:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t?"".concat(i,"-").concat(t):"".concat(i);return e.additionalClassNames=e.additionalClassNames||"",e.additionalClassNames+=" cancel",new a.IconButton(Object.assign({tagName:"button",icon:n,label:mw.msg("mobile-frontend-overlay-close")},e))},spinner:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0===t.additionalClassNames&&(t.additionalClassNames="spinner loading");var e=new a.IconButton(Object.assign({tagName:"span",icon:"spinner",label:mw.msg("mobile-frontend-loading-message")},t));return e.$el.removeClass(),e.$el.addClass(t.additionalClassNames),e.$el.attr("type",""),e.options.isIconOnly&&e.$el.addClass("mf-spinner-icon-element"),e},error:function(){return new a.IconButton({icon:"alert-invert",additionalClassNames:"load-fail-msg-icon"})},watch:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.additionalClassNames=t.additionalClassNames||"",t.additionalClassNames+=" watch-this-article",new a.IconButton(Object.assign({icon:"star-subtle"},t))},watched:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.additionalClassNames=t.additionalClassNames||"",t.additionalClassNames+=" watch-this-article watched",new a.IconButton(Object.assign({icon:"unStar-progressive"},t))}};t.exports=a},"./src/mobile.startup/lazyImages/lazyImageLoader.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r="lazy-image-placeholder";t.exports={placeholderClass:r,queryPlaceholders:function(t){return Array.prototype.slice.call(t.getElementsByClassName(r))},loadImages:function(e){return i.Promise.all(e.map((function(e){return t.exports.loadImage(e).promise})))},loadImage:function(t){var e=i.Deferred(),n=t.dataset.width,r=t.dataset.height,s=new Image;return n&&s.setAttribute("width",parseInt(n,10)),r&&s.setAttribute("height",parseInt(r,10)),s.className=t.dataset.class||"",s.alt=t.dataset.alt||"",s.useMap=t.dataset.usemap,s.style.cssText=t.style.cssText||"",s.addEventListener("load",(function(){s.classList.add("image-lazy-loaded"),t.parentNode&&t.parentNode.replaceChild(s,t),e.resolve("load")}),{once:!0}),s.addEventListener("error",(function(){t.parentNode&&t.parentNode.replaceChild(s,t),e.resolve("error")}),{once:!0}),s.src=t.dataset.src||"",s.srcset=t.dataset.srcset||"",{promise:e,image:s}},test:{placeholderClass:r}}},"./src/mobile.startup/mfExtend.js":t=>{t.exports=function(t,e,n){var i;for(i in n?OO.inheritClass(t,e):(OO.initClass(t),n=e),n)t.prototype[i]=n[i]}},"./src/mobile.startup/moduleLoader.js":t=>{function e(){this._register={}}e.prototype={require:function t(e){var n=this._register;function i(){if(!Object.hasOwnProperty.call(n,e))throw new Error("MobileFrontend Module not found: "+e);return n[e]}var r=e.split("/");try{var s=t(r[0]);return s[r[1]]?s[r[1]]:i()}catch(t){return i()}},define:function(t,e){var n=this;if(Object.hasOwnProperty.call(this._register,t))throw new Error("Module already exists: "+t);return this._register[t]=e,{deprecate:function(i){n.deprecate(i,e,t)}}},deprecate:function(t,e,n){var i;n&&(i="Use "+n+" instead."),mw.log.deprecate(this._register,t,e,i)}},t.exports=e},"./src/mobile.startup/moduleLoaderSingleton.js":(t,e,n)=>{var i=n("./src/mobile.startup/moduleLoader.js");t.exports=new i},"./src/mobile.startup/page/pageJSONParser.js":(t,e,n)=>{var i=n("./src/mobile.startup/Page.js"),r=n("./src/mobile.startup/util.js");t.exports={parse:function(t){var e,n=t.thumbnail,s=t.pageprops||{displaytitle:mw.html.escape(t.title)},a=t.terms||t.entityterms;return(s||a)&&(e=a&&a.label?mw.html.escape(a.label[0]):s.displaytitle),t.wikidataDescription=t.description||void 0,n&&(t.thumbnail.isLandscape=n.width>n.height),new i(r.extend(t,{id:t.pageid,isMissing:!!t.missing,url:mw.util.getUrl(t.title),displayTitle:e}))}}},"./src/mobile.startup/promoCampaign/promoCampaign.js":t=>{t.exports=function(t,e,n,i,r,s){var a={};for(var o in e){var l=e[o];a[l]="mobile-frontend-".concat(n,"-ineligible-").concat(l)}function c(){return i}function u(t){if(!(t in e))throw new Error("Action '".concat(t,"' not found in 'actions' object. Please add this to\n\t\t\t\tthe object when creating a campaign with promoCampaign.js if you believe\n\t\t\t\tthis is a valid action."))}return{showIfEligible:function(e){if(!function(t){return u(t),c()&&r&&null===s.get(a[t])}(e))return null;for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return t.apply(void 0,[e].concat(i))},makeActionIneligible:function(t){return u(t),s.set(a[t],"~")},makeAllActionsIneligible:function(){var t,n;for(t in e)n=e[t],this.makeActionIneligible(n)},isCampaignActive:c}}},"./src/mobile.startup/showOnPageReload.js":t=>{var e="mobileFrontend/toast";mw.requestIdleCallback((function(){var t=mw.storage.get(e);t&&(t=JSON.parse(t),mw.notify(t.content,t.options),mw.storage.remove(e))})),t.exports={showOnPageReload:function(t,n){mw.storage.get(e)?mw.log.warn("A pending toast message already exits. The page should have been reloaded by now."):mw.storage.set(e,JSON.stringify({content:t,options:n}))}}},"./src/mobile.startup/util.js":t=>{t.exports={saveButtonMessage:function(){return mw.config.get("wgEditSubmitButtonLabelPublish")?mw.msg("mobile-frontend-editor-publish"):mw.msg("mobile-frontend-editor-save")},Promise:{all:function(t){return $.when.apply($,t)}},escapeSelector:function(t){return $.escapeSelector(t)},docReady:function(t){return $(t)},Deferred:function(){return $.Deferred()},getDocument:function(){return $(document.documentElement)},getWindow:function(){return $(window)},parseHTML:function(t,e){return e=e||document,$($.parseHTML(t,e))},extend:function(){return $.extend.apply($,arguments)},template:function(t){return{getSource:function(){return t},render:function(e,n){var i={};return Object.keys(n||{}).forEach((function(t){i[t]=n[t].getSource()})),Mustache.render(t.trim(),e,i)}}}}},"./src/mobile.startup/watchstar/WatchstarGateway.js":(t,e,n)=>{var i=n("./src/mobile.startup/util.js"),r=n("./src/mobile.startup/actionParams.js");function s(t){this.api=t}s.prototype={getStatuses:function(t,e){return i.Promise.all([this.getStatusesByID(t),this.getStatusesByTitle(e)]).then((function(){return i.extend.apply(i,arguments)}))},getStatusesByID:function(t){var e=this;return t.length?this.api.get({formatversion:2,action:"query",prop:"info",inprop:"watched",pageids:t}).then((function(t){return e._unmarshalGetResponse(t)})):i.Deferred().resolve({})},getStatusesByTitle:function(t){var e=this;return t.length?this.api.get(r({prop:"info",inprop:"watched",titles:t})).then((function(t){return e._unmarshalGetResponse(t)})):i.Deferred().resolve({})},postStatusesByTitle:function(t,e){var n={action:"watch",titles:t};return e||(n.unwatch=!e),this.api.postWithToken("watch",n)},_unmarshalGetResponse:function(t){return(t&&t.query&&t.query.pages||[]).reduce((function(t,e){return t[e.title]=e.watched,t}),{})}},t.exports=s},"./src/mobile.startup/watchstar/WatchstarPageList.js":(t,e,n)=>{var i=n("./src/mobile.startup/PageList.js"),r=n("./src/mobile.startup/watchstar/watchstar.js"),s=mw.user,a=n("./src/mobile.startup/util.js"),o=n("./src/mobile.startup/Page.js"),l=n("./src/mobile.startup/mfExtend.js"),c=n("./src/mobile.startup/watchstar/WatchstarGateway.js");function u(t){this.wsGateway=new c(t.api),i.apply(this,arguments)}l(u,i,{postRender:function(){var t=this,e=[],n=[];i.prototype.postRender.apply(this);var r=this.queryUnitializedItems(),s=this.parsePagesFromItems(r);return Object.keys(s).forEach((function(t){var i=s[t];i&&"0"!==i?e.push(i):n.push(t)})),this.getPages(e,n).then((function(e){return t.renderItems(r,e)}))},queryUnitializedItems:function(){return this.$el.find("li:not(.with-watchstar)")},getPages:function(t,e){return s.isAnon()?a.Deferred().resolve({}):this.wsGateway.getStatuses(t,e)},parsePagesFromItems:function(t){var e=this,n={};return t.each((function(t,i){var r=e.$el.find(i);n[r.attr("title")]=r.data("id")})),n},renderItems:function(t,e){var n=this;s.isAnon()||t.each((function(t,i){var r=n.$el.find(i),s=new o({sections:[],title:r.attr("title"),id:r.data("id")}),a=e[s.getTitle()];n._appendWatchstar(r,s,a),r.addClass("with-watchstar")}))},_appendWatchstar:function(t,e,n){r({isWatched:n,page:e}).appendTo(t)}}),t.exports=u},"./src/mobile.startup/watchstar/watchstar.js":(t,e,n)=>{var i=n("./src/mobile.startup/icons.js");t.exports=function(t){var e=t.isWatched,n=require("mediawiki.page.watch.ajax").watchstar,r=e?"unwatch":"watch",s={href:mw.Title.newFromText(t.page.title).getUrl({action:r})},a=i.watch(s),o=i.watched(s),l=a.getClassName(),c=o.getClassName(),u=a.getIcon().getClassName(),p=o.getIcon().getClassName(),d=e?o:a;return n(d.$el,t.page.title,(function(t,e){t.attr("class",e?c:l),t.find(".mf-icon").attr("class",e?p:u)})),d}}}]);
//# sourceMappingURL=mobile.common.js.map.json