{"version":3,"sources":["/w/extensions/Popups/webpack/bootstrap","/w/extensions/Popups/./node_modules/redux-thunk/dist/redux-thunk.min.js","/w/extensions/Popups/./node_modules/redux/dist/redux.min.js","/w/extensions/Popups/(webpack)/buildin/global.js","/w/extensions/Popups/(webpack)/buildin/module.js","/w/extensions/Popups/./src/counts.js","/w/extensions/Popups/./src/constants.js","/w/extensions/Popups/./src/bracketedPixelRatio.js","/w/extensions/Popups/./src/preview/model.js","/w/extensions/Popups/./src/formatter.js","/w/extensions/Popups/./src/gateway/mediawiki.js","/w/extensions/Popups/./src/gateway/rest.js","/w/extensions/Popups/./src/gateway/restFormatters.js","/w/extensions/Popups/./src/gateway/page.js","/w/extensions/Popups/./src/gateway/reference.js","/w/extensions/Popups/./src/ui/templates/templateUtil.js","/w/extensions/Popups/./src/ui/templates/settingsDialog/settingsDialog.js","/w/extensions/Popups/./src/ui/settingsDialogRenderer.js","/w/extensions/Popups/./src/ui/settingsDialog.js","/w/extensions/Popups/./src/changeListener.js","/w/extensions/Popups/./src/title.js","/w/extensions/Popups/./src/wait.js","/w/extensions/Popups/./src/ui/thumbnail.js","/w/extensions/Popups/./src/ui/templates/popup/popup.js","/w/extensions/Popups/./src/ui/templates/preview/preview.js","/w/extensions/Popups/./src/ui/templates/referencePreview/referencePreview.js","/w/extensions/Popups/./src/ui/templates/pagePreview/pagePreview.js","/w/extensions/Popups/./src/ui/renderer.js","/w/extensions/Popups/./src/changeListeners/syncUserSettings.js","/w/extensions/Popups/./src/changeListeners/index.js","/w/extensions/Popups/./src/changeListeners/footerLink.js","/w/extensions/Popups/./src/changeListeners/eventLogging.js","/w/extensions/Popups/./src/changeListeners/linkTitle.js","/w/extensions/Popups/./src/changeListeners/pageviews.js","/w/extensions/Popups/./src/changeListeners/render.js","/w/extensions/Popups/./src/changeListeners/settings.js","/w/extensions/Popups/./src/changeListeners/statsv.js","/w/extensions/Popups/./src/actionTypes.js","/w/extensions/Popups/./src/actions.js","/w/extensions/Popups/./src/reducers/nextState.js","/w/extensions/Popups/./src/reducers/eventLogging.js","/w/extensions/Popups/./src/reducers/index.js","/w/extensions/Popups/./src/reducers/pageviews.js","/w/extensions/Popups/./src/reducers/preview.js","/w/extensions/Popups/./src/reducers/settings.js","/w/extensions/Popups/./src/reducers/statsv.js","/w/extensions/Popups/./src/index.js","/w/extensions/Popups/./src/setUserConfigFlags.js","/w/extensions/Popups/./src/experiments.js","/w/extensions/Popups/./src/userSettings.js","/w/extensions/Popups/./src/isReferencePreviewsEnabled.js","/w/extensions/Popups/./src/instrumentation/statsv.js","/w/extensions/Popups/./src/instrumentation/eventLogging.js","/w/extensions/Popups/./src/isPagePreviewsEnabled.js","/w/extensions/Popups/./src/previewBehavior.js","/w/extensions/Popups/./src/integrations/mwpopups.js","/w/extensions/Popups/./src/ui/pointer-mask.svg"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","e","id","loaded","dispatch","getState","withExtraArgument","default","observable","self","window","global","Math","random","toString","substring","split","join","INIT","REPLACE","PROBE_UNKNOWN_ACTION","type","apply","this","arguments","u","configurable","writable","a","length","Array","reduce","createStore","Error","f","slice","h","push","indexOf","splice","y","getPrototypeOf","subscribe","replaceReducer","TypeError","next","unsubscribe","combineReducers","keys","forEach","bindActionCreators","applyMiddleware","map","getOwnPropertySymbols","concat","filter","getOwnPropertyDescriptor","compose","__DO_NOT_USE__ActionTypes","g","Function","webpackPolyfill","deprecate","paths","children","getEditCountBucket","count","bucket","getPreviewCountBucket","undefined","bpr","dpr","devicePixelRatio","bracketedPixelRatio","BRACKETED_DEVICE_PIXEL_RATIO","THUMBNAIL_SIZE","max","EXTRACT_LENGTH","previewTypes","TYPE_GENERIC","TYPE_PAGE","TYPE_DISAMBIGUATION","TYPE_REFERENCE","createModel","title","url","languageCode","languageDirection","extract","thumbnail","pageId","processedExtract","processExtract","getPagePreviewType","createNullModel","getPreviewType","el","config","getNamespaceId","getMainText","isSelfLink","getFragment","$","parent","hasClass","formatPlainTextExtract","plainTextExtract","elements","boldIdentifier","snip","replace","trim","escapedTitle","mw","util","escapeRegExp","regExp","RegExp","part","text","document","createTextNode","makeTitleInExtractBold","extractPageFromResponse","data","query","pages","result","extend","formatter","convertPageToModel","page","canonicalurl","pagelanguagehtmlcode","pagelanguagedir","pageid","createRESTBaseGateway","ajax","extractParser","fetch","endpoint","encodeURIComponent","headers","Accept","acceptLanguage","fetchPreviewForTitle","titleText","getPrefixedDb","xhr","then","catch","jqXHR","textStatus","errorThrown","Deferred","reject","exception","promise","abort","generateThumbnailData","original","thumbSize","parts","source","lastPart","originalIsSafe","filename","test","isSafeImgFormat","filenamePxIndex","width","height","substr","floor","Title","getUrl","lang","dir","originalimage","parseHTMLResponse","extract_html","parseHTML","parsePlainTextResponse","createPagePreviewGateway","gatewayConfig","constants","restConfig","api","action","prop","formatversion","redirects","exintro","exchars","explaintext","exsectionformat","piprop","pithumbsize","pilicense","rvprop","inprop","titles","smaxage","maxage","uselang","createMediaWikiApiGateway","Api","formatters","createReferenceGateway","scrapeReferenceType","$referenceText","KNOWN_TYPES","find","each","index","element","classNames","className","idSelector","escapeSelector","scrapeReferenceText","readyState","model","html","referenceType","sourceElementId","parentNode","resolve","escapeHTML","str","escape","templates","createNodeFromTemplate","div","createElement","innerHTML","firstElementChild","cloneNode","renderSettingsDialog","heading","saveLabel","closeLabel","helpText","okLabel","choices","description","isChecked","escapeChoices","createSettingsDialogRenderer","referencePreviewsAvaliable","$dialog","$overlay","boundActions","msg","createSettingsDialog","addClass","on","enabled","is","saveSettings","hideSettings","appendTo","show","hide","toggleHelp","visible","$el","setEnabled","registerChangeListener","store","callback","previousState","state","fromElement","hash","host","location","pathname","search","isOwnPageAnchorLink","newFromText","decodeURIComponent","contentNamespaces","mwTitle","namespace","isValid","href","linkHref","Uri","hostname","queryLength","pattern","matches","exec","path","fragment","getTitle","wait","delay","deferred","setTimeout","SIZES","w","createThumbnail","rawThumbnail","useCSSClipPath","x","tall","thumbWidth","thumbHeight","img","isNarrow","src","thumbnailWidth","thumbnailHeight","nsSvg","line","createElementNS","points","setAttribute","$thumbnailSVGImage","setAttributeNS","attr","$thumbnail","xmlns","append","createThumbnailSVG","isTall","offset","renderPopup","container","appendChild","renderPreview","showTitle","extractMsg","linkMsg","$popup","remove","LOGGING_SCHEMA","isTracking","renderReferencePreview","titleMsg","message","exists","replaceWith","target","rel","removeClass","tabindex","track","scrolledToBottom","scrollTop","scrollHeight","clientHeight","isOpenRecorded","scrollbarsPresent","isScrollRecorded","isScrolling","$extract","hasHorizontalScroll","scrollWidth","clientWidth","scrollbarHeight","offsetHeight","hasVerticalScroll","scrollbarWidth","offsetWidth","css","bottom","right","toggleClass","navigator","sendBeacon","renderPagePreview","withCSSClipPath","linkTitle","extractWidth","getExtractWidth","init","supportsCSSClipPath","body","pointerMaskSVG","render","preview","hasThumbnail","createPagePreview","createDisambiguationPreview","createReferencePreview","createEmptyPreview","createPreviewWithType","event","token","measures","$link","behavior","layout","isPreviewTall","pointerSpaceSize","offsetLeft","flippedX","flippedY","offsetTop","pageY","getClosestYPosition","clientRects","top","clientTop","clientY","pageX","left","windowWidth","windowHeight","createLayout","classes","predefinedLandscapeImageHeight","popup","maskID","getThumbnailClipPathID","matrix","scaleX","translateX","min","getElementById","setThumbnailClipPath","layoutPreview","getClasses","first","trigger","previewDwell","previewAbandon","click","settingsUrl","stopPropagation","showSettings","bindBehavior","previewShow","documentElement","getAttribute","fadeInClass","fadeOutClass","CSS","supports","rects","isTop","minY","rect","deltaY","abs","ceil","syncIfChanged","oldState","newState","sync","current","footerLink","$footerLink","$footer","createFooterLink","preventDefault","settings","shouldShowFooterLink","eventLogging","eventLoggingTracker","getCurrentTimestamp","eventLoggingObj","baseData","timestamp","eventLogged","hasPrevActiveLink","activeLink","previewType","destroyTitleAttr","pageviews","pageviewTracker","pageview","source_page_id","source_namespace","namespaceId","source_title","source_url","page_id","page_namespace","page_title","pageviewLogged","previewBehavior","shouldShow","renderer","fetchResponse","activeToken","settingsObj","showHelp","statsv","statsvObj","statsvLogged","syncUserSettings","userSettings","storePreviewCount","storePagePreviewsEnabled","storeReferencePreviewsEnabled","timedAction","baseAction","now","boot","initiallyEnabled","user","editCount","previewCount","getPreviewCount","types","isNavPopupsEnabled","sessionToken","sessionId","pageToken","getPageviewToken","isAnon","gateway","chain","err","fetchType","when","FETCH_COMPLETE_TARGET_DELAY","getDwellDelay","ex","showNullPreview","linkDwell","generateToken","isNewInteraction","abandon","linkClick","currentToken","validType","oldValue","newValue","nextState","updates","obj","hasOwn","constructor","clone","createEvent","interaction","actionData","linkInteractionToken","pageTitleHover","namespaceIdHover","timeToPreviewShow","perceivedWait","createClosingEvent","totalInteractionTime","round","finished","started","finalized","nextCount","bootAction","actionTypes","pageTitleSource","namespaceIdSource","pageIdSource","popupEnabled","previewCountBucket","counts","hovercardsSuppressedByGadget","editCountBucket","link","isUserDwelling","wasClicked","nothingChanged","every","userOptedOut","some","anyDisabled","fetchStartedAt","linkDwellStartedAt","EXCLUDED_LINK_SELECTORS","performance","popupsFlags","parseInt","set","mwExperiments","storage","Redux","generateRandomSessionId","pagePreviewGateway","referenceGateway","isPagePreviewsEnabled","isReferencePreviewsEnabled","isNaN","referencePreviewsState","options","settingsDialog","experiments","weightedBoolean","trueWeight","getBucket","buckets","true","false","statsvTracker","bucketingRate","isStatsvEnabled","getStatsvTracker","getPageviewTracker","isEventLoggingEnabled","getEventLoggingTracker","createIsPagePreviewsEnabled","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","reducers","ReduxThunk","actions","createPreviewBehavior","registerActions","callbackCurrentTimestamp","changeListeners","registerChangeListeners","popups","isEnabled","createMediaWikiPopupsObject","selectors","excludedLinksSelector","validLinkSelector","rendererInit","titleFromElement","$target","$window","getClientRects","log","warn"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoB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UACjBmb,EAAUoE,EACV,MACD,KAAKzf,EAAaI,eACjBib,EAAUqE,EACV,MACD,QACC,OAGF,IAAMuC,EAAUzgB,EAAG/E,MACbylB,EAAU1gB,EAAG5F,QAEb8X,EAAW,CAChBgB,MAAOlB,EAAMkB,MACbN,MAAOZ,EAAMY,MACbK,QAASjB,EAAMiB,QACf7O,MAAOqc,EAAQrc,QACfC,OAAQoc,EAAQpc,SAChB6J,OAAQuS,EAAQvS,SAChB4E,YAAa7X,KAAK0lB,iBAClBvN,YAAasN,EAAQtc,QACrBiP,aAAcqN,EAAQrc,SACtBoL,UAAWiR,EAAQjR,aAGpBnG,EAAagR,UAAWjP,EAASpQ,KAAMiX,EAAU2H,EAASU,EAAexf,OAEzE2O,GAAI,gBAAiB4W,GAAmB,WACxBE,EAAkBvlB,KAAM0F,GAAGhB,SAG1C2J,EAAamR,aAGd/Q,GAAI,QAAS4W,GAAmB,WAChC,IAAMjV,EAAUmV,EAAkBvlB,KAAM0F,GAAGhB,QACtC0L,GACC7M,EAAaE,YAAce,EAAgBxE,KAAM0F,GAAGhB,OAAQ0L,IAChE/B,EAAaoR,UAAWzf,cA3D3B0F,GAAGigB,IAAIC,KAAM,oDA3Eb,GA4IFzmB,OAAO2jB,MAAQA,EACf3jB,OAAOslB,WAAaA,G,0CU1TpBhoB,EAAOD,QAAU","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.js\");\n","!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.ReduxThunk=e():t.ReduxThunk=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p=\"\",e(0)}([function(t,e,n){t.exports=n(1)},function(t,e){\"use strict\";function n(t){return function(e){var n=e.dispatch,o=e.getState;return function(e){return function(r){return\"function\"==typeof r?r(n,o,t):e(r)}}}}e.__esModule=!0;var o=n();o.withExtraArgument=n,e.default=o}])});","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?t(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],t):t(e.Redux={})}(this,function(e){\"use strict\";var t=function(e){var t,r=e.Symbol;return\"function\"==typeof r?r.observable?t=r.observable:(t=r(\"observable\"),r.observable=t):t=\"@@observable\",t}(\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof module?module:Function(\"return this\")()),r=function(){return Math.random().toString(36).substring(7).split(\"\").join(\".\")},n={INIT:\"@@redux/INIT\"+r(),REPLACE:\"@@redux/REPLACE\"+r(),PROBE_UNKNOWN_ACTION:function(){return\"@@redux/PROBE_UNKNOWN_ACTION\"+r()}};function o(e,t){var r=t&&t.type;return\"Given \"+(r&&'action \"'+r+'\"'||\"an action\")+', reducer \"'+e+'\" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function i(e,t){return function(){return t(e.apply(this,arguments))}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}e.createStore=function e(r,o,i){var u;if(\"function\"==typeof o&&\"function\"==typeof i||\"function\"==typeof i&&\"function\"==typeof arguments[3])throw Error(\"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function\");if(\"function\"==typeof o&&void 0===i&&(i=o,o=void 0),void 0!==i){if(\"function\"!=typeof i)throw Error(\"Expected the enhancer to be a function.\");return i(e)(r,o)}if(\"function\"!=typeof r)throw Error(\"Expected the reducer to be a function.\");var a=r,c=o,f=[],s=f,d=!1;function l(){s===f&&(s=f.slice())}function p(){if(d)throw Error(\"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.\");return c}function h(e){if(\"function\"!=typeof e)throw Error(\"Expected the listener to be a function.\");if(d)throw Error(\"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.\");var t=!0;return l(),s.push(e),function(){if(t){if(d)throw Error(\"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.\");t=!1,l();var r=s.indexOf(e);s.splice(r,1)}}}function y(e){if(!function(e){if(\"object\"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw Error(\"Actions must be plain objects. Use custom middleware for async actions.\");if(void 0===e.type)throw Error('Actions may not have an undefined \"type\" property. Have you misspelled a constant?');if(d)throw Error(\"Reducers may not dispatch actions.\");try{d=!0,c=a(c,e)}finally{d=!1}for(var t=f=s,r=0;t.length>r;r++)(0,t[r])();return e}return y({type:n.INIT}),(u={dispatch:y,subscribe:h,getState:p,replaceReducer:function(e){if(\"function\"!=typeof e)throw Error(\"Expected the nextReducer to be a function.\");a=e,y({type:n.REPLACE})}})[t]=function(){var e,r=h;return(e={subscribe:function(e){if(\"object\"!=typeof e||null===e)throw new TypeError(\"Expected the observer to be an object.\");function t(){e.next&&e.next(p())}return t(),{unsubscribe:r(t)}}})[t]=function(){return this},e},u},e.combineReducers=function(e){for(var t=Object.keys(e),r={},i=0;t.length>i;i++){var u=t[i];\"function\"==typeof e[u]&&(r[u]=e[u])}var a,c=Object.keys(r);try{!function(e){Object.keys(e).forEach(function(t){var r=e[t];if(void 0===r(void 0,{type:n.INIT}))throw Error('Reducer \"'+t+\"\\\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.\");if(void 0===r(void 0,{type:n.PROBE_UNKNOWN_ACTION()}))throw Error('Reducer \"'+t+\"\\\" returned undefined when probed with a random type. Don't try to handle \"+n.INIT+' or other actions in \"redux/*\" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(r)}catch(e){a=e}return function(e,t){if(void 0===e&&(e={}),a)throw a;for(var n=!1,i={},u=0;c.length>u;u++){var f=c[u],s=e[f],d=(0,r[f])(s,t);if(void 0===d){var l=o(f,t);throw Error(l)}i[f]=d,n=n||d!==s}return n?i:e}},e.bindActionCreators=function(e,t){if(\"function\"==typeof e)return i(e,t);if(\"object\"!=typeof e||null===e)throw Error(\"bindActionCreators expected an object or a function, instead received \"+(null===e?\"null\":typeof e)+'. Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?');for(var r=Object.keys(e),n={},o=0;r.length>o;o++){var u=r[o],a=e[u];\"function\"==typeof a&&(n[u]=i(a,t))}return n},e.applyMiddleware=function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw Error(\"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.\")},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=t.map(function(e){return e(o)});return function(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);\"function\"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){u(e,t,r[t])})}return e}({},r,{dispatch:n=a.apply(void 0,i)(r.dispatch)})}}},e.compose=a,e.__DO_NOT_USE__ActionTypes=n,Object.defineProperty(e,\"__esModule\",{value:!0})});\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","/**\n * @module counts\n */\n\n/**\n * Gets the count bucket for the number of edits a user has made.\n *\n * The buckets are defined as part of\n * [the Popups schema](https://meta.wikimedia.org/wiki/Schema:Popups).\n *\n * Extracted from `mw.popups.schemaPopups.getEditCountBucket`.\n *\n * @param {number} count\n * @return {string}\n */\nexports.getEditCountBucket = function getEditCountBucket( count ) {\n\tlet bucket;\n\n\tif ( count === 0 ) {\n\t\tbucket = '0';\n\t} else if ( count >= 1 && count <= 4 ) {\n\t\tbucket = '1-4';\n\t} else if ( count >= 5 && count <= 99 ) {\n\t\tbucket = '5-99';\n\t} else if ( count >= 100 && count <= 999 ) {\n\t\tbucket = '100-999';\n\t} else if ( count >= 1000 ) {\n\t\tbucket = '1000+';\n\t}\n\n\treturn `${bucket} edits`;\n};\n\n/**\n * Gets the count bucket for the number of previews a user has seen.\n *\n * If local storage isn't available - because the user has disabled it\n * or the browser doesn't support it - then \"unknown\" is returned.\n *\n * The buckets are defined as part of\n * [the Popups schema](https://meta.wikimedia.org/wiki/Schema:Popups).\n *\n * Extracted from `mw.popups.getPreviewCountBucket`.\n *\n * @param {number|null|string|boolean} [count]\n * @return {string}\n */\nexports.getPreviewCountBucket = function getPreviewCountBucket( count ) {\n\tlet bucket;\n\n\tif ( count === 0 ) {\n\t\tbucket = '0';\n\t} else if ( count >= 1 && count <= 4 ) {\n\t\tbucket = '1-4';\n\t} else if ( count >= 5 && count <= 20 ) {\n\t\tbucket = '5-20';\n\t} else if ( count >= 21 ) {\n\t\tbucket = '21+';\n\t}\n\n\treturn bucket !== undefined ? ( `${bucket} previews` ) : 'unknown';\n};\n","import bracketedPixelRatio from './bracketedPixelRatio';\n\nconst bpr = bracketedPixelRatio();\n\nexport default {\n\tBRACKETED_DEVICE_PIXEL_RATIO: bpr,\n\t// See https://phabricator.wikimedia.org/T272169: requesting a larger thumbnail to avoid bluriness\n\tTHUMBNAIL_SIZE: 320 * Math.max( bpr, 1.5 ),\n\tEXTRACT_LENGTH: 525\n};\n","/**\n * @module bracketedPixelRatio\n */\n\n/**\n * Normalizes a user's device pixel ratio to either 1, 1.5, or 2.\n *\n * This is important when the server resizes images on the fly in order to\n * reduce the work it has to do for device pixel ratios that deviate from a\n * set of common ratios.\n *\n * Adapted from mediawiki/core /resources/src/jquery/jquery.hidpi.js\n *\n * @param {number} [dpr=window.devicePixelRatio]\n * @return {number} The bracketed device pixel ratio\n */\nexport default function ( dpr = window.devicePixelRatio ) {\n\tif ( !dpr ) {\n\t\t// Probably legacy browser so assume 1\n\t\treturn 1;\n\t}\n\n\tif ( dpr > 1.5 ) {\n\t\treturn 2;\n\t}\n\n\tif ( dpr > 1 ) {\n\t\treturn 1.5;\n\t}\n\n\treturn 1;\n}\n","/**\n * @module preview/model\n */\n\n/**\n * Page Preview types as defined in Schema:Popups\n * https://meta.wikimedia.org/wiki/Schema:Popups\n *\n * @constant {Object}\n */\nconst previewTypes = {\n\t/** Empty preview used in error situations */\n\tTYPE_GENERIC: 'generic',\n\t/** Standard page preview with or without thumbnail */\n\tTYPE_PAGE: 'page',\n\t/** Disambiguation page preview */\n\tTYPE_DISAMBIGUATION: 'disambiguation',\n\t/** Reference preview **/\n\tTYPE_REFERENCE: 'reference'\n};\n\nexport { previewTypes };\n\n/**\n * Preview Model\n *\n * @typedef {Object} PreviewModel\n * @property {string} url The canonical URL of the page being previewed\n * @property {string} type One of the previewTypes.TYPE_… constants.\n *\n * @global\n */\n\n/**\n * @typedef {Object} PagePreviewModel\n * @extends PreviewModel\n * @property {string} title\n * @property {Array|undefined} extract `undefined` if the extract isn't\n * viable, e.g. if it's empty after having ellipsis and parentheticals\n * removed; this can be used to present default or error states\n * @property {string} languageCode\n * @property {string} languageDirection Either \"ltr\" or \"rtl\", or an empty string if undefined.\n * @property {{source: string, width: number, height: number}|undefined} thumbnail\n * @property {number} pageId Currently not used by any known popup type.\n *\n * @global\n */\n\n/**\n * @typedef {Object} ReferencePreviewModel\n * @extends PreviewModel\n * @property {string} extract An HTML snippet, not necessarily with a single top-level node\n * @property {string} referenceType A type identifier, e.g. \"web\"\n * @property {string} sourceElementId ID of the parent element that triggered the preview\n *\n * @global\n */\n\n/**\n * Creates a page preview model.\n *\n * @param {string} title\n * @param {string} url The canonical URL of the page being previewed\n * @param {string} languageCode\n * @param {string} languageDirection Either \"ltr\" or \"rtl\"\n * @param {Array|undefined|null} extract\n * @param {string} type\n * @param {{source: string, width: number, height: number}|undefined} [thumbnail]\n * @param {number} [pageId]\n * @return {PagePreviewModel}\n */\nexport function createModel(\n\ttitle,\n\turl,\n\tlanguageCode,\n\tlanguageDirection,\n\textract,\n\ttype,\n\tthumbnail,\n\tpageId\n) {\n\tconst processedExtract = processExtract( extract ),\n\t\tpreviewType = getPagePreviewType( type, processedExtract );\n\n\treturn {\n\t\ttitle,\n\t\turl,\n\t\tlanguageCode,\n\t\tlanguageDirection,\n\t\textract: processedExtract,\n\t\ttype: previewType,\n\t\tthumbnail,\n\t\tpageId\n\t};\n}\n\n/**\n * Creates an empty page preview model.\n *\n * @param {string} title\n * @param {string} url\n * @return {PagePreviewModel}\n */\nexport function createNullModel( title, url ) {\n\treturn createModel( title, url, '', '', [], '' );\n}\n\n/**\n * Determines the applicable popup type based on title and link element.\n *\n * @param {HTMLAnchorElement} el\n * @param {mw.Map} config\n * @param {mw.Title} title\n * @return {string|null} One of the previewTypes.TYPE_… constants\n */\nexport function getPreviewType( el, config, title ) {\n\tif ( !isSelfLink( title, config ) ) {\n\t\treturn previewTypes.TYPE_PAGE;\n\t}\n\n\t// The other selector can potentially pick up self-links with a class=\"reference\"\n\t// parent, but no fragment\n\tif ( title.getFragment() &&\n\t\tconfig.get( 'wgPopupsReferencePreviews' ) &&\n\t\t// eslint-disable-next-line no-jquery/no-class-state\n\t\t$( el ).parent().hasClass( 'reference' )\n\t) {\n\t\treturn previewTypes.TYPE_REFERENCE;\n\t}\n\n\treturn null;\n}\n\n/**\n * @param {mw.Title} title\n * @param {mw.Map} config\n * @return {boolean} True when the link points to the current page.\n */\nfunction isSelfLink( title, config ) {\n\treturn title.getNamespaceId() === config.get( 'wgNamespaceNumber' ) &&\n\t\ttitle.getMainText() === config.get( 'wgTitle' );\n}\n\n/**\n * Processes the extract returned by the TextExtracts MediaWiki API query\n * module.\n *\n * If the extract is `undefined`, `null`, or empty, then `undefined` is\n * returned.\n *\n * @param {Array|undefined|null} extract\n * @return {Array|undefined} Array when extract is an not empty array, undefined\n * otherwise\n */\nfunction processExtract( extract ) {\n\tif ( extract === undefined || extract === null || extract.length === 0 ) {\n\t\treturn undefined;\n\t}\n\treturn extract;\n}\n\n/**\n * Determines the page preview type based on whether or not:\n * a. Is the preview empty.\n * b. The preview type matches one of previewTypes.\n * c. Assume standard page preview if both above are false\n *\n * @param {string} type\n * @param {Array|undefined} [processedExtract]\n * @return {string} One of the previewTypes.TYPE_… constants.\n */\n\nfunction getPagePreviewType( type, processedExtract ) {\n\tif ( processedExtract === undefined ) {\n\t\treturn previewTypes.TYPE_GENERIC;\n\t}\n\n\tswitch ( type ) {\n\t\tcase previewTypes.TYPE_GENERIC:\n\t\tcase previewTypes.TYPE_DISAMBIGUATION:\n\t\tcase previewTypes.TYPE_PAGE:\n\t\t\treturn type;\n\t\tdefault:\n\t\t\t/**\n\t\t\t * Assume type=\"page\" if extract exists & not one of previewTypes.\n\t\t\t * Note:\n\t\t\t * - Restbase response includes \"type\" prop but other gateways don't.\n\t\t\t * - event-logging Schema:Popups requires type=\"page\" but restbase\n\t\t\t * provides type=\"standard\". Model must conform to event-logging schema.\n\t\t\t */\n\t\t\treturn previewTypes.TYPE_PAGE;\n\t}\n}\n","/**\n * Improves the plain text extracts\n *\n * @param {string} plainTextExtract\n * @param {string} title\n * @return {Array}\n */\nexport function formatPlainTextExtract( plainTextExtract, title ) {\n\tlet extract = plainTextExtract;\n\tif ( plainTextExtract === undefined ) {\n\t\treturn [];\n\t}\n\n\t// After cleaning the extract it may have been blanked\n\tif ( extract.length === 0 ) {\n\t\treturn [];\n\t}\n\n\textract = makeTitleInExtractBold( extract, title );\n\treturn extract;\n}\n\n/**\n * Converts the extract into a list of elements, which correspond to fragments\n * of the extract. Fragments that match the title verbatim are wrapped in a\n * `` element.\n *\n * Using the bolded elements of the extract of the page directly is covered by\n * [T141651](https://phabricator.wikimedia.org/T141651).\n *\n * Extracted from `mw.popups.renderer.article.getProcessedElements`.\n *\n * @param {string} extract\n * @param {string} title\n * @return {Array} A set of HTML Elements\n */\nfunction makeTitleInExtractBold( extract, title ) {\n\tconst elements = [],\n\t\tboldIdentifier = ``,\n\t\tsnip = ``;\n\n\ttitle = title.replace( /\\s+/g, ' ' ).trim(); // Remove extra white spaces\n\tconst escapedTitle = mw.util.escapeRegExp( title );\n\tconst regExp = new RegExp( `(^|\\\\s)(${escapedTitle})(|$)`, 'i' );\n\n\t// Remove text in parentheses along with the parentheses\n\textract = extract.replace( /\\s+/, ' ' ); // Remove extra white spaces\n\n\t// Make title bold in the extract text\n\t// As the extract is html escaped there can be no such string in it\n\t// Also, the title is escaped of RegExp elements thus can't have \"*\"\n\textract = extract.replace(\n\t\tregExp,\n\t\t`$1${snip}${boldIdentifier}$2${snip}$3`\n\t);\n\textract = extract.split( snip );\n\n\textract.forEach( ( part ) => {\n\t\tif ( part.indexOf( boldIdentifier ) === 0 ) {\n\t\t\telements.push( $( '' )\n\t\t\t\t.text( part.substring( boldIdentifier.length ) ) );\n\t\t} else {\n\t\t\telements.push( document.createTextNode( part ) );\n\t\t}\n\t} );\n\n\treturn elements;\n}\n","/**\n * @module gateway/mediawiki\n */\n\nimport { createModel } from '../preview/model';\nimport * as formatter from '../formatter';\n\n// Public and private cache lifetime (5 minutes)\n//\n// FIXME: Move this to src/constants.js.\nconst CACHE_LIFETIME = 300;\n\n/**\n * @typedef {Gateway} MediaWikiGateway\n * @property {function(Object): Object} extractPageFromResponse\n * @property {function(Object): Object} formatPlainTextExtract\n */\n\n/**\n * Creates an instance of the MediaWiki API gateway.\n *\n * @param {mw.Api} api\n * @param {Object} config Configuration that affects the major behavior of the\n * gateway.\n * @param {number} config.THUMBNAIL_SIZE The length of the major dimension of\n * the thumbnail.\n * @param {number} config.EXTRACT_LENGTH The maximum length, in characters,\n * of the extract.\n * @param {string} config.acceptLanguage The accepted language sent in the\n * header\n * @return {MediaWikiGateway}\n */\nexport default function createMediaWikiApiGateway( api, config ) {\n\tfunction fetch( title ) {\n\t\treturn api.get( {\n\t\t\taction: 'query',\n\t\t\tprop: 'info|extracts|pageimages|revisions|info',\n\t\t\tformatversion: 2,\n\t\t\tredirects: true,\n\t\t\texintro: mw.config.get( 'wgPopupsTextExtractsIntroOnly', true ),\n\t\t\texchars: config.EXTRACT_LENGTH,\n\n\t\t\t// There is an added geometric limit on .mwe-popups-extract\n\t\t\t// so that text does not overflow from the card.\n\t\t\texplaintext: true,\n\t\t\texsectionformat: 'plain',\n\n\t\t\tpiprop: 'thumbnail',\n\t\t\tpithumbsize: config.THUMBNAIL_SIZE,\n\t\t\tpilicense: 'any',\n\t\t\trvprop: 'timestamp',\n\t\t\tinprop: 'url',\n\t\t\ttitles: title,\n\t\t\tsmaxage: CACHE_LIFETIME,\n\t\t\tmaxage: CACHE_LIFETIME,\n\t\t\tuselang: 'content'\n\t\t}, {\n\t\t\theaders: {\n\t\t\t\t'X-Analytics': 'preview=1',\n\t\t\t\t'Accept-Language': config.acceptLanguage\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * @param {mw.Title} title\n\t * @return {AbortPromise}\n\t */\n\tfunction fetchPreviewForTitle( title ) {\n\t\tconst xhr = fetch( title.getPrefixedDb() );\n\t\treturn xhr.then( ( data ) => {\n\t\t\tconst page = extractPageFromResponse( data );\n\t\t\tconst plainTextExtract = formatPlainTextExtract( page );\n\t\t\treturn convertPageToModel( plainTextExtract );\n\t\t} ).promise( {\n\t\t\tabort() {\n\t\t\t\txhr.abort();\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn {\n\t\tfetch,\n\t\textractPageFromResponse,\n\t\tconvertPageToModel,\n\t\tfetchPreviewForTitle,\n\t\tformatPlainTextExtract\n\t};\n}\n\n/**\n * Extracts page data from the API response.\n *\n * @method\n * @name MediaWikiGateway#extractPageFromResponse\n * @param {Object} data The response\n * @throws {Error} If the response is empty or doesn't contain data about the\n * page\n * @return {Object}\n */\nfunction extractPageFromResponse( data ) {\n\tif (\n\t\tdata.query &&\n\t\tdata.query.pages &&\n\t\tdata.query.pages.length\n\t) {\n\t\treturn data.query.pages[ 0 ];\n\t}\n\n\tthrow new Error( 'API response `query.pages` is empty.' );\n}\n\n/**\n * Make plain text nicer by applying formatter.\n *\n * @method\n * @name MediaWikiGateway#formatPlainTextExtract\n * @param {Object} data The response\n * @return {Object}\n */\nfunction formatPlainTextExtract( data ) {\n\tconst result = $.extend( {}, data );\n\tresult.extract = formatter.formatPlainTextExtract( data.extract, data.title );\n\treturn result;\n}\n\n/**\n * Converts the API response to a preview model.\n *\n * @method\n * @name MediaWikiGateway#convertPageToModel\n * @param {Object} page\n * @return {PagePreviewModel}\n */\nfunction convertPageToModel( page ) {\n\treturn createModel(\n\t\tpage.title,\n\t\tpage.canonicalurl,\n\t\tpage.pagelanguagehtmlcode,\n\t\tpage.pagelanguagedir,\n\t\tpage.extract,\n\t\tpage.type,\n\t\tpage.thumbnail,\n\t\tpage.pageid\n\t);\n}\n","/**\n * @module gateway/rest\n */\n\nimport { createModel } from '../preview/model';\n\nconst RESTBASE_PROFILE = 'https://www.mediawiki.org/wiki/Specs/Summary/1.2.0';\n\n/** @typedef {function(JQuery.AjaxSettings=): JQuery.jqXHR} Ajax */\n\n/**\n * Creates an instance of the RESTBase gateway.\n *\n * This gateway differs from the {@link MediaWikiGateway MediaWiki gateway} in\n * that it fetches page data from [the RESTBase page summary endpoint][0].\n *\n * [0]: https://en.wikipedia.org/api/rest_v1/#!/Page_content/get_page_summary_title\n *\n * @param {Ajax} ajax A function with the same signature as `jQuery.ajax`\n * @param {Object} config Configuration that affects the major behavior of the\n * gateway.\n * @param {Function} extractParser A function that takes response and returns\n * parsed extract\n * @return {Gateway}\n */\nexport default function createRESTBaseGateway( ajax, config, extractParser ) {\n\t/**\n\t * Fetches page data from [the RESTBase page summary endpoint][0].\n\t *\n\t * [0]: https://en.wikipedia.org/api/rest_v1/#!/Page_content/get_page_summary_title\n\t *\n\t * @method\n\t * @name RESTBaseGateway#fetch\n\t * @param {string} title\n\t * @return {JQuery.jqXHR}\n\t */\n\tfunction fetch( title ) {\n\t\tconst endpoint = config.endpoint;\n\n\t\treturn ajax( {\n\t\t\turl: endpoint + encodeURIComponent( title ),\n\t\t\theaders: {\n\t\t\t\tAccept: `application/json; charset=utf-8; profile=\"${RESTBASE_PROFILE}\"`,\n\t\t\t\t'Accept-Language': config.acceptLanguage\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * @param {mw.Title} title\n\t * @return {AbortPromise}\n\t */\n\tfunction fetchPreviewForTitle( title ) {\n\t\tconst titleText = title.getPrefixedDb(),\n\t\t\txhr = fetch( titleText );\n\t\treturn xhr.then( ( page ) => {\n\t\t\t// Endpoint response may be empty or simply missing a title.\n\t\t\tpage = page || {};\n\t\t\tpage.title = page.title || titleText;\n\t\t\t// And extract may be omitted if empty string\n\t\t\tpage.extract = page.extract || '';\n\t\t\treturn convertPageToModel(\n\t\t\t\tpage, config.THUMBNAIL_SIZE, extractParser\n\t\t\t);\n\t\t} ).catch( ( jqXHR, textStatus, errorThrown ) => {\n\t\t\t// The client will choose how to handle these errors which may include\n\t\t\t// those due to HTTP 4xx and 5xx status. The rejection typing matches\n\t\t\t// fetch failures.\n\t\t\treturn $.Deferred().reject( 'http', {\n\t\t\t\txhr: jqXHR,\n\t\t\t\ttextStatus,\n\t\t\t\texception: errorThrown\n\t\t\t} );\n\t\t} ).promise( { abort() { xhr.abort(); } } );\n\t}\n\n\treturn {\n\t\tfetch,\n\t\tconvertPageToModel,\n\t\tfetchPreviewForTitle\n\t};\n}\n\n/**\n * Checks whether the `originalImage` property contains an image\n * format that's safe to render.\n * https://www.mediawiki.org/wiki/Help:Images#Supported_media_types_for_images\n *\n * @param {string} filename\n *\n * @return {boolean}\n */\nfunction isSafeImgFormat( filename ) {\n\tconst safeImage = new RegExp( /\\.(jpg|jpeg|png|gif)$/i );\n\treturn safeImage.test( filename );\n}\n\n/**\n * Resizes the thumbnail to the requested width, preserving its aspect ratio.\n *\n * The requested width is limited to that of the original image unless the image\n * is an SVG, which can be scaled infinitely.\n *\n * This function is only intended to mangle the pretty thumbnail URLs used on\n * Wikimedia Commons. Once [an official thumb API](https://phabricator.wikimedia.org/T66214)\n * is fully specified and implemented, this function can be made more general.\n *\n * @param {Object} thumbnail The thumbnail image\n * @param {Object} original The original image\n * @param {number} thumbSize The requested size\n * @return {{source: string, width: number, height: number}|undefined}\n */\nfunction generateThumbnailData( thumbnail, original, thumbSize ) {\n\tconst parts = thumbnail.source.split( '/' ),\n\t\tlastPart = parts[ parts.length - 1 ],\n\t\toriginalIsSafe = isSafeImgFormat( original.source ) || undefined;\n\n\t// The last part, the thumbnail's full filename, is in the following form:\n\t// ${width}px-${filename}.${extension}. Splitting the thumbnail's filename\n\t// makes this function resilient to the thumbnail not having the same\n\t// extension as the original image, which is definitely the case for SVG's\n\t// where the thumbnail's extension is .svg.png.\n\tconst filenamePxIndex = lastPart.indexOf( 'px-' );\n\tif ( filenamePxIndex === -1 ) {\n\t\t// The thumbnail size is not customizable. Presumably, RESTBase requested a\n\t\t// width greater than the original and so MediaWiki returned the original's\n\t\t// URL instead of a thumbnail compatible URL. An original URL does not have\n\t\t// a \"thumb\" path, e.g.:\n\t\t//\n\t\t// https://upload.wikimedia.org/wikipedia/commons/a/aa/Red_Giant_Earth_warm.jpg\n\t\t//\n\t\t// Instead of:\n\t\t//\n\t\t// https://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Red_Giant_Earth_warm.jpg/512px-Red_Giant_Earth_warm.jpg\n\t\t//\n\t\t// Use the original if it's a supported image format.\n\t\treturn originalIsSafe && original;\n\t}\n\tconst filename = lastPart.substr( filenamePxIndex + 3 );\n\n\t// Scale the thumbnail's largest dimension.\n\tlet width, height;\n\tif ( thumbnail.width > thumbnail.height ) {\n\t\twidth = thumbSize;\n\t\theight = Math.floor( ( thumbSize / thumbnail.width ) * thumbnail.height );\n\t} else {\n\t\twidth = Math.floor( ( thumbSize / thumbnail.height ) * thumbnail.width );\n\t\theight = thumbSize;\n\t}\n\n\t// If the image isn't an SVG, then it shouldn't be scaled past its original\n\t// dimensions.\n\tif ( width >= original.width && filename.indexOf( '.svg' ) === -1 ) {\n\t\t// if the image format is not supported, it shouldn't be rendered.\n\t\treturn originalIsSafe && original;\n\t}\n\n\tparts[ parts.length - 1 ] = `${width}px-${filename}`;\n\n\treturn {\n\t\tsource: parts.join( '/' ),\n\t\twidth,\n\t\theight\n\t};\n}\n\n/**\n * Converts the API response to a preview model.\n *\n * @method\n * @name RESTBaseGateway#convertPageToModel\n * @param {Object} page\n * @param {number} thumbSize\n * @param {Function} extractParser\n * @return {PagePreviewModel}\n */\nexport function convertPageToModel( page, thumbSize, extractParser ) {\n\treturn createModel(\n\t\tpage.title,\n\t\tnew mw.Title( page.title ).getUrl(),\n\t\tpage.lang,\n\t\tpage.dir,\n\t\textractParser( page ),\n\t\tpage.type,\n\t\tpage.thumbnail ?\n\t\t\tgenerateThumbnailData(\n\t\t\t\tpage.thumbnail, page.originalimage, thumbSize\n\t\t\t) : undefined,\n\t\tpage.pageid\n\t);\n}\n","import * as formatter from '../formatter';\n\n/**\n * Prepare extract\n *\n * @param {Object} page Rest response\n * @return {Array} An array of DOM Elements\n */\nexport function parseHTMLResponse( page ) {\n\tconst extract = page.extract_html;\n\n\treturn extract.length === 0 ? [] : $.parseHTML( extract );\n}\n\n/**\n * Prepare extract\n *\n * @param {Object} page Rest response\n * @return {Array} An array of DOM Elements\n */\nexport function parsePlainTextResponse( page ) {\n\treturn formatter.formatPlainTextExtract( page.extract, page.title );\n}\n","/**\n * @module gateway/page\n */\n\nimport constants from '../constants';\nimport createMediaWikiApiGateway from './mediawiki';\nimport createRESTBaseGateway from './rest';\nimport * as formatters from './restFormatters';\n\n/**\n * Creates a page preview gateway with sensible values for the dependencies.\n *\n * @param {mw.Map} config\n * @return {Gateway}\n */\nexport default function createPagePreviewGateway( config ) {\n\tconst gatewayConfig = $.extend( {}, constants, {\n\t\tacceptLanguage: config.get( 'wgPageContentLanguage' )\n\t} );\n\tconst restConfig = $.extend( {}, gatewayConfig, {\n\t\tendpoint: config.get( 'wgPopupsRestGatewayEndpoint' )\n\t} );\n\tswitch ( config.get( 'wgPopupsGateway' ) ) {\n\t\tcase 'mwApiPlain':\n\t\t\treturn createMediaWikiApiGateway( new mw.Api(), gatewayConfig );\n\t\tcase 'restbasePlain':\n\t\t\treturn createRESTBaseGateway(\n\t\t\t\t$.ajax, restConfig, formatters.parsePlainTextResponse );\n\t\tcase 'restbaseHTML':\n\t\t\treturn createRESTBaseGateway(\n\t\t\t\t$.ajax, restConfig, formatters.parseHTMLResponse );\n\t\tdefault:\n\t\t\tthrow new Error( 'Unknown gateway' );\n\t}\n}\n","/**\n * @module gateway/reference\n */\n\nimport { previewTypes } from '../preview/model';\n\n/**\n * @return {Gateway}\n */\nexport default function createReferenceGateway() {\n\n\tfunction scrapeReferenceText( id ) {\n\t\tconst idSelector = `#${$.escapeSelector( id )}`;\n\n\t\t/**\n\t\t * Same alternative selectors with and without mw-… as in the RESTbased endpoint.\n\t\t *\n\t\t * @see https://phabricator.wikimedia.org/diffusion/GMOA/browse/master/lib/transformations/references/structureReferenceListContent.js$138\n\t\t */\n\t\treturn $( `${idSelector} .mw-reference-text, ${idSelector} .reference-text` );\n\t}\n\n\t/**\n\t * Attempts to find a single reference type identifier, limited to a list of known types.\n\t * - When a `class=\"…\"` attribute mentions multiple known types, the last one is used, following\n\t * CSS semantics.\n\t * - When there are multiple tags, the first with a known type is used.\n\t *\n\t * @param {JQuery} $referenceText\n\t * @return {string|null}\n\t */\n\tfunction scrapeReferenceType( $referenceText ) {\n\t\tconst KNOWN_TYPES = [ 'book', 'journal', 'news', 'note', 'web' ];\n\t\tlet type = null;\n\t\t$referenceText.find( 'cite[class]' ).each( ( index, element ) => {\n\t\t\tconst classNames = element.className.split( /\\s+/ );\n\t\t\tfor ( let i = classNames.length; i--; ) {\n\t\t\t\tif ( KNOWN_TYPES.indexOf( classNames[ i ] ) !== -1 ) {\n\t\t\t\t\ttype = classNames[ i ];\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t\treturn type;\n\t}\n\n\t/**\n\t * @param {mw.Title} title\n\t * @param {HTMLAnchorElement} el\n\t * @return {AbortPromise}\n\t */\n\tfunction fetchPreviewForTitle( title, el ) {\n\t\t// Need to encode the fragment again as mw.Title returns it as decoded text\n\t\tconst id = title.getFragment().replace( / /g, '_' ),\n\t\t\t$referenceText = scrapeReferenceText( id );\n\n\t\tif ( !$referenceText.length ||\n\t\t\t// Skip references that don't contain anything but whitespace, e.g. a single  \n\t\t\t( !$referenceText.text().trim() && !$referenceText.children().length )\n\t\t) {\n\t\t\treturn $.Deferred().reject(\n\t\t\t\t'Footnote not found or empty',\n\t\t\t\t// Required to set `showNullPreview` to false and not open an error popup\n\t\t\t\t{ textStatus: 'abort', xhr: { readyState: 0 } }\n\t\t\t).promise( { abort() {} } );\n\t\t}\n\n\t\tconst model = {\n\t\t\turl: `#${id}`,\n\t\t\textract: $referenceText.html(),\n\t\t\ttype: previewTypes.TYPE_REFERENCE,\n\t\t\treferenceType: scrapeReferenceType( $referenceText ),\n\t\t\tsourceElementId: el && el.parentNode && el.parentNode.id\n\t\t};\n\n\t\treturn $.Deferred().resolve( model ).promise( { abort() {} } );\n\t}\n\n\treturn {\n\t\tfetchPreviewForTitle\n\t};\n}\n","/**\n * @module templateUtil\n */\n\n/**\n * @param {string} str\n * @return {string} The string with any HTML entities escaped.\n */\nexport function escapeHTML( str ) {\n\treturn mw.html.escape( str );\n}\n\nconst templates = {};\n/**\n * @param {string} html markup of the template\n * @return {Element} a cloned root element of the template\n */\nexport function createNodeFromTemplate( html ) {\n\tif ( !templates[ html ] ) {\n\t\t// TODO: use