User:Dross/moremenu.js

mw.loader.implement("ext.gadget.MoreMenu@8vqk8",function($,jQuery,require,module){	"use strict";	window.MoreMenu = window.MoreMenu || {};window.MoreMenu.messages = window.MoreMenu.messages || {};	$.extend(window.MoreMenu.messages,{ "abusefilter-log"				: "AbuseFilter log", "all-logs"						: "All logs", "analysis"						: "Analysis", "analysis-sigma"				: "Analysis – &#931;", "analysis-wikihistory"			: "Analysis – WikiHistory", "analysis-xtools"				: "Analysis – XTools", "articles-created"				: "Articles created", "authorship"					: "Authorship", "basic-statistics"				: "Basic statistics", "block-globally"				: "Block globally", "block-log"						: "Block log", "block-user"					: "Block user", "blocks"						: "Blocks", "central-auth"					: "Central auth", "change-block"					: "Change block", "change-model"					: "Change model", "change-protection"				: "Change protection", "change-rights"					: "Change rights", "checkuser"						: "CheckUser", "checkuser-log"					: "CheckUser log", "check-external-links"			: "Check external links", "check-redirects"				: "Check redirects", "contributions"					: "Contributions", "copyvio-detector"				: "Copyright vio detector", "copyvio-detector-desc"			: "Queries search engine for copyright violations. Could take a while, so be patient.", "delete-page"					: "Delete", "deleted-contributions"			: "Deleted contributions", "deletion-log"					: "Deletion log", "disambiguate-links"			: "Disambiguate links", "edit-intro"					: "Edit intro", "edit-summary-search"			: "Edit summary search", "edit-summary-usage"			: "Edit summary usage", "email-user"					: "Email user", "expand-bare-references"		: "Expand bare references", "fix-dead-links"				: "Fix dead links", "geolocate"						: "Geolocate", "global-account-log"			: "Global account log", "global-block-log"				: "Global block log", "global-contributions-guc"		: "Global edits – GUC", "global-contributions-xtools"	: "Global edits – XTools", "ip-lookup"						: "IP lookup", "latest-diff"					: "Latest diff", "mass-message-log"				: "Mass message log", "merge-page"					: "Merge", "move-log"						: "Move log", "move-page"						: "Move", "non-automated-edits"			: "Non-automated edits", "page"							: "Page", "page-logs"						: "Page logs", "pending-changes-log"			: "Pending changes log", "protection-log"				: "Protection log", "protect-page"					: "Protect", "proxy-check"					: "Proxy check", "purge-cache"					: "Purge cache", "rdns"							: "rDNS", "rename-log"					: "Rename log", "review-log"					: "Review log", "search"						: "Search", "search-by-contributor"			: "Search by contributor", "search-history-wikiblame"		: "Search history – WikiBlame", "search-history-xtools"			: "Search history – XTools", "search-subpages"				: "Search subpages", "spam-blacklist-log"			: "Spam blacklist log", "subpages"						: "Subpages", "sul"							: "SUL", "suppressed-contribs"			: "Suppressed contribs", "suppression-log"				: "Suppression log", "thanks-log"					: "Thanks log", "tools"							: "Tools", "top-edited-pages"				: "Top edited pages", "traffic-report"				: "Traffic report", "transclusions"					: "Transclusions", "transclusion-count"			: "Transclusion count", "unblock-user"					: "Unblock user", "undelete-page"					: "Undelete", "upload-log"					: "Upload log", "uploads"						: "Uploads", "user"							: "User", "user-creation-log"				: "User creation log", "user-groups"					: "User groups", "user-logs"						: "User logs", "user-rights-changes"			: "User rights changes", "user-rights-log"				: "User rights log", "user-thanks-received"			: "User thanks received", "view-block"					: "View block", "view-block-log"				: "View block log", "whois"							: "WHOIS" },	window.MoreMenu.messages);	"use strict";	window.MoreMenu = window.MoreMenu || {};window.MoreMenu.user=function(config){ 		return { 			user: {				'user-logs'	: {					'all-logs'				: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name } ), insertAfter:!1 },					'abusefilter-log'		: { url : mw.util.getUrl( 'Special:AbuseLog',{ wpSearchUser:config.targetUser.name } ) },					'block-log'				: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'block' } ), targetUserRights : ['block'] },					'checkuser-log'			: { url : mw.util.getUrl( 'Special:CheckUserLog', { cuSearch:config.targetUser.name, cuSearchType : 'initiator' } ), targetUserRights : ['checkuser-log'], currentUserRights : ['checkuser-log'] },					'deletion-log'			: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'delete' } ), targetUserRights : ['delete'] },					'global-account-log'	: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'globalauth' } ), targetUserRights : ['centralauth-lock'] }, 'global-block-log'		: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'gblblock' } ), targetUserRights : ['globalblock'] }, 'mass-message-log'		: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'massmessage' } ), targetUserRights : ['massmessage'] }, 'move-log'				: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'move' } ), targetUserRights : ['move'] }, 'pending-changes-log'	: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'stable' } ), targetUserRights : ['stablesettings'] }, 'protection-log'		: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'protect' } ), targetUserRights : ['protect'] }, 'rename-log'			: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'gblrename' } ), targetUserRights : ['centralauth-rename'] }, 'review-log'			: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'review' } ), targetUserRights : ['review'] }, 'spam-blacklist-log'	: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'spamblacklist' } ) }, 'suppression-log'		: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'suppress' } ), targetUserRights : ['suppressrevision'], currentUserRights : ['suppressionlog'] }, 'thanks-log'			: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'thanks' } ), targetUserGroups : ['user'] }, 'upload-log'			: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'upload' } ), targetUserRights : ['upload'] }, 'user-creation-log'		: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'newusers' } ), targetUserGroups : ['user'] }, 'user-rights-log'		: { url : mw.util.getUrl( 'Special:Log', { user:config.targetUser.name, type : 'rights' } ), targetUserChangeGroups : !0 } }, 'blocks' : {	'block-user'		: { url : mw.util.getUrl( "Special:Block/".concat( config.targetUser.name ) ), currentUserRights : 'block', targetUserBlocked : !1 }, 'block-globally'	: { url : "https://meta.miraheze.org/wiki/Special:GlobalBlock/".concat( config.targetUser.name ), currentUserRights : 'globalblock', targetUserIp : !0 }, 'change-block'		: { url : mw.util.getUrl( "Special:Block/".concat( config.targetUser.name ) ), currentUserRights : 'block', targetUserBlocked : !0 }, 'central-auth'		: { url : "https://meta.miraheze.org/wiki/Special:CentralAuth/".concat( config.targetUser.name ), currentUserRights : 'centralauth-lock' }, 'unblock-user'		: { url : mw.util.getUrl( "Special:Unblock/".concat( config.targetUser.name ) ), targetUserBlocked : !0, currentUserRights : 'block' }, 'view-block'		: { url : mw.util.getUrl( 'Special:BlockList', { wpTarget : config.targetUser.name } ), targetUserBlocked : !0, style : 'color:#EE1111'}, 'view-block-log'	: { url : mw.util.getUrl( 'Special:Log', { page : config.targetUser.name, type : 'block' } ) } }, 'analysis'			: { 'sul'							: { url : mw.util.getUrl( "Special:CentralAuth/".concat( config.targetUser.name ) ), targetUserGroups : ['user'] }, 'ip-lookup'						: { 'whois'					: { url : "https://whois.toolforge.org/gateway.py?lookup=true&ip=".concat( config.targetUser.escapedName ), targetUserIp : !0, targetUserIpRange : !0 }, 'proxy-check'			: { url : "https://ipcheck.toolforge.org/?ip=".concat( config.targetUser.escapedName ),targetUserIp : !0, currentUserRights : 'block' }, 'rdns'					: { url : "https://www.robtex.com/ip/".concat( config.targetUser.escapedName, ".html" ), targetUserIp : !0, targetUserIpRange : !0 }, 'geolocate'				: { url : "https://whatismyipaddress.com/ip/".concat( config.targetUser.escapedName ), targetUserIp : !0, targetUserIpRange : !0 } }, 'change-rights'			: { url : mw.util.getUrl( 'Special:UserRights', { user : "User:".concat( config.targetUser.name ) } ), targetUserGroups : ['user'], currentUserChangeGroups : !0 }, 'checkuser'				: { url : mw.util.getUrl( "Special:CheckUser/".concat( config.targetUser.name ) ), currentUserRights : ['checkuser'] }, 'contributions'			: { url : mw.util.getUrl( "Special:Contributions/".concat( config.targetUser.name ) ) }, 'deleted-contributions'	: { url : mw.util.getUrl( "Special:DeletedContributions/".concat( config.targetUser.name ) ), currentUserRights : ['deletedhistory', 'deletedtext'], insertAfter : 'contributions' }, 'suppressed-contribs'	: { url : mw.util.getUrl( 'Special:Log/suppress', { offender : config.targetUser.name } ), currentUserRights : ['suppressionlog'], insertAfter : 'deleted-contributions' }, 'email-user'			: { url : mw.util.getUrl( "Special:EmailUser/".concat( config.targetUser.name ) ), targetUserGroups : ['user'], visible : undefined !== config.targetUser.emailable }, 'uploads'				: { url : mw.util.getUrl( 'Special:ListFiles', { user : config.targetUser.name, ilshowall : '1' } ), targetUserGroups : ['user'] }, 'user-groups'			: { url : mw.util.getUrl( 'Special:ListUsers', { limit : 1, username : config.targetUser.name } ), targetUserGroups : ['user'] }, 'user-rights-changes'	: { url : "https://xtools.wmflabs.org/ec-rightschanges/".concat( config.project.domain, "/" ).concat( config.targetUser.encodedName ), targetUserGroups : ['user'] }, 'user-thanks-received'	: { url : mw.util.getUrl( 'Special:Log', { user : '', page : "User:".concat( config.targetUser.name ), type : 'thanks' } ), targetUserGroups:['user'] } }			}		};	};		"use strict"; function _defineProperty(obj,key,value) { if ( key in obj ) { Object.defineProperty( obj, key, { value : value, enumerable : !0, configurable : !0, writable : !0 } ); } else { obj[key] = value; } return obj; }		window.MoreMenu = window.MoreMenu || {}; window.MoreMenu.page = function(config) { var _page; return { page : (_page = {				'page-logs'	: {					'all-logs'					: { url : mw.util.getUrl( 'Special:Log', { page : config.page.name } ), insertAfter : !1 },					'abusefilter-log'			: { url : mw.util.getUrl( 'Special:AbuseLog', { wpSearchTitle:config.page.name } ) },					'deletion-log'				: { url : mw.util.getUrl( 'Special:Log', { page : config.page.name, type : 'delete' } ) },					'move-log'					: { url : mw.util.getUrl( 'Special:Log', { page : config.page.name, type : 'move' } ) },					'protection-log'			: { url : mw.util.getUrl( 'Special:Log', { page : config.page.name, type : 'protect' } ) },					'spam-blacklist-log'		: { url : mw.util.getUrl( 'Special:Log', { page : config.page.name, type : 'spamblacklist' } ) } },					'basic-statistics'			: { url : mw.util.getUrl( config.page.name, { action : 'info' } ), pageExists : !0 },					'search'					: { 						'latest-diff' : { url : mw.util.getUrl( config.page.name, { diff : 'cur', oldid : 'prev' } ), pageExists : !0 }, 'search-subpages'			: { url : mw.util.getUrl( 'Special:Search', { sort : 'relevance', prefix : config.page.name } ) } }, 'change-model'				: { url : mw.util.getUrl( "Special:ChangeContentModel/".concat( config.page.name ) ), currentUserRights : ['editcontentmodel'], pageExists : !0, namespaceRestrict : [2,4,8,100,108,828] }, 'delete-page'				: { url : mw.util.getUrl( null, { action : 'delete', 'wpReason' : decodeURIComponent( $( '#delete-reason' ).text ).replace(/\+/g,' ') } ), currentUserRights : ['delete'], pageExists : !0, visible : !mw.config.get( 'wgIsMainPage' ) }, 'edit-intro'				: { url : "//".concat( config.project.domain, "/w/index.php?title=" ).concat( config.page.encodedName, "&action=edit&section=0" ), namespaceRestrict : [0,1,2,3,4,5,118], pageExists : !0, visible : '1' !== mw.user.options.get( 'gadget-edittop' ) && $( '.mw-editsection' ).length }, 'history'					: { url : '#', visible : -1 !== ['monobook','modern'].indexOf( config.currentUser.skin ) }, 'merge-page'				: { url : mw.util.getUrl( 'Special:MergeHistory', { target : config.page.name } ), currentUserRights : ['mergehistory'], pageExists : !0, visible : !mw.config.get( 'wgIsMainPage' ) }, 'move-page'					: { url : mw.util.getUrl( "Special:MovePage/".concat( config.page.name ) ), currentUserRights : ['move'], pageExists : !0, pageMovable : !0 } },				_defineProperty( _page, config.page["protected"] ? 'change-protection' : 'protect-page', { url : mw.util.getUrl( config.page.name, { action : 'protect' } ), currentUserRights : ['protect','stablesettings'] } ), _defineProperty( _page, 'purge-cache', { url : mw.util.getUrl( config.page.name, { action : 'purge', forcelinkupdate : !0 } ), pageExists : !0 } ), _defineProperty( _page, 'subpages', { url : mw.util.getUrl( "Special:PrefixIndex/".concat( config.page.name, "/" ) ) } ), _defineProperty( _page, 'undelete-page', { url : mw.util.getUrl( "Special:Undelete/".concat( config.page.name ) ), currentUserRights : ['undelete'], pageDeleted : !0 } ), _defineProperty( _page, 'watch', { url : '#', visible : -1 !== ['monobook','modern'].indexOf( config.currentUser.skin ) } ), _page) 			};		};		"use strict";		function _defineProperty(obj,key,value) { 			if (key in obj) {				Object.defineProperty(obj,key, { value : value, enumerable : !0, configurable : !0, writable : !0 } );			} else { obj[key] = value; }			return obj;		}	$( function { window.MoreMenu = window.MoreMenu || {}; if (window.moreMenuDebug) { console.info( '[MoreMenu] Debugging enabled. To disable, check your personal JS and remove `MoreMenu.debug = true;`.' ); }		var api = new mw.Api; var ignoreI18nWarnings = !1; var isRtl = 'rtl' === $('html').prop('dir'); var leftKey = isRtl ? 'right' : 'left'; var rightKey = isRtl ? 'left' : 'right'; var config = new function{ this.project = { domain : mw.config.get('wgServerName'), siteName : mw.config.get('wgSiteName'), dbName : mw.config.get('wgDBname'), noticeProject : mw.config.get('wgNoticeProject'), contentLanguage : mw.config.get('wgContentLanguage') }; this.page = { name : mw.config.get('wgPageName'), nsId : mw.config.get('wgNamespaceNumber'), "protected" : !!mw.config.get('wgRestrictionEdit') && mw.config.get('wgRestrictionEdit').length || !!mw.config.get('wgRestrictionCreate') && mw.config.get('wgRestrictionCreate').length, id : mw.config.get('wgArticleId'), movable : !mw.config.get('wgIsMainPage') && !!$('#ca-move').length }; $.extend( this.page, { escapedName : this.page.name.replace(/[?!'"*]/g, escape), encodedName : encodeURIComponent( this.page.name ) } );			this.currentUser = { skin : mw.config.get('skin'), groups : mw.config.get('wgUserGroups'), groupsData : {}, rights : [] };			this.targetUser = { name : mw.config.get('wgRelevantUserName') || '', groups : [], rights : [], blocked : !1, ipRange : !1 };			if( !this.targetUser.name && 'Contributions' === mw.config.get('wgCanonicalSpecialPageName') && !$('.mw-userpage-userdoesnotexist')[0]) {				this.targetUser.name = mw.config.get('wgTitle').split('/').slice(1).join('/');				this.targetUser.ipRange = !0; this.targetUser.ipv4Range = mw.util.isIPv4Address( this.targetUser.name.split('/')[0] );			}			$.extend(this.targetUser,{escapedName:this.targetUser.name.replace(/[?!'"*]/g,escape),encodedName:encodeURIComponent(this.targetUser.name)}); };		function log(message) { var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'debug'; if ( !(window.moreMenuDebug || 'debug' !== level ) ) { return; }			message = "[MoreMenu] ".concat(message); if ( ['','warn','error'].indexOf(level) >= 0 ) { message += '\nSee https://w.wiki/9Se for documentation.'; }			console[level](message); }		function getModule(name) { if ( !MoreMenu[name] ) { log( "Missing module MoreMenu.".concat(name,".js"), 'warn' ); }			return MoreMenu[name]; }		function msg(key) { var ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1; var translation = getModule('messages')[key]; if ( !translation && !ignore && !ignoreI18nWarnings ) { log( "Missing translation for \"".concat( key, "\" in MoreMenu.messages.en.js" ), 'warn' ); }			return getModule('messages')[key] || key; }		function msgExists(key) { return undefined !== getModule('messages')[key]; }		function normalizeId(id) { return id.toLowerCase.replace(/\s+/g,'-'); }		function getItemId(parentKey,itemKey) { var submenuKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; return "mm-".concat( normalizeId( parentKey ) ) + ( submenuKey ? "-".concat( normalizeId( submenuKey ) ) : ) + ( 'string' === typeof itemKey ? "-".concat(normalizeId(itemKey)) :  ); }		function loadTranslations{ var dfd = $.Deferred; var lang = mw.config.get('wgUserLanguage'); if ('en'===lang) { return dfd.resolve; }			mw.loader.getScript('https://meta.wikimedia.org/w/index.php?action=raw&ctype=text/javascript'+"&title=MediaWiki:Gadget-MoreMenu.messages.".concat(lang,".js")).then(function { return dfd.resolve; } ); return dfd; }		function getPromises { var promises = new Array(4); if ( config.targetUser.name && !config.targetUser.ipv4Range ) { promises[0] = api.get( { action : 'query', list : 'users|blocks', ususers : config.targetUser.name, bkusers : config.targetUser.name, usprop : 'blockinfo|groups|rights|emailable', bkprop : 'id'} ); }			config.currentUser.rights = JSON.parse( mw.storage.session.getObject('mmUserRights') ); if( !config.currentUser.rights ) { promises[1] = mw.user.getRights; }			config.currentUser.groupsData = JSON.parse( mw.storage.session.getObject('mmMetaUserGroups') ); if( !config.currentUser.groupsData ) { promises[2] = api.get( { action : 'query', meta : 'siteinfo', siprop : 'usergroups' } ); }			promises[3] = loadTranslations; return promises; }		function canAddRemoveGroups(groups,rights) { if( rights && rights.indexOf('userrights') >= 0 ) { return true; }			var valid = groups.some( function(group){ return config.currentUser.groupsData[group] && config.currentUser.groupsData[group].canAddRemoveGroups; } ); if ( !valid ) { mw.storage.remove('metaUserGroups'); }			return valid; }		function hasConditional(permitted,given) { permitted = $.makeArray(permitted); given = $.makeArray(given); if( !permitted.length ) { return true; }		if ( !given.length ) { return false; }		return given.some( function(item) { return permitted.indexOf(item) >= 0; } ); }	function getItemHtml(parentKey,itemKey,itemData) { var submenuKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; var namespaceExclusion = itemData.namespaceExclude ? !hasConditional( itemData.namespaceExclude,config.page.nsId ) : !0; var databaseExclusion = itemData.databaseExclude ? !hasConditional( itemData.databaseExclude,config.page.dbName ) : !0; var conditions = { noticeProject : hasConditional( itemData.noticeProjectRestrict,config.project.noticeProject ), database : hasConditional( itemData.databaseRestrict,config.project.dbName ) && databaseExclusion, namespaceRestrict : hasConditional( itemData.namespaceRestrict,config.page.nsId ) && namespaceExclusion, pageExists : itemData.pageExists && config.page.id > 0 || !itemData.pageExists, pageDeleted : itemData.pageDeleted ? !config.page.id : !0, pageProtected : itemData.pageProtected ? config.page["protected"] : !0, pageMovable : itemData.pageMovable ? config.page.movable : !0, currentUserGroups : hasConditional( itemData.currentUserGroups,config.currentUser.groups ), currentUserRights : hasConditional( itemData.currentUserRights,config.currentUser.rights ), currentUserChangeGroups : itemData.currentUserChangeGroups ? canAddRemoveGroups( config.currentUser.groups, config.currentUser.rights ) : !0, visibility : undefined !== itemData.visible ? !!itemData.visible : !0 };		if ( config.targetUser.name ) { $.extend( conditions, { targetUserGroups : hasConditional( itemData.targetUserGroups, config.targetUser.groups ), targetUserRights : hasConditional(itemData.targetUserRights, config.targetUser.rights ), targetUserBlocked : itemData.targetUserBlocked !== undefined ? config.targetUser.blocked === itemData.targetUserBlocked : !0, targetUserChangeGroups : itemData.targetUserChangeGroups ? canAddRemoveGroups( config.targetUser.groups, config.targetUser.rights ) : !0, targetUserIp : itemData.targetUserIp ? mw.util.isIPAddress( config.targetUser.name ) || config.targetUser.ipRange && itemData.targetUserIpRange : !0 } ); }		var passed = !0; for ( var condition in conditions ) { passed &= conditions[condition]; if ( !passed ) { log( "".concat(parentKey,"/" ).concat( itemKey," failed on " ).concat( condition )); return''; }		}		var titleAttr = msgExists( "".concat(itemKey,"-desc") ) || itemData.description ? " title=\"".concat( itemData.description ? itemData.description : msg( "".concat(itemKey,"-desc") ), "\"" ) : ''; var styleAttr = itemData.style ? " style=\"".concat(itemData.style,"\"") : ''; return "\n           \n                \n                    ").concat(msg( itemData.title || itemKey ),"\n                \n            "); }	function addCSS { switch ( config.currentUser.skin ) { case 'vector' : return mw.util.addCSS(				"\n               .mm-submenu {\n                    border-top-width: 1px !important;\n                    min-width: 120px !important;\n                    top: -1px !important;\n                }\n                #p-views {\n                    padding-left: inherit !important;\n                    padding-right: inherit !important;\n                }\n                #p-views .vector-menu-content::after {\n                    display: none !important;\n                }\n                .rtl #p-views .vector-menu-content::before {\n                    display: none !important;\n                }\n            "); case 'timeless' : return mw.util.addCSS(				"\n               .mm-submenu-wrapper {\n                    cursor: default;\n                }\n                .mm-submenu {\n                    background: #f8f9fa;\n                    border: 1px solid rgb(200, 204, 209);\n                    box-shadow: 0 2px 3px 1px rgba(0, 0, 0, 0.05);\n                    padding: 1.2em 1.5em !important;\n                    top: -1.2em;\n                    white-space: nowrap;\n                    z-index: 95;\n                }\n                .mm-submenu::after {\n                    border-bottom: 8px solid transparent;\n                    border-top: 8px solid transparent;\n                    border-".concat(leftKey,": 8px solid rgb(200, 204, 209);\n                    content: '';\n                    height: 0;\n                    padding-").concat(rightKey,": 4px;\n                    position: absolute;\n                    top: 20px;\n                    width: 0;\n                    ").concat(rightKey,": -13px;\n                }\n                @media screen and (max-width: 1339px) and (min-width: 1100px) {\n                    .mm-submenu::after {\n                        border-").concat(leftKey,": none;\n                        border-").concat(rightKey,": 8px solid rgb(200, 204, 209);\n                        padding-").concat(leftKey,": 4px;\n                        padding-").concat(rightKey,": inherit;\n                        ").concat(rightKey,": inherit;\n                        ").concat(leftKey,": -35px;\n                    }\n                }\n                @media screen and (max-width: 850px) {\n                    .mm-submenu {\n                        top: -2.2em;\n                    }\n                }\n            ")); case'monobook':return mw.util.addCSS(				"\n               .mm-tab {\n                    position: relative;\n                }\n                .mm-menu {\n                    background: #fff;\n                    border-bottom: 1px solid #aaa;\n                    ".concat(leftKey,": -1px;\n                    margin: 0;\n                    position: absolute;\n                    z-index: 99;\n                }\n                .mm-menu ~ a {\n                    z-index: 99 !important;\n                }\n                .mm-submenu {\n                    background: #fff;\n                    border-bottom: 1px solid #aaa;\n                    border-top: 1px solid #aaa;\n                    font-size: inherit;\n                    margin: 0;\n                    min-width: 75px;\n                    top: -1px;\n                    z-index: 95;\n                }\n                .mm-item, .mm-submenu-wrapper {\n                    background: #fff !important;\n                    border-top: 0 !important;\n                    display: block !important;\n                    margin: 0 !important;\n                    padding: 0 !important;\n                    width: 100%;\n                }\n                .mm-item a, .mm-submenu-wrapper a {\n                    background: transparent !important;\n                    text-transform: none !important;\n                }\n                .mm-menu a:hover {\n                    text-decoration: underline !important;\n                }\n            ") );			case 'modern' : return mw.util.addCSS( "\n               .mm-menu, .mm-submenu {\n                    background: #f0f0f0 !important;\n                    border: solid 1px #666;\n                }\n                .mm-menu {\n                    border-top: none;\n                    position: absolute;\n                    z-index: 99;\n                }\n                .mm-submenu-wrapper > a {\n                    cursor: default !important;\n                }\n                .mm-item, .mm-submenu-wrapper {\n                    display: block !important;\n                    float: none !important;\n                    height: inherit !important;\n                    margin: 0 !important;\n                    padding: 0 !important;\n                }\n                .mm-menu a {\n                    display: inline-block;\n                    padding: 3px 10px !important;\n                    text-transform: none !important;\n                    text-decoration: none !important;\n                    white-space: nowrap;\n                    width: 100%;\n                }\n                .mm-menu a:hover {\n                    text-decoration: underline !important;\n                }\n                .mm-submenu {\n                    ".concat(leftKey," : 100%;\n                    min-width: 120px !important;\n                    top: 0;\n                }\n            ")); default : return null; }	}	function getSubmenuCss($element) { switch( config.currentUser.skin ) { case 'vector' : return _defineProperty( {}, leftKey, $element.outerWidth ); case 'timeless' : return _defineProperty( {}, $(window).width <= 1339 && $(window).width >= 1100 ? leftKey : rightKey, $element.outerWidth + 11); case 'monobook' : return _defineProperty( {}, leftKey, $element.outerWidth - 2 ); default : return{}; }	}	function addListeners { $('.mm-submenu-wrapper').each( function hoverMenus {			$(this).off('mouseenter').on('mouseenter', function hoverMenusMouseenter { $(this).find('.mm-submenu').css(getSubmenuCss($(this))).show; }).off('mouseleave').on('mouseleave',function hoverMenusMouseleave { $(this).find('.mm-submenu').hide; });		});	}	function sortByTranslation(i18nKeys) { return i18nKeys.sort(function(a,b) {			var nameA = msg(a).toLowerCase;			var nameB = msg(b).toLowerCase;			if( nameA < nameB ) {				return -1;			}			if ( nameA > nameB ) {				return 1;			}			return 0;		}); }	function sortItems(items) { var itemKeys = Object.keys(items); var submenus = itemKeys.filter(function(itemKey) {			return !items[itemKey].url;		}); var sortedItemKeys = sortByTranslation(itemKeys.filter(function(itemKey) { return !!items[itemKey].url; }));		var newItemKeys = sortedItemKeys; sortedItemKeys.forEach(function(itemKey) {			var target = items[itemKey].insertAfter;			var newIndex;			if ( false === target ) {				newIndex = 0;			} else if ( true === target ) {				newIndex = itemKeys.length;			} else if ( !target ) {				return;			} else {				newIndex = newItemKeys.indexOf(target);				newIndex = -1 === newIndex ? newItemKeys.length : newIndex + 1;			}			newItemKeys.splice(newItemKeys.indexOf(itemKey),1);			newItemKeys.splice(newIndex,0,itemKey);		}); return submenus.concat(newItemKeys); }	function getMenuHtml(parentKey,items,submenuKey) { var html = ''; var submenuClasses = 'vector' === config.currentUser.skin ? 'vector-menu-content-list' : ;sortItems(items).forEach(function(itemKey) {			var item = items[itemKey];			var itemHtml = ;			if ( !item.url ) { itemHtml += 				"\n                   \n                    ").concat(msg(itemKey),"&hellip;\n                    ");sortItems(item).forEach(function(submenuItemKey) { itemHtml += getItemHtml( parentKey, submenuItemKey, item[submenuItemKey], itemKey ); });				itemHtml += '';				if ( 0 === $(itemHtml).last.find('.mm-submenu li').length ) {					itemHtml = '';				}			} else {				itemHtml += getItemHtml(parentKey,itemKey,item,submenuKey);			}			html += itemHtml;		}); return html; }	function drawMenuVector(parentKey,html) { html = "") + "")+" ").concat(msg(parentKey),"  ")+' '+"".concat(html,"</ul>")+' '; $(html).insertAfter( $('#p-views, .mm-page').last ); }	function drawMenuTimeless(parentKey,html) { html = "<div role=\"navigation\" class=\"mw-portlet mm-".concat(parentKey," mm-tab\" id=\"p-").concat(parentKey,"\" aria-labelledby=\"p-").concat(parentKey,"-label\">") + "<h3 id=\"p-".concat(parentKey,"-label\">").concat(msg(parentKey)," ") + "<div class=\"mw-portlet-body\"><ul class=\"mm-menu\">".concat(html,"</ul> "); if ( $('#p-cactions').length ) { $(html).insertBefore($('#p-cactions')); } else { $('#page-tools .sidebar-inner').prepend(html); }	}	function drawMenuMonobook(parentKey,html){ html = "")+"<a href=\"javascript:void(0)\">".concat(msg(parentKey),"</a>") + "<ul class=\"mm-menu\" style=\"display:none\">".concat(html,"</ul>") + '</li>'; var $tab = $(html).insertAfter($('#ca-nstab-special, #ca-edit, #ca-ve-edit, #ca-page, #ca-viewsource, #ca-talk').last); var $menu = $tab.find('.mm-menu'); $tab.on('mouseenter', function {			$menu.show;			$tab.find('> a').css({'z-index' : 99});		}).on('mouseleave', function {			$menu.hide;			$tab.find('> a').css({'z-index':'inherit'});		}); }	function drawMenuModern(parentKey,html) { html = "") + "<a href=\"javascript:void(0)\">".concat(msg(parentKey),"</a>") + "<ul class=\"mm-menu\" style=\"display:none\">".concat(html,"</ul>") + '</li>'; var $tab = $(html).insertAfter($('#ca-nstab-special, #ca-edit, #ca-ve-edit, #ca-page, #ca-viewsource, #ca-talk').last); var $menu = $tab.find('.mm-menu'); $menu.css( { left:isRtl ? $tab.position.left-$menu.width + $tab.width + 7 : $tab.position.left, top : $tab.offset.top + $tab.outerHeight}); $tab.on('mouseenter', function {			$menu.show;		}).on('mouseleave', function {			$menu.hide;		}); } function drawMenus { var menus = {}; if ( config.page.nsId >= 0 ) { $.extend(menus,getModule('page')(config)); }		if ( config.targetUser.name ) { $.extend(menus,getModule('user')(config)); }		addCSS; Object.keys(menus).forEach(function(key) {			var html = getMenuHtml(key,menus[key]);			switch ( config.currentUser.skin ) {				case 'vector' : drawMenuVector(key,html);				break;				case 'monobook' : drawMenuMonobook(key,html);				break;				case 'modern' : drawMenuModern(key,html);				break;				case 'timeless' : drawMenuTimeless(key,html);				break;				default : log( "'".concat(config.currentUser.skin,"' is not a supported skin."),'error' );			}		}); addListeners; }	function handleHistoryAndWatchLinks { var replace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1; var monobookModern = -1 !== ['monobook','modern'].indexOf(config.currentUser.skin); var $histLink = $('#ca-history'); var $watchLink = $('.mw-watchlink'); var $moveLink = $('#ca-move'); if ( replace ) { if ( monobookModern ) { $('#mm-page-watch').replaceWith($watchLink.addClass('mm-item').prop('id','mm-page-watch').show); $('#mm-page-history').replaceWith($histLink.addClass('mm-item').prop('id','mm-page-history').show); }			$('#mm-page-move-page').replaceWith($moveLink.addClass('mm-item').prop('id','mm-page-move-page').show); return; }		MoreMenu.messages.watch = $watchLink.text || 'watch'; MoreMenu.messages.history = $histLink.text || 'history'; if ( monobookModern ) { $watchLink.hide; $histLink.hide; }		$moveLink.hide; }	function addMutationObserver(ids) { if ( 'string' === typeof ids ) { ids = [ids]; }		ids.forEach(function(id) {			var $parent = $(id);			if ( !$parent.length ) {				return;			}			var $menu = $parent.find('ul');			var menuIsEmpty = function menuIsEmpty {				return '' === $menu.html.trim;			};			if ( menuIsEmpty ) {				$parent.hide;			}			new MutationObserver(function(mutations) { mutations.forEach(function(mutation) {					if(mutation.addedNodes.length) {						$parent.show;					} else if ( mutation.removedNodes.length ) {						if( menuIsEmpty ) {							$parent.hide;						}					}				}); }).observe( $menu.get(0), { childList : !0 } );		}); }	function observeCactionsMenu { var reAddCount = parseInt( mw.storage.get('mmNativeMenuUsage'), 10 ) || 0; if ( -1 === ['vector','timeless'].indexOf(config.currentUser.skin) || !!window.moreMenuDisableAutoRemoval || reAddCount >= 5 ) { return; }		addMutationObserver('#p-cactions'); setTimeout(function{			if ( $('#p-cactions').find('li').length ) {				mw.storage.set( 'mmNativeMenuUsage', reAddCount + 1 );			}		}, 5000); }	function removeNativeLinks { var linksToRemove = ['#ca-protect','#ca-unprotect','#ca-delete','#ca-undelete']; if ( 'timeless' === config.currentUser.skin ) { linksToRemove.push.apply(linksToRemove,['#t-contributions','#t-log','#t-blockip','#t-emailuser','#t-userrights','#t-info','#t-pagelog']); }		$(linksToRemove.join(',')).remove; handleHistoryAndWatchLinks; observeCactionsMenu; if ( 'timeless' === config.currentUser.skin ) { addMutationObserver('#p-userpagetools'); }	}	function removeBlockLogLink { api.get( { action : 'query', list : 'logevents', letype : 'block', letitle : "User:".concat(config.targetUser.name), lelimit : 1} ).done(function(data){			if ( !data.query.logevents.length ) {				$('#mm-user-blocks-view-block-log').remove;			}		}); }	function removeUnneededLinks { handleHistoryAndWatchLinks(true); if ( !config.targetUser.name ) { return; }		removeBlockLogLink; addMutationObserver(['#mm-page-analysis','#mm-page-search','#mm-page-tools','#mm-user-blocks','#mm-user-analysis']); if ( config.targetUser.ipRange ) { $('#mm-user-user-logs').remove; $('#mm-user-deleted-contributions').remove; $('#mm-user-suppressed-contributions').remove; $('#mm-user-analysis').remove; }	}	function init { $.when.apply(this,getPromises).done(function(targetUserData,userRightsData,metaData) {			if ( targetUserData ) {				$.extend(config.targetUser,targetUserData[0].query.users[0]);				if ( targetUserData[0].query.blocks.length ) { 					config.targetUser.blocked = !0;					config.targetUser.blockid = targetUserData[0].query.blocks[0].id;				}			}			if ( userRightsData ) {				log('caching user rights');				mw.storage.session.setObject('mmUserRights',JSON.stringify(userRightsData));				config.currentUser.rights = userRightsData.slice;			}			if(metaData) {				log('caching global user groups');				config.currentUser.groupsData = {};				metaData[0].query.usergroups.forEach(function(el){ config.currentUser.groupsData[el.name] = { rights : el.rights, canAddRemoveGroups : !!el.add || !!el.remove }; });				mw.storage.session.setObject('mmMetaUserGroups',JSON.stringify(config.currentUser.groupsData));			}			removeNativeLinks;			drawMenus;			removeUnneededLinks;			mw.hook('moremenu.ready').fire(config);		}); }	function getBeforeItem(menu,submenu,insertAfter) { var beforeItemKey = getItemId( menu, insertAfter || '', submenu); return $("#".concat(beforeItemKey)); }	MoreMenu.addItemCore = function(menu,items,insertAfter,submenu) { if ( !$(".mm-".concat(menu)).length ) { return; }		var menuId = submenu ? "#mm-".concat(menu,"-").concat(submenu) : ".mm-".concat(menu); var $menu = $(menuId); if ( !$menu.length ) { log("'".concat(menu).concat(submenu ? " ".concat(submenu) : '', "' menu with selector " ).concat(menuId," not found."),'warn'); return; }		ignoreI18nWarnings = !0; if ( Object.keys(items).length !== 1 ) { log('MoreMenu.addItemCore was given multiple items. Ignoring all but the first.','warn'); items = items[Object.keys(items)[0]]; }		var $html = $(getMenuHtml(menu,items,submenu)); var $beforeItem = getBeforeItem(menu,submenu,insertAfter); var isSubmenuItem = $beforeItem.parents('.mm-submenu').length; if ( $beforeItem.length && ( !submenu || submenu && isSubmenuItem ) ) { $beforeItem.after($html); } else { var newI18nKey = normalizeId(Object.keys(items)[0]); var newId = getItemId(menu,newI18nKey,submenu); var $topItems = submenu ? $(menuId).find('.mm-submenu > .mm-item') : $(menuId).find('.mm-menu > .mm-item'); if ( true === insertAfter ) { $topItems.last.after($html); return; }			if ( false === insertAfter ) { $topItems.first.before($html); return; }			if ( !$beforeItem.length && insertAfter ) { log('getMenuHtml was given an invalid `insertAfter`.','warn'); }			var ids = $.map($topItems,function(el){				return el.id;			}).concat([newId]); var i18nKeys = sortByTranslation(ids.map(function(id){ return id.replace( 				new RegExp("^mm-".concat(menu,"-").concat(submenu ? "".concat(submenu,"-") :  )), 				); }));			var beforeItemIndex = i18nKeys.indexOf(newI18nKey) - 1; if ( beforeItemIndex < 0 ) { $("#".concat(ids[0])).before($html); } else { $("#".concat(getItemId(menu,i18nKeys[Math.max(0,i18nKeys.indexOf(newI18nKey) - 1)],submenu))).after($html); }		}		addListeners; ignoreI18nWarnings = !1; };	MoreMenu.addItem = function(menu,name,data,insertAfter) { MoreMenu.addItemCore(menu,_defineProperty({},name,data),insertAfter); };	MoreMenu.addSubmenuItem = function(menu,submenu,name,data,insertAfter) { MoreMenu.addItemCore(menu,_defineProperty({},name,data),insertAfter,submenu); };	MoreMenu.addSubmenu = function(menu,name,items,insertAfter) { MoreMenu.addItemCore(menu,_defineProperty({},name,items),insertAfter); };	MoreMenu.addLink = function(menu,name,url,insertAfter) { MoreMenu.addItemCore(menu,_defineProperty({},name,{ url : url }),insertAfter); };	MoreMenu.addSubmenuLink = function(menu,submenu,name,url,insertAfter) { MoreMenu.addItemCore(menu,_defineProperty({},name,{ url : url }),insertAfter,submenu); };	init; }); });