User:Eejit43/scripts/pageswap.js

// // Note: This script was compiled and minified from TypeScript. For a more readable version, see https://github.com/Eejit43/wikipedia-scripts/blob/main/scripts/pageswap.ts

"use strict";mw.loader.using(["mediawiki.util","oojs-ui-core","oojs-ui-widgets","oojs-ui-windows","mediawiki.widgets"],async=>{const r=mw.config.get("wgNamespaceNumber");if(r<0||r>=120||r>=6&&r<=9||r>=14&&r<=99)return;const o=mw.config.get("wgPageName"),s=await fetchUserPermissions;if((await new mw.Api.get({action:"query",prop:"info",titles:o})).query.pages[-1])return;mw.util.addPortletLink(mw.config.get("skin")==="minerva"?"p-tb":"p-cactions","#","Swap","eejit-pageswap").addEventListener("click",e=>{if(e.preventDefault,!s.canSwap)return mw.notify("You do not have sufficient permissions to swap pages.",{type:"error"});function a{a.super.apply(this,arguments)}OO.inheritClass(a,OO.ui.ProcessDialog),a.static.name="swap",a.static.title=$(" ").append($("").attr({href:mw.util.getUrl("WP:ROUNDROBIN"),target:"_blank"}).text("Swap")," two pages"),a.static.actions=[{action:"swap",label:"Swap",flags:["primary","progressive"],disabled:!0},{action:"cancel",label:"Cancel",flags:["safe","close"]}],a.prototype.initialize=function{a.super.prototype.initialize.call(this),this.panel=new OO.ui.PanelLayout({padded:!0,expanded:!1}),this.content=new OO.ui.FieldsetLayout,this.destinationInput=new mw.widgets.TitleInputWidget({required:!0,$overlay:this.$overlay,excludeCurrentPage:!0,showDescriptions:!0,showRedirectTargets:!1,excludeDynamicNamespaces:!0,showMissing:!1,validate:i=>!(i===""||i===mw.config.get("wgPageName"))}),this.destinationInput.on("change",=>{let i=this.destinationInput.getValue.replaceAll("_"," ").replace(/^\s+/,"");i=i.replace(new RegExp(`^(https?:)?/{2}?${mw.config.get("wgServer").replace(/^\/{2}/,"")}/wiki/`),""),i=i.split("#")[0],i=i.charAt(0).toUpperCase+i.slice(1),this.destinationInput.setValue(i)}),this.destinationInput.connect(this,{change:"updateActionState"}),this.destinationInputField=new OO.ui.FieldLayout(this.destinationInput,{label:"Destination page",align:"top"}),this.summaryInput=new OO.ui.ComboBoxInputWidget({required:!0,$overlay:this.$overlay,options:[{data:"Performing requested technical move"},{data:"Result of requested move"},{data:"Move to common name"},{data:"Fixing typo"},{data:"Fixing capitalization"},{data:"Fixing per naming conventions"}]}),this.summaryInput.connect(this,{change:"updateActionState"}),this.summaryInputField=new OO.ui.FieldLayout(this.summaryInput,{label:"Summary",align:"top"}),this.moveTalkCheckbox=new OO.ui.CheckboxInputWidget({selected:!0}),this.moveTalkCheckboxField=new OO.ui.FieldLayout(this.moveTalkCheckbox,{label:"Move talk page (if applicable)",align:"inline"}),this.moveSubpagesCheckbox=new OO.ui.CheckboxInputWidget({selected:!0}),this.moveSubpagesCheckboxField=new OO.ui.FieldLayout(this.moveSubpagesCheckbox,{label:"Move subpages (if applicable)",align:"inline"}),this.content.addItems([this.destinationInputField,this.summaryInputField,this.moveTalkCheckboxField,this.moveSubpagesCheckboxField]),this.panel.$element.append(this.content.$element),this.$body.append(this.panel.$element)},a.prototype.updateActionState=function{const i=this.destinationInput.getValue!==""&&this.destinationInput.getValidity&&this.summaryInput.getValue!=="";this.actions.setAbilities({swap:i})},a.prototype.getActionProcess=function(i){if(i==="swap"){const u=this.destinationInput.getValue.trim,p=this.summaryInput.getValue,g=this.moveTalkCheckbox.isSelected,m=this.moveSubpagesCheckbox.isSelected;return new OO.ui.Process.next(=>roundRobin(s,o,u,p,g,m).catch(d=>(console.error(d),$.Deferred.reject(this.showErrors([new OO.ui.Error(d?.message||"An unknown error occurred.")]))))).next(=>{mw.notify("Moves complete! Reloading...",{type:"success"}),this.close({action:i,success:!0}),setTimeout(=>window.location.reload,1e3)})}else if(i==="cancel")return new OO.ui.Process(=>{this.close({action:i})});return a.super.prototype.getActionProcess.call(this,i)};const l=new a,t=new OO.ui.WindowManager;$("body").append(t.$element),t.addWindows([l]),t.openWindow(l)})});function fetchUserPermissions{return new mw.Api.get({action:"query",meta:"userinfo",uiprop:"rights"}).then(r=>{const o=r.query.userinfo.rights;return{canSwap:o.includes("suppressredirect")&&o.includes("move-subpages"),allowSwapTemplates:o.includes("templateeditor")}})}function getTalkPageName(r,o,s){const n={},c=r[s.toString]["*"].length===0?0:r[s.toString]["*"].length+1;return n.titleWithoutPrefix=o.substring(c,o.length),n.talkTitle=`${r[(s+1).toString]["*"]}:${n.titleWithoutPrefix}`,n}function swapValidate(r,o,s,n,c){const e={valid:!0,allowMoveSubpages:!0,checkTalk:!0};let a=0;for(const[l,t]of Object.entries(s)){if(a++,l==="-1"||t.ns<0)return e.valid=!1,e.error=`Page ${t.title} does not exist.`,e;if(t.ns>=6&&t.ns<=9||t.ns>=10&&t.ns<=11&&!c.allowSwapTemplates||t.ns>=14&&t.ns<=117||t.ns>=120)return e.valid=!1,e.error=`Namespace of ${t.title} (${t.ns}) not supported.

Likely reasons: - Names of pages in this namespace relies on other pages - Namespace features heavily-transcluded pages - Namespace involves subpages: swaps produce many redlinks

If the move is legitimate, consider a careful manual swap.`,e;r===t.title&&(e.currentTitle=t.title,e.currentNamespace=t.ns,e.currentTalkId=t.talkid,e.currentCanMove=t.actions.move==="",e.currentIsRedirect=t.redirect===""),o===t.title&&(e.destinationTitle=t.title,e.destinationNamespace=t.ns,e.destinationTalkId=t.talkid,e.destinationCanMove=t.actions.move==="",e.destinationIsRedirect=t.redirect==="")}if(!e.valid)return e;if(!e.currentCanMove)return e.valid=!1,e.error=`${e.currentTitle} is immovable`,e;if(!e.destinationCanMove)return e.valid=!1,e.error=`${e.destinationTitle} is immovable`,e;if(e.currentNamespace%2!==e.destinationNamespace%2)return e.valid=!1,e.error="Namespaces don't match: one is a talk page, the other is not",e;if(a!==2)return e.valid=!1,e.error="Destination title is the same as the current title",e;if(e.currentNamespaceAllowSubpages=n[e.currentNamespace.toString].subpages!=="",e.destinationNamespaceAllowSubpages=n[e.destinationNamespace.toString].subpages!=="",e.currentTitle.startsWith(e.destinationTitle+"/")||e.destinationTitle.startsWith(e.currentTitle+"/")){if(e.currentNamespace!==e.destinationNamespace)return e.valid=!1,e.error=`${e.currentTitle} in ns ${e.currentNamespace} ${e.destinationTitle} in ns ${e.destinationNamespace}. Disallowing.`,e;e.allowMoveSubpages=e.currentNamespaceAllowSubpages,e.allowMoveSubpages||(e.addLineInfo="One page is a subpage. Disallowing move-subpages")}if(e.currentNamespace%2===1)e.checkTalk=!1;else{const l=getTalkPageName(n,e.currentTitle,e.currentNamespace);e.currentTitleWithoutPrefix=l.titleWithoutPrefix,e.currentTalkName=l.talkTitle;const t=getTalkPageName(n,e.destinationTitle,e.destinationNamespace);e.destinationTitleWithoutPrefix=t.titleWithoutPrefix,e.destinationTalkName=t.talkTitle}return e}async function talkValidate(r,o,s){const n={};if(n.allowMoveTalk=!0,!r)return n;if(o===void 0||s===void 0)return mw.notify("Unable to validate talk. Disallowing movetalk to be safe",{type:"error"}),n.allowMoveTalk=!1,n;n.currTDNE=!0,n.destTDNE=!0,n.currentTalkCanCreate=!0,n.destinationTalkCanCreate=!0;const c=[o,s];if(c.length>0){const e=(await new mw.Api.get({action:"query",prop:"info",intestactions:"move|create",titles:c.join("|")})).query.pages;for(const[,a]of Object.entries(e))if(a.title===o)n.currTDNE=a.invalid===""||a.missing==="",n.currentTalkTitle=a.title,n.currentTalkCanMove=a.actions.move==="",n.currentTalkCanCreate=a.actions.create==="",n.currentTalkIsRedirect=a.redirect==="";else if(a.title===s)n.destTDNE=a.invalid===""||a.missing==="",n.destinationTalkTitle=a.title,n.destinationTalkCanMove=a.actions.move==="",n.destinationTalkCanCreate=a.actions.create==="",n.destinationTalkIsRedirect=a.redirect==="";else return mw.notify("Found pageid not matching given ids.",{type:"error"}),{}}return n.allowMoveTalk=n.currentTalkCanCreate&&n.currentTalkCanMove&&n.destinationTalkCanCreate&&n.destinationTalkCanMove,n}async function getSubpages(r,o,s,n){if(!n&&r[s.toString].subpages!=="")return{data:[]};const c=getTalkPageName(r,o,s),e=(await new mw.Api.get({action:"query",list:"allpages",apnamespace:n?s+1:s,apfrom:c.titleWithoutPrefix+"/",apto:c.titleWithoutPrefix+"0",aplimit:101})).query.allpages,a=],[;for(const u in e)a[u<50?0:1].push(e[u].pageid);if(a[0].length===0)return{data:[]};if(a[1].length===51)return{error:"100+ subpages, too many to move."};const l=[],t=(await new mw.Api.get({action:"query",prop:"info",intestactions:"move|create",pageids:a[0].join("|")})).query.pages;for(const[,u]of Object.entries(t))l.push({title:u.title,isRedir:u.redirect==="",canMove:u.actions?.move===""});if(a[1].length===0)return{data:l};const i=(await new mw.Api.get({action:"query",prop:"info",intestactions:"move|create",pageids:a[1].join("|")})).query.pages;for(const[,u]of Object.entries(i))l.push({title:u.title,isRedirect:u.redirect==="",canMove:u.actions?.move===""});return{data:l}}function printSubpageInfo(r,o){const s={},n=[],c=[];let e=0;for(const[,a]of Object.entries(o.data))a.canMove||c.push(a.title),n.push((a.isRedirect?"(R) ":" ")+a.title),a.isRedirect&&e++;return n.length>0&&mw.notify(c.length>0?`Disabling move-subpages. The following ${c.length} (of ${n.length}) total subpages of ${r} CANNOT be moved:

${c.join(", ")}`:`${n.length} total subpages of ${r}.${e!==0?` ${e} redirects, labeled (R)`:""}: ${n.join(", ")}`),s.allowMoveSubpages=c.length===0,s.noNeed=n.length===0,s}function swapPages(r,o,s,n,c){const e=`Draft:Move/${r}`,a=[{action:"move",from:o,to:e,reason:"Round-robin page move step 1 (with pageswap 2)",watchlist:"unwatch",noredirect:1},{action:"move",from:r,to:o,reason:s,watchlist:"unwatch",noredirect:1},{action:"move",from:e,to:r,reason:"Round-robin page move step 3 (with pageswap 2)",watchlist:"unwatch",noredirect:1}];for(const l of a)n&&(l.movetalk=1),c&&(l.movesubpages=1);return new Promise((l,t)=>{const i={success:!0};let u=0;function p{if(u>=a.length)return l(i);new mw.Api.postWithToken("csrf",a[u]).done(=>{u++,p}).fail(=>{i.success=!1,i.message=`Failed on move ${u+1} (${a[u].from} \u2192 ${a[u].to})`,t(i)})}return p,i})}async function roundRobin(r,o,s,n,c,e){const a=(await new mw.Api.get({action:"query",meta:"siteinfo",siprop:"namespaces"})).query.namespaces,l=(await new mw.Api.get({action:"query",prop:"info",inprop:"talkid",intestactions:"move|create",titles:`${o}|${s}`})).query;for(const w in l.normalized)o===l.normalized[w].from&&(o=l.normalized[w].to),s===l.normalized[w].from&&(s=l.normalized[w].to);const t=swapValidate(o,s,l.pages,a,r);if(!t.valid)throw new Error(t.error);t.addLineInfo!==void 0&&mw.notify(t.addLineInfo);const i=await getSubpages(a,t.currentTitle,t.currentNamespace,!1);if(i.error!==void 0)throw new Error(i.error);const u=printSubpageInfo(t.currentTitle,i),p=await getSubpages(a,t.destinationTitle,t.destinationNamespace,!1);if(p.error!==void 0)throw new Error(p.error);const g=printSubpageInfo(t.destinationTitle,p),m=await talkValidate(t.checkTalk,t.currentTalkName,t.destinationTalkName),d=await getSubpages(a,t.currentTitle,t.currentNamespace,!0);if(d.error!==void 0)throw new Error(d.error);const b=printSubpageInfo(t.currentTalkName,d),h=await getSubpages(a,t.destinationTitle,t.destinationNamespace,!0);if(h.error!==void 0)throw new Error(h.error);const k=printSubpageInfo(t.destinationTalkName,h),y=u.noNeed&&g.noNeed&&b.noNeed&&k.noNeed,T=t.currentNamespaceAllowSubpages&&!g.noNeed||t.destinationNamespaceAllowSubpages&&!u.noNeed;c&&t.checkTalk&&!m.allowMoveTalk&&(c=!1,mw.notify(`Disallowing moving talk. ${m.currentTalkCanCreate?m.destinationTalkCanCreate?"Talk page is immovable":`${t.destinationTalkName} is create-protected`:`${t.currentTalkName} is create-protected`}`));let f=!1;!T&&!y&&t.allowMoveSubpages&&u.allowMoveSubpages&&g.allowMoveSubpages&&b.allowMoveSubpages&&k.allowMoveSubpages?f=e:T&&(f=!1,mw.notify("One namespace does not have subpages enabled. Disallowing move subpages.")),console.log(`[Pageswap] Swapping "${o}" with "${s}" with summary "${n}" and moveTalk ${c} and moveSubpages ${f}`);const v=await swapPages(o,s,n,c,f);if(console.log(v),!v.success)throw new Error(v.error)}

// //# sourceMappingURL=data:application/json;base64,ewog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Jlc3NpdmUnXSxcbiAgICAgICAgICAgICAgICBkaXNhYmxlZDogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgYWN0aW9uOiAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICBsYWJlbDogJ0NhbmNlbCcsXG4gICAgICAgICAgICAgICAgZmxhZ3M6IFsnc2FmZScsICdjbG9zZSddLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgXTtcblxuICAgICAgICBTd2FwRGlhbG9nLnByb3RvdHlwZS5pbml0aWFsaXplID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgU3dhcERpYWxvZy5zdXBlci5wcm90b3R5cGUuaW5pdGlhbGl6ZS5jYWxsKHRoaXMpO1xuXG4gICAgICAgICAgICB0aGlzLnBhbmVsID0gbmV3IE9PLnVpLlBhbmVsTGF5b3V0KHtcbiAgICAgICAgICAgICAgICBwYWRkZWQ6IHRydWUsXG4gICAgICAgICAgICAgICAgZXhwYW5kZWQ6IGZhbHNlLFxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHRoaXMuY29udGVudCA9IG5ldyBPTy51aS5GaWVsZHNldExheW91dCgpO1xuXG4gICAgICAgICAgICB0aGlzLmRlc3RpbmF0aW9uSW5wdXQgPSBuZXcgbXcud2lkZ2V0cy5UaXRsZUlucHV0V2lkZ2V0KHtcbiAgICAgICAgICAgICAgICByZXF1aXJlZDogdHJ1ZSxcbiAgICAgICAgICAgICAgICAkb3ZlcmxheTogdGhpcy4kb3ZlcmxheSxcbiAgICAgICAgICAgICAgICBleGNsdWRlQ3VycmVudFBhZ2U6IHRydWUsXG4gICAgICAgICAgICAgICAgc2hvd0Rlc2NyaXB0aW9uczogdHJ1ZSxcbiAgICAgICAgICAgICAgICBzaG93UmVkaXJlY3RUYXJnZXRzOiBmYWxzZSxcbiAgICAgICAgICAgICAgICBleGNsdWRlRHluYW1pY05hbWVzcGFjZXM6IHRydWUsIC8vIFwiU3BlY2lhbFwiIGFuZCBcIk1lZGlhXCJcbiAgICAgICAgICAgICAgICBzaG93TWlzc2luZzogZmFsc2UsXG4gICAgICAgICAgICAgICAgdmFsaWRhdGU6ICh2YWx1ZSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09ICcnIHx8IHZhbHVlID09PSBtdy5jb25maWcuZ2V0KCd3Z1BhZ2VOYW1lJykpIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdGhpcy5kZXN0aW5hdGlvbklucHV0Lm9uKCdjaGFuZ2UnLCAoKSA9PiB7XG4gICAgICAgICAgICAgICAgbGV0IHZhbHVlID0gdGhpcy5kZXN0aW5hdGlvbklucHV0LmdldFZhbHVlKCkucmVwbGFjZUFsbCgnXycsICcgJykucmVwbGFjZSgvXlxccysvLCAnJyk7XG4gICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZS5yZXBsYWNlKG5ldyBSZWdFeHAoYF4oaHR0cHM/Oik/L3syfT8ke213LmNvbmZpZy5nZXQoJ3dnU2VydmVyJykucmVwbGFjZSgvXlxcL3syfS8sICcnKX0vd2lraS9gKSwgJycpO1xuICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUuc3BsaXQoJyMnKVswXTtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlLmNoYXJBdCgwKS50b1VwcGVyQ2FzZSgpICsgdmFsdWUuc2xpY2UoMSk7XG4gICAgICAgICAgICAgICAgdGhpcy5kZXN0aW5hdGlvbklucHV0LnNldFZhbHVlKHZhbHVlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdGhpcy5kZXN0aW5hdGlvbklucHV0LmNvbm5lY3QodGhpcywgeyBjaGFuZ2U6ICd1cGRhdGVBY3Rpb25TdGF0ZScgfSk7XG5cbiAgICAg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AgICAgICAgICAgICAgICAgICAgICAgcm91bmRSb2Jpbih1c2VyUGVybWlzc2lvbnMsIGN1cnJlbnRUaXRsZSwgZGVzdGluYXRpb24sIHN1bW1hcnksIG1vdmVUYWxrLCBtb3ZlU3VicGFnZXMpLmNhdGNoKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLkRlZmVycmVkKCkucmVqZWN0KHRoaXMuc2hvd0Vycm9ycyhbbmV3IE9PLnVpLkVycm9yKGVycm9yPy5tZXNzYWdlIHx8ICdBbiB1bmtub3duIGVycm9yIG9jY3VycmVkLicpXSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgLm5leHQoKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgbXcubm90aWZ5KCdNb3ZlcyBjb21wbGV0ZSEgUmVsb2FkaW5nLi4uJywgeyB0eXBlOiAnc3VjY2VzcycgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNsb3NlKHsgYWN0aW9uLCBzdWNjZXNzOiB0cnVlIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB3aW5kb3cubG9jYXRpb24ucmVsb2FkKCksIDEwMDApO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uID09PSAnY2FuY2VsJylcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IE9PLnVpLlByb2Nlc3MoKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmNsb3NlKHsgYWN0aW9uIH0pO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gU3dhcERpYWxvZy5zdXBlci5wcm90b3R5cGU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xuICAgICAgICAgICAgcHJvcDogJ2luZm8nLFxuICAgICAgICAgICAgaW50ZXN0YWN0aW9uczogJ21vdmV8Y3JlYXRlJyxcbiAgICAgICAgICAgIHBhZ2VpZHM6IHN1YnBhZ2VJZHNbMF0uam9pbignfCcpLFxuICAgICAgICB9KVxuICAgICkucXVlcnkucGFnZXM7XG4gICAgZm9yIChjb25zdCBbLCBwYWdlRGF0YV0gb2YgT2JqZWN0LmVudHJpZXMoc3VicGFnZURhdGFPbmUpKVxuICAgICAgICByZXN1bHQucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogcGFnZURhdGEudGl0bGUsXG4gICAgICAgICAgICBpc1JlZGlyOiBwYWdlRGF0YS5yZWRpcmVjdCA9PT0gJycsXG4gICAgICAgICAgICBjYW5Nb3ZlOiBwYWdlRGF0YS5hY3Rpb25zPy5tb3ZlID09PSAnJyxcbiAgICAgICAgfSk7XG5cbiAgICBpZiAoc3VicGFnZUlkc1sxXS5sZW5ndGggPT09IDApIHJldHVybiB7IGRhdGE6IHJlc3VsdCB9O1xuXG4gICAgY29uc3Qgc3VicGFnZURhdGFUd28gPSAoXG4gICAgICAgIGF3YWl0IG5ldyBtdy5BcGkoKS5nZXQoe1xuICAgICAgICAgICAgYWN0aW9uOiAncXVlcnknLFxuICAgICAgICAgICAgcHJvcDogJ2luZm8nLFxuICAgICAgICAgICAgaW50ZXN0YWN0aW9uczogJ21vdmV8Y3JlYXRlJyxcbiAgICAgICAgICAgIHBhZ2VpZHM6IHN1YnBhZ2VJZHNbMV0uam9pbignfCcpLFxuICAgICAgICB9KVxuICAgICkucXVlcnkucGFnZXM7XG4gICAgZm9yIChjb25zdCBbLCBwYWdlRGF0YV0gb2YgT2JqZWN0LmVudHJpZXMoc3VicGFnZURhdGFUd28pKVxuICAgICAgICByZXN1bHQucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogcGFnZURhdGEudGl0bGUsXG4gICAgICAgICAgICBpc1JlZGlyZWN0OiBwYWdlRGF0YS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HtcbiAgICAgICAgaWYgKG1vdmVUYWxrKSBtb3ZlLm1vdmV0YWxrID0gMTtcbiAgICAgICAgaWYgKG1vdmVTdWJwYWdlcykgbW92ZS5tb3Zlc3VicGFnZXMgPSAxO1xuICAgIH1cblxuICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgIGNvbnN0IHJlc3VsdCA9IHsgc3VjY2VzczogdHJ1ZSB9O1xuICAgICAgICBsZXQgaSA9IDA7XG5cbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIGpzZG9jL3JlcXVpcmUtanNkb2NcbiAgICAgICAgZnVuY3Rpb24gZG9Nb3ZlKCkge1xuICAgICAgICAgICAgaWYgKGkgPj0gbW92ZXMubGVuZ3RoKSByZXR1cm4gcmVzb2x2ZShyZXN1bHQpO1xuXG4gICAgICAgICAgICBuZXcgbXcuQXBpKClcbiAgICAgICAgICAgICAgICAucG9zdFdpdGhUb2tlbignY3NyZicsIG1vdmVzW2ldKVxuICAgICAgICAgICAgICAgIC5kb25lKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaSsrO1xuICAgICAgICAgICAgICAgICAgICBkb01vdmUoKTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5mYWlsKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnN1Y2Nlc3MgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0Lm1lc3NhZ2UgPSBgRmFpbGVkIG9uIG1vdmUgJHtpICsgMX0gKCR7bW92ZXNbaV0uZnJvbX0gXHUyMTkyICR7bW92ZXNbaV0udG99KWA7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdChyZXN1bHQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgZG9Nb3ZlKCk7XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtc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