User:Eejit43/scripts/script-updater.js
Appearance
< User:Eejit43 | scripts
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
Documentation for this user script can be added at User:Eejit43/scripts/script-updater. |
// <nowiki>
// Note: This script was compiled and minified from TypeScript. For a more readable version, see https://github.com/Eejit43/wikipedia-scripts/blob/main/scripts/script-updater.ts
"use strict";(()=>{mw.loader.using(["mediawiki.util","oojs-ui-core","oojs-ui-widgets","oojs-ui-windows"],()=>{if(mw.config.get("wgUserName")!=="Eejit43"||mw.config.get("wgPageName")!=="User:Eejit43")return;let m=document.querySelector(".mw-editsection").cloneNode(!0),r=document.createElement("a");r.href="#",r.style.fontWeight="bold",r.textContent="Sync from GitHub",r.addEventListener("click",h=>{h.preventDefault();let e=new OO.ui.WindowManager;document.body.append(e.$element[0]);let t=new a;e.addWindows([t]),t.open()}),m.querySelector("a").replaceWith(r),document.querySelector("h2#My_user_scripts + .mw-editsection").after(m);class a extends OO.ui.ProcessDialog{repoOwner="Eejit43";repoName="wikipedia-scripts";content;checkboxElements=[];actionsMultiselect;latestCommitHash;scripts;constructor(){super({size:"medium"}),a.static.name="ScriptUpdaterDialog",a.static.title="What scripts do you want to update?",a.static.actions=[{action:"cancel",label:"Close",flags:["safe","close"]},{action:"save",label:"Run",flags:["primary","progressive"]}]}getSetupProcess=()=>a.super.prototype.getSetupProcess.call(this).next(()=>this.wrapAsyncMethod(this.loadScriptData).then(e=>{if(e){let s=new OO.ui.MessageWidget({type:"error",label:e});this.content=new OO.ui.PanelLayout({padded:!0,expanded:!1}),this.content.$element.append(s.$element),this.$body.append(this.content.$element),this.getActions().setAbilities({save:!1});return}this.content=new OO.ui.PanelLayout({padded:!0,expanded:!1});for(let s of this.scripts){let n=new OO.ui.CheckboxInputWidget;this.checkboxElements.push([s.name,n]);let o=new OO.ui.FieldLayout(n,{align:"inline",label:s.name});this.content.$element.append(o.$element)}this.actionsMultiselect=new OO.ui.CheckboxMultiselectWidget({items:[{id:"documentation",name:"Update script documentation"},{id:"script",name:"Update script code"},{id:"style",name:"Update stylesheet"},{id:"talk",name:"Create talk redirect",selectedDefault:!1}].map(({id:s,name:n,selectedDefault:o})=>new OO.ui.CheckboxMultioptionWidget({data:s,label:n,selected:o??!0}))});let t=new OO.ui.FieldLayout(this.actionsMultiselect,{label:new OO.ui.HtmlSnippet("<b>Actions to take (if applicable):</b>"),align:"inline"});this.content.$element.append(t.$element),this.$body.append(this.content.$element)}));getActionProcess=e=>e==="cancel"?new OO.ui.Process(()=>{this.getManager().closeWindow(this)}):e==="save"?new OO.ui.Process(()=>{let t=[];for(let[s,n]of this.checkboxElements)n.isSelected()&&t.push(this.scripts.find(o=>o.name===s));this.getManager().closeWindow(this),(async()=>(mw.notify("Syncing scripts...",{tag:"sync-scripts-notification"}),await Promise.all(t.map(s=>this.handleScript(s))),await this.editOrCreate("User:Eejit43/scripts-info",[this.mapScripts(this.scripts.filter(s=>!s.personal&&!s.fork)),"","=== Forks ===",this.mapScripts(this.scripts.filter(s=>s.fork)),"","=== Personal scripts ===",this.mapScripts(this.scripts.filter(s=>s.personal))].join(`
`),"Syncing script list from GitHub"),mw.notify(`Synced ${t.length} script${t.length===1?"":"s"} from GitHub!`,{type:"success",tag:"sync-scripts-notification"})))()}):a.super.prototype.getActionProcess.call(this,e);getTeardownProcess=()=>a.super.prototype.getTeardownProcess.call(this).next(()=>{this.$body.empty()});wrapAsyncMethod(e){let t=$.Deferred();return e().then(s=>t.resolve(s)),t.promise()}loadScriptData=async()=>{let e=await fetch(`https://api.github.com/repos/${this.repoOwner}/${this.repoName}/commits`);if(!e.ok)return`Failed to fetch latest commit hash from GitHub: ${e.statusText} (${e.status})`;this.latestCommitHash=(await e.json())[0].sha;let t=await fetch(`https://raw.githubusercontent.com/${this.repoOwner}/${this.repoName}/${this.latestCommitHash}/scripts.json`);if(!t.ok)return`Failed to fetch script data from GitHub: ${t.statusText} (${t.status})`;this.scripts=await t.json()};async handleScript(e){let t=this.actionsMultiselect.findSelectedItemsData(),s=`User:Eejit43/scripts/${e.name}`,n=`User talk:Eejit43/scripts/${e.name}`,o=`${s}.js`,l=`${s}.css`,u=["{{User:Eejit43/script-documentation",e.image===!1?`| image = ${e.image}`:null,e["in-development"]?`| in-development = ${e["in-development"]}`:null,e["use-instead"]?`| use-instead = ${e["use-instead"].includes("User:")?e["use-instead"]:`[[User:Eejit43/scripts/${e["use-instead"]}|${e["use-instead"]}]]`}`:null,e["image-caption"]?`| image-caption = ${e["image-caption"]}`:null,e["other-authors"]?`| other-authors = ${e["other-authors"].map(i=>`[[User:${i}|${i}]]`).join(", ")}`:null,`| description-short = ${e["short-description"]}`,`| description = ${e.description}`,e.usage?`| usage = ${e.usage}`:null,e.configuration?`| configuration = ${e.configuration}`:null,e.changelog?`| changelog =
${Object.entries(e.changelog).map(([i,c])=>`* '''{{start date and age|${i}}}:'''${Array.isArray(c)?`
${c.map(g=>`** ${g}`).join(`
`)}`:` ${c}`}`).join(`
`)}`:null,`| skin-support = {{User:Eejit43/script-documentation/skin-support|${Object.entries(e["skin-support"]).map(([i,c])=>`${i}=${c}`).join("|")}}}`,`| released = {{start date and age|${e.released}}}`,`| updated = {{start date and age|${e.updated}}}`,"}}"].filter(Boolean),p=null;if(t.includes("script")){let i=await fetch(`https://raw.githubusercontent.com/${this.repoOwner}/${this.repoName}/${this.latestCommitHash}/dist/scripts/${e.name}.js`);if(i.ok)p=await i.text();else return mw.notify(`Failed to fetch "${e.name}.js" from GitHub: ${i.statusText} (${i.status})`,{type:"error",tag:"sync-scripts-notification"})}let d=null;if(t.includes("style")&&e.css){let i=await fetch(`https://raw.githubusercontent.com/${this.repoOwner}/${this.repoName}/${this.latestCommitHash}/dist/styles/${e.name}.css`);i.ok?d=await i.text():mw.notify(`Failed to fetch "${e.name}.css" from GitHub: ${i.statusText} (${i.status})`,{type:"error",tag:"sync-scripts-notification"})}e.personal||(t.includes("documentation")&&await this.editOrCreate(s,u.join(`
`),"Syncing script documentation from GitHub"),t.includes("talk")&&await this.editOrCreate(n,"#REDIRECT [[User talk:Eejit43]]","Redirecting script documentation talk page to main user talk page")),p&&await this.editOrCreate(o,p,"Syncing script from GitHub"),e.css&&d&&await this.editOrCreate(l,d,"Syncing styles from GitHub")}mapScripts(e){return e.map(t=>`* [[User:Eejit43/scripts/${t.name}${t.personal?".js":""}|${t.name}]] - ${t["short-description"]||t.description}${t["in-development"]?' (<span style="color: #bd2828">in development</span>)':""}${t["use-instead"]?' (<span style="color: #bd2828">deprecated</span>)':""}`).join(`
`)}async editOrCreate(e,t,s){s+=" (via [[User:Eejit43/scripts/script-updater.js|script]])",await new mw.Api().edit(e,()=>({text:t,summary:s,watchlist:"watch"})).catch(async(n,o)=>{if(n==="nocreate-missing")await new mw.Api().create(e,{summary:s,watchlist:"watch"},t).catch((l,u)=>{mw.notify(`Error creating ${e}: ${u?.error.info??"Unknown error"} (${l})`,{type:"error"})});else{mw.notify(`Error editing or creating ${e}: ${o?.error.info??"Unknown error"} (${n})`,{type:"error"});return}})}}Object.assign(a.prototype,OO.ui.ProcessDialog.prototype)});})();
// </nowiki>
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc2NyaXB0cy9zY3JpcHQtdXBkYXRlci50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiaW1wb3J0IHR5cGUgeyBNZWRpYVdpa2lEYXRhRXJyb3IgfSBmcm9tICcuLi9nbG9iYWwtdHlwZXMnO1xuXG5pbnRlcmZhY2UgU2NyaXB0IHtcbiAgICAnbmFtZSc6IHN0cmluZztcbiAgICAnaW4tZGV2ZWxvcG1lbnQnPzogYm9vbGVhbjtcb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SAoKSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gU2NyaXB0VXBkYXRlckRpYWxvZy5zdXBlci5wcm90b3R5cGUuZ2V0U2V0dXBQcm9jZXNzLmNhbGwodGhpcykubmV4dCgoKSA9PiB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMud3JhcEFzeW5jTWV0aG9kKHRoaXMubG9hZFNjcmlwdERhdGEpLnRoZW4oKGVycm9yPzogc3RyaW5nKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZUVsZW1lbnQgPSBuZXcgT08udWkuTWVzc2FnZVdpZGdldCh7IHR5cGU6ICdlcnJvcicsIGxhYmVsOiBlcnJvciB9KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50ID0gbmV3IE9PLnVpLlBhbmVsTGF5b3V0KHsgcGFkZGVkOiB0cnVlLCBleHBhbmRlZDogZmFsc2UgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnRlbnQuJGVsZW1lbnQuYXBwZW5kKG1lc3NhZ2VFbGVtZW50LiRlbGVtZW50KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgKHRoaXMgYXMgdW5rbm93biBhcyB7ICRib2R5OiBKUXVlcnkgfSkuJGJvZHkuYXBwZW5kKHRoaXMuY29udGVudC4kZWxlbWVudCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZ2V0QWN0aW9ucygpLnNldEFiaWxpdGllcyh7IHNhdmU6IGZhbHNlIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnRlbnQgPSBuZXcgT08udWkuUGFuZWxMYXlvdXQoeyBwYWRkZWQ6IHRydWUsIGV4cGFuZGVkOiBmYWxzZSB9KTtcblxuICAgICAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHNjcmlwdCBvZiB0aGlzLnNjcmlwdHMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoZWNrYm94ID0gbmV3IE9PLnVpLkNoZWNrYm94SW5wdXRXaWRnZXQoKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jaGVja2JveEVsZW1lbnRzLnB1c2goW3NjcmlwdC5uYW1lLCBjaGVja2JveF0pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBsYXlvdXQgPSBuZXcgT08udWkuRmllbGRMYXlvdXQoY2hlY2tib3gsIHsgYWxpZ246ICdpbmxpbmUnLCBsYWJlbDogc2NyaXB0Lm5hbWUgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29udGVudC4kZWxlbWVudC5hcHBlbmQobGF5b3V0LiRlbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYWN0aW9uc011bHRpc2VsZWN0ID0gbmV3IE9PLnVpLkNoZWNrYm94TXVsdGlzZWxlY3RXaWRnZXQoe1xuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXM6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IGlkOiAnZG9jdW1lbnRhdGlvbicsIG5hbWU6ICdVcGRhdGUgc2NyaXB0IGRvY3VtZW50YXRpb24nIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeyBpZDogJ3NjcmlwdCcsIG5hbWU6ICdVcGRhdGUgc2NyaXB0IGNvZGUnIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeyBpZDogJ3N0eWxlJywgbmFtZTogJ1VwZGF0ZSBzdHlsZXNoZWV0JyB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgaWQ6ICd0YWxrJywgbmFtZTogJ0NyZWF0ZSB0YWxrIHJlZGlyZWN0Jywgc2VsZWN0ZWREZWZhdWx0OiBmYWxzZSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgXS5tYXAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHsgaWQsIG5hbWUsIHNlbGVjdGVkRGVmYXVsdCB9KSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgT08udWkuQ2hlY2tib3hNdWx0aW9wdGlvbldpZGdldCh7IGRhdGE6IGlkLCBsYWJlbDogbmFtZSwgc2VsZWN0ZWQ6IHNlbGVjdGVkRGVmYXVsdCA/PyB0cnVlIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgYWN0aW9uc011bHRpc2VsZWN0TGF5b3V0ID0gbmV3IE9PLnVpLkZpZWxkTGF5b3V0KHRoaXMuYWN0aW9uc011bHRpc2VsZWN0LCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsYWJlbDogbmV3IE9PLnVpLkh0bWxTbmlwcGV0KCc8Yj5BY3Rpb25zIHRvIHRha2UgKGlmIGFwcGxpY2FibGUpOjwvYj4nKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFsaWduOiAnaW5saW5lJyxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50LiRlbGVtZW50LmFwcGVuZChhY3Rpb25zTXVsdGlzZWxlY3RMYXlvdXQuJGVsZW1lbnQpO1xuXG4gICAgICAgICAgICAgICAgICAgICh0aGlzIGFzIHVua25vd24gYXMgeyAkYm9keTogSlF1ZXJ5IH0pLiRib2R5LmFwcGVuZCh0aGlzLmNvbnRlbnQuJGVsZW1lbnQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgZ2V0QWN0aW9uUHJvY2VzcyA9IChhY3Rpb246IHN0cmluZykgPT4ge1xuICAgICAgICAgICAgaWYgKGFjdGlvbiA9PT0gJ2NhbmNlbCcpXG4gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBPTy51aS5Qcm9jZXNzKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5nZXRNYW5hZ2VyKCkuY2xvc2VXaW5kb3codGhpcyk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBlbHNlIGlmIChhY3Rpb24gPT09ICdzYXZlJylcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IE9PLnVpLlByb2Nlc3MoKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBzZWxlY3RlZFNjcmlwdHMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBbc2NyaXB0TmFtZSwgY2hlY2tib3hdIG9mIHRoaXMuY2hlY2tib3hFbGVtZW50cylcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGVja2JveC5pc1NlbGVjdGVkKCkpIHNlbGVjdGVkU2NyaXB0cy5wdXNoKHRoaXMuc2NyaXB0cy5maW5kKChzY3JpcHQpID0+IHNjcmlwdC5uYW1lID09PSBzY3JpcHROYW1lKSEpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZ2V0TWFuYWdlcigpLmNsb3NlV2luZG93KHRoaXMpO1xuXG4gICAgICAgICAgICAgICAgICAgIChhc3luYyAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtdy5ub3RpZnkoJ1N5bmNpbmcgc2NyaXB0cy4uLicsIHsgdGFnOiAnc3luYy1zY3JpcHRzLW5vdGlmaWNhdGlvbicgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IFByb21pc2UuYWxsKHNlbGVjdGVkU2NyaXB0cy5tYXAoKHNjcmlwdCkgPT4gdGhpcy5oYW5kbGVTY3JpcHQoc2NyaXB0KSkpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLmVkaXRPckNyZWF0ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnVXNlcjpFZWppdDQzL3NjcmlwdHMtaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm1hcFNjcmlwdHModGhpcy5zY3JpcHRzLmZpbHRlcigoc2NyaXB0KSA9PiAhc2NyaXB0LnBlcnNvbmFsICYmICFzY3JpcHQuZm9yaykpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJz09PSBGb3JrcyA9PT0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm1hcFNjcmlwdHModGhpcy5zY3JpcHRzLmZpbHRlcigoc2NyaXB0KSA9PiBzY3JpcHQuZm9yaykpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJz09PSBQZXJzb25hbCBzY3JpcHRzID09PScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubWFwU2NyaXB0cyh0aGlzLnNjcmlwdHMuZmlsdGVyKChzY3JpcHQpID0+IHNjcmlwdC5wZXJzb25hbCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0uam9pbignXFxuJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1N5bmNpbmcgc2NyaXB0IGxpc3QgZnJvbSBHaXRIdWInLFxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgbXcubm90aWZ5KGBTeW5jZWQgJHtzZWxlY3RlZFNjcmlwdHMubGVuZ3RofSBzY3JpcHQke3NlbGVjdGVkU2NyaXB0cy5sZW5ndGggPT09IDEgPyAnJyA6ICdzJ30gZnJvbSBHaXRIdWIhYCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdzdWNjZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWc6ICdzeW5jLXNjcmlwdHMtbm90aWZpY2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9KSgpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZWxzZSByZXR1cm4gU2NyaXB0VXBkYXRlckRpYWxvZy5zdXBlci5wcm90b3R5cGUuZ2V0QWN0aW9uUHJvY2Vzcy5jYWxsKHRoaXMsIGFjdGlvbik7XG4gICAgICAgIH07XG5cbiAgICAgICAgZ2V0VGVhcmRvd25Qcm9jZXNzID0gKCkgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIFNjcmlwdFVwZGF0ZXJEaWFsb2cuc3VwZXIucHJvdG90eXBlLmdldFRlYXJkb3duUHJvY2Vzcy5jYWxsKHRoaXMpLm5leHQoKCkgPT4ge1xuICAgICAgICAgICAgICAgICh0aGlzIGFzIHVua25vd24gYXMgeyAkYm9keTogSlF1ZXJ5IH0pLiRib2R5LmVtcHR5KCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogV3JhcHMgYW4gYXN5bmMgbWV0aG9kIGludG8gYSBqUXVlcnkgRGVmZXJyZWQgb2JqZWN0LlxuICAgICAgICAgKiBAcGFyYW0gbWV0aG9kIFRoZSBtZXRob2QgdG8gd3JhcC5cbiAgICAgICAgICovXG4gICAgICAgIHByaXZhdGUgd3JhcEFzeW5jTWV0aG9kKG1ldGhvZDogKCkgPT4gUHJvbWlzZTx1bmtub3duPikge1xuICAgICAgICAgICAgY29uc3QgZGVmZXJyZWQgPSAkLkRlZmVycmVkKCk7XG5cbiAgICAgICAgICAgIG1ldGhvZCgpLnRoZW4oKHJlc3VsdCkgPT4gZGVmZXJyZWQucmVzb2x2ZShyZXN1bH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FnZU5hbWV9LmNzc2A7XG5cbiAgICAgICAgICAgIGNvbnN0IGZ1bGxTdWJwYWdlSW5mbyA9IFtcbiAgICAgICAgICAgICAgICAne3tVc2VyOkVlaml0NDMvc2NyaXB0LWRvY3VtZW50YXRpb24nLFxuICAgICAgICAgICAgICAgIHNjcmlwdC5pbWFnZSA9PT0gZmFsc2UgPyBgfCBpbWFnZSAgICAgICAgICAgICA9ICR7c2NyaXB0LmltYWdlfWAgOiBudWxsLFxuICAgICAgICAgICAgICAgIHNjcmlwdFsnaW4tZGV2ZWxvcG1lbnQnXSA/IGB8IGluLWRldmVsb3BtZW50ICAgID0gJHtzY3JpcHRbJ2luLWRldmVsb3BtZW50J119YCA6IG51bGwsXG4gICAgICAgICAgICAgICAgc2NyaXB0Wyd1c2UtaW5zdGVhZCddXG4gICAgICAgICAgICAgICAgICAgID8gYHwgdXNlLWluc3RlYWQgICAgICAgPSAke3NjcmlwdFsndXNlLWluc3RlYWQnXS5pbmNsdWRlcygnVXNlcjonKSA/IHNjcmlwdFsndXNlLWluc3RlYWQnXSA6IGBbW1VzZXI6RWVqaXQ0My9zY3JpcHRzLyR7c2NyaXB0Wyd1c2UtaW5zdGVhZCddfXwke3NjcmlwdFsndXNlLWluc3RlYWQnXX1dXWB9YFxuICAgICAgICAgICAgICAgICAgICA6IG51bGwsXG4gICAgICAgICAgICAgICAgc2NyaXB0WydpbWFnZS1jYXB0aW9uJ10gPyBgfCBpbWFnZS1jYXB0aW9uICAgICA9ICR7c2NyaXB0WydpbWFnZS1jYXB0aW9uJ119YCA6IG51bGwsXG4gICAgICAgICAgICAgICAgc2NyaXB0WydvdGhlci1hdXRob3JzJ11cbiAgICAgICAgICAgICAgICAgICAgPyBgfCBvdGhlci1hdXRob3JzICAgICA9ICR7c2NyaXB0WydvdGhlci1hdXRob3JzJ10ubWFwKChhdXRob3IpID0+IGBbW1VzZXI6JHthdXRob3J9fCR7YXV0aG9yfV1dYCkuam9pbignLCAnKX1gXG4gICAgICAgICAgICAgICAgICAgIDogbnVsbCxcbiAgICAgICAgICAgICAgICBgfCBkZXNjcmlwdGlvbi1zaG9ydCA9ICR7c2NyaXB0WydzaG9ydC1kZXNjcmlwdGlvbiddfWAsXG4gICAgICAgICAgICAgICAgYHwgZGVzY3JpcHRpb24gICAgICAgPSAke3NjcmlwdC5kZXNjcmlwdGlvbn1gLFxuICAgICAgICAgICAgICAgIHNjcmlwdC51c2FnZSA/IGB8IHVzYWdlICAgICAgICAgICAgID0gJHtzY3JpcHQudXNhZ2V9YCA6IG51bGwsXG4gICAgICAgICAgICAgICAgc2NyaXB0LmNvbmZpZ3VyYXRpb24gPyBgfCBjb25maWd1cmF0aW9uICAgICA9ICR7c2NyaXB0LmNvbmZpZ3VyYXRpb259YCA6IG51bGwsXG4gICAgICAgICAgICAgICAgc2NyaXB0LmNoYW5nZWxvZ1xuICAgICAgICAgICAgICAgICAgICA/IGB8IGNoYW5nZWxvZyAgICAgICAgID0gXFxuJHtPYmplY3QuZW50cmllcyhzY3JpcHQuY2hhbmdlbG9nKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAubWFwKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFtkYXRlLCBkZXNjcmlwdGlvbl0pID0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYCogJycne3tzdGFydCBkYXRlIGFuZCBhZ2V8JHtkYXRlfX19OicnJyR7QXJyYXkuaXNBcnJheShkZXNjcmlwdGlvbikgPyBgXFxuJHtkZXNjcmlwdGlvbi5tYXAoKGxpbmUpID0+IGAqKiAke2xpbmV9YCkuam9pbignXFxuJyl9YCA6IGAgJHtkZXNjcmlwdGlvbn1gfWAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgLmpvaW4oJ1xcbicpfWBcbiAgICAgICAgICAgICAgICAgICAgOiBudWxsLFxuICAgICAgICAgICAgICAgIGB8IHNraW4tc3VwcG9ydCAgICAgID0ge3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gICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtdy5ub3RpZnkoXG4gICAgICAgICAgICAgICAgICAgICAgICBgRmFpbGVkIHRvIGZldGNoIFwiJHtzY3JpcHQubmFtZX0uanNcIiBmcm9tIEdpdEh1YjogJHtzY3JpcHRDb250ZW50UmVzcG9uc2Uuc3RhdHVzVGV4dH0gKCR7c2NyaXB0Q29udGVudFJlc3BvbnNlLnN0YXR1c30pYCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnZXJyb3InLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhZzogJ3N5bmMtc2NyaXB0cy1ub3RpZmljYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbGV0IHN0eWxlQ29udGVudCA9IG51bGw7XG4gICAgICAgICAgICBpZiAoYWN0aW9uc1RvVGFrZS5pbmNsdWRlcygnc3R5bGUnKSAmJiBzY3JpcHQuY3NzKSB7XG4gICAgICAgICAgICAgICAgY29uc3Qgc3R5bGVDb250ZW50UmVzcG9uc2UgPSBhd2FpdCBmZXRjaChcbiAgICAgICAgICAgICAgICAgICAgYGh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS8ke3RoaXMucmVwb093bmVyfS8ke3RoaXMucmVwb05hbWV9LyR7dGhpcy5sYXRlc3RDb21taXRIYXNofS9kaXN0L3N0eWxlcy8ke3NjcmlwdC5uYW1lfS5jc3NgLFxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICBpZiAoc3R5bGVDb250ZW50UmVzcG9uc2Uub2spIHN0eWxlQ29udGVudCA9IGF3YWl0IHN0eWxlQ29udGVudFJlc3BvbnNlLnRleHQoKTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIG13Lm5vdGlmeShcbiAgICAgICAgICAgICAgICAgICAgICAgIGBGYWlsZWQgdG8gZmV0Y2ggXCIke3NjcmlwdC5uYW1lfS5jc3NcIiBmcm9tIEdpdEh1YjogJHtzdHlsZUNvbnRlbnRSZXNwb25zZS5zdGF0dXNUZXh0fSAoJHtzdHlsZUNvbnRlbnRSZXNwb25zZS5zdGF0dXN9KWAsXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ2Vycm9yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWc6ICdzeW5jLXNjcmlwdHMtbm90aWZpY2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICghc2NyaXB0LnBlcnNvbmFsKSB7XG4gICAgICAgICAgICAgICAgaWYgKGFjdGlvbnNUb1Rha2UuaW5jbHVkZXMoJ2RvY3VtZW50YXRpb24nKSlcbiAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5lZGl0T3JDcmVhdGUoc3VicGFnZU5hbWUsIGZ1bGxTdWJwYWdlSW5mby5qb2luKCdcXG4nKSwgJ1N5bmNpbmcgc2NyaXB0IGRvY3VtZW50YXRpb24gZnJvbSBHaXRIdWInKTtcblxuICAgICAgICAgICAgICAgIGlmIChhY3Rpb25zVG9UYWtlLmluY2x1ZGVzKCd0YWxrJykpXG4gICAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuZWRpdE9yQ3JlYXRlKFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VicGFnZVRhbGtOYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgJyNSRURJUkVDVCBbW1VzZXIgdGFsazpFZWppdDQzXV0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZGlyZWN0aW5nIHNjcmlwdCBkb2N1b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gKGVycm9yQ29kZTogc3RyaW5nLCBlcnJvckluZm86IE1lZGlhV2lraURhdGFFcnJvcikgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3JDb2RlID09PSAnbm9jcmVhdGUtbWlzc2luZycpXG4gICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBuZXcgbXcuQXBpKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY3JlYXRlKHRpdGxlLCB7IHN1bW1hcnksIHdhdGNobGlzdDogJ3dhdGNoJyB9LCB0ZXh0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jYXRjaCgoZXJyb3JDb2RlOiBzdHJpbmcsIGVycm9ySW5mbzogTWVkaWFXaWtpRGF0YUVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG13Lm5vdGlmeShgRXJyb3IgY3JlYXRpbmcgJHt0aXRsZX06ICR7ZXJyb3JJbmZvPy5lcnJvci5pbmZvID8/ICdVbmtub3duIGVycm9yJ30gKCR7ZXJyb3JDb2RlfSlgLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnZXJyb3InLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG13Lm5vdGlmeShgRXJyb3IgZWRpdGluZyBvciBjcmVhdGluZyAke3RpdGxlfTogJHtlcnJvckluZm8/LmVycm9yLmluZm8gPz8gJ1Vua25vd24gZXJyb3InfSAoJHtlcnJvckNvZGV9KWAsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnZXJyb3InLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICA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