User:Eejit43/scripts/redirect-helper.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/redirect-helper.ts

"use strict";mw.loader.using(["mediawiki.util","oojs-ui-core","oojs-ui-widgets","oojs-ui-windows","oojs-ui.styles.icons-content","oojs-ui.styles.icons-editing-core"],=>{class x extends OO.ui.TextInputWidget{api=new mw.Api;pageTitleParsed;constructor(t,i){super(t),OO.ui.mixin.LookupElement.call(this,t),this.pageTitleParsed=i}getLookupRequest==>{const t=this.getValue,i=$.Deferred;if(!t)i.resolve([]);else if(t.includes("#")){const e=t.split("#")[0];this.api.get({action:"parse",page:e,prop:"sections",redirects:!0}).catch(=>null).then(a=>{if(a){const r=a.parse.sections.filter(s=>s.line.toLowerCase.replaceAll(/<\/?i>/g,"").startsWith(t.split("#")[1].toLowerCase));i.resolve(r.map(s=>({data:`${a.parse.title}#${s.line.replaceAll(/<\/?i>/g,"")}`,label:`${a.parse.title}#${s.line.replaceAll(/<\/?i>/g,"")}`})))}else i.resolve([])})}else{const e=mw.Title.newFromText(t);this.api.get({action:"query",formatversion:"2",gaplimit:20,gapnamespace:e?.getNamespaceId??0,gapprefix:e?.getMainText??t,generator:"allpages",prop:["info","pageprops"]}).catch(=>null).then(a=>{a?i.resolve(a.query?.pages?a.query.pages.filter(r=>r.title!==this.pageTitleParsed.toString).map(r=>({data:r.title,label:new OO.ui.HtmlSnippet(`${r.title}${r.pageprops&&"disambiguation"in r.pageprops?" (disambiguation)":""}${"redirect"in r?" (redirect)":""}`)})):[]):i.resolve([])})}return i.promise({abort{}})};getLookupCacheDataFromResponse=t=>t??[];getLookupMenuOptionsFromData=t=>t.map(({data:i,label:e})=>new OO.ui.MenuOptionWidget({data:i,label:e}))}Object.assign(x.prototype,OO.ui.mixin.LookupElement.prototype);class O extends OO.ui.TextInputWidget{api=new mw.Api;constructor(t){super(t),OO.ui.mixin.LookupElement.call(this,t)}getLookupRequest==>{const t=this.getValue,i=$.Deferred;t||i.resolve([]);const e=mw.Title.newFromText(t);return this.api.get({action:"query",formatversion:"2",gaplimit:20,gapnamespace:14,gapprefix:e?.getMainText??t,generator:"allpages",prop:"categories"}).catch(=>null).then(a=>{if(a?.query?.pages){const r=a.query.pages.filter(s=>!s.categories?.some(o=>o.title==="Category:Wikipedia soft redirected categories")).map(s=>{const o=s.title.split(":")[1];return{data:o,label:o}});this.emit("showing-values",r),i.resolve(r)}else i.resolve([])}),i.promise({abort{}})};getLookupCacheDataFromResponse=t=>t??[];getLookupMenuOptionsFromData=t=>t.map(({data:i,label:e})=>new OO.ui.MenuOptionWidget({data:i,label:e}))}Object.assign(O.prototype,OO.ui.mixin.LookupElement.prototype);class f extends OO.ui.ProcessDialog{api=new mw.Api;pageTitleParsed;constructor(t,i){super(t),this.pageTitleParsed=i,f.static.name="TemplatePreviewDialog",f.static.title="Redirect categorization templates preview",f.static.actions=[{action:"cancel",label:"Close",flags:["safe","close"]}]}getSetupProcess==>f.super.prototype.getSetupProcess.call(this).next(=>this.api.post({action:"parse",formatversion:"2",contentmodel:"wikitext",prop:["text","categorieshtml"],title:this.pageTitleParsed.getPrefixedDb,text:this.getData}).then(t=>{const i=t.parse.text,e=t.parse.categorieshtml,a=new OO.ui.PanelLayout({padded:!0,expanded:!1});a.$element.append(i,e),this.$body.append(a.$element)}));getActionProcess=t=>t?new OO.ui.Process(=>{this.getManager.closeWindow(this)}):f.super.prototype.getActionProcess.call(this,t);getTeardownProcess==>f.super.prototype.getTeardownProcess.call(this).next(=>{this.$body.empty})}Object.assign(f.prototype,OO.ui.ProcessDialog.prototype);class y extends OO.ui.ProcessDialog{api=new mw.Api;constructor(t){super(t),y.static.name="ShowChangesDialog",y.static.title="Changes to be made",y.static.actions=[{action:"cancel",label:"Close",flags:["safe","close"]}]}getSetupProcess==>y.super.prototype.getSetupProcess.call(this).next(=>{const[t,i]=this.getData;return this.api.post({action:"compare",formatversion:"2",prop:["diff"],fromslots:"main","fromtext-main":t,"fromcontentmodel-main":"wikitext",toslots:"main","totext-main":i,"tocontentmodel-main":"wikitext"}).then(e=>{const a=e.compare.body,r=new OO.ui.MessageWidget({type:"warning",label:"No changes to make!"}),s=new OO.ui.PanelLayout({padded:!0,expanded:!1});s.$element.append(a?` `:r.$element[0]),this.$body.append(s.$element)})});getActionProcess=t=>t?new OO.ui.Process(=>{this.getManager.closeWindow(this)}):y.super.prototype.getActionProcess.call(this,t);getTeardownProcess==>y.super.prototype.getTeardownProcess.call(this).next(=>{this.$body.empty})}Object.assign(y.prototype,OO.ui.ProcessDialog.prototype);class v{api=new mw.Api;redirectTemplates;contentText;pageTitle;pageTitleParsed;async run{if(this.passesPreChecks){if(this.redirectTemplates=await this.fetchRedirectTemplates,this.contentText=document.querySelector("#mw-content-text"),!this.contentText)return mw.notify("redirect-helper: Failed to find content text element!",{type:"error"});if(this.pageTitle=mw.config.get("wgPageName"),this.pageTitleParsed=mw.Title.newFromText(this.pageTitle),!this.pageTitleParsed)return mw.notify("redirect-helper: Failed to parse page title!",{type:"error"});await this.checkPageAndLoad}}passesPreChecks{return[mw.config.get("wgNamespaceNumber")>=0,mw.config.get("wgIsProbablyEditable"),mw.config.get("wgIsArticle"),mw.config.get("wgAction")==="view",mw.config.get("wgRevisionId")===mw.config.get("wgCurRevisionId"),!mw.config.get("wgDiffOldId")].every(Boolean)}async fetchRedirectTemplates{return JSON.parse((await this.api.get({action:"query",formatversion:"2",prop:"revisions",rvprop:"content",rvslots:"main",titles:"User:Eejit43/scripts/redirect-helper.json"})).query.pages?.[0]?.revisions?.[0]?.slots?.main?.content||"{}")}async checkPageAndLoad{const t=await this.api.get({action:"query",formatversion:"2",prop:"info",titles:this.pageTitle}),i={redirectTemplates:this.redirectTemplates,contentText:this.contentText,pageTitle:this.pageTitle,pageTitleParsed:this.pageTitleParsed};if(t.query.pages[0].missing){mw.util.addCSS(` margin-bottom: 20px; }`);const e=new OO.ui.ButtonWidget({id:"create-redirect-button",label:"Create redirect",icon:"articleRedirect",flags:["progressive"]});e.on("click",=>{e.$element[0].remove,new b(i,!1).load}),this.contentText.prepend(e.$element[0])}else if(t.query.pages[0].redirect)new b(i,!0).load;else{const e=mw.util.addPortletLink(mw.config.get("skin")==="minerva"?"p-tb":"p-cactions","#","Redirect page","redirect-helper");e.addEventListener("click",a=>{a.preventDefault,new b(i,!1).load,window.scrollTo({top:0,behavior:"smooth"}),e.remove})}}}class b{api=new mw.Api;redirectRegex=/^#redirect:?\s*\[\[\s*:?([^[\]{|}]+?)\s*(?:\|[^[\]{|}]+?)?]]\s*/i;scriptAdvert=" (via redirect-helper)";redirectTemplates;contentText;pageTitle;pageTitleParsed;exists;needsCheck=!0;editorBox;syncWithMainButton;redirectInput;redirectInputLayout;tagSelect;tagSelectLayout;templateParametersEditor;templateEditorsInfo=[];categorySelect;categorySelectInput;categorySelectLayout;defaultSortInput;defaultSortSuggestButton;defaultSortInputLayout;summaryInput;summaryInputLayout;submitButton;showChangesButton;showPreviewButton;syncTalkCheckbox;syncTalkCheckboxLayout;patrolCheckbox;patrolCheckboxLayout;submitLayout;talkData;pageContent="";oldRedirectTarget;oldRedirectTags;oldRedirectTagData;oldDefaultSort;oldCategories;oldStrayText;parsedDestination;constructor({redirectTemplates:t,contentText:i,pageTitle:e,pageTitleParsed:a},r){this.redirectTemplates=t,this.contentText=i,this.pageTitle=e,this.pageTitleParsed=a,this.exists=r}async load{mw.util.addCSS(` margin-bottom: 20px; }
 * 1) create-redirect-button {
 * 1) create-redirect-button {

color: #202122; background-color: whitesmoke; width: 700px; max-width: calc(100% - 50px); margin-left: auto; margin-right: auto; margin-bottom: 25px !important; }
 * 1) redirect-helper-box {

.redirect-input-layout label { font-weight: bold; }

.redirect-helper-redirect-possibilities::after { content: " (redirect with possibilities)"; font-style: italic; }

.redirect-helper-template-parameters-container, .redirect-helper-template-parameters-container details { background-color: #e2e2e2; border-radius: 5px; margin-block: 10px; padding: 5px; }

.redirect-helper-template-parameters-container summary { cursor: pointer; font-weight: bold; }

.redirect-helper-template-parameters-container details { background-color: #d1cece; margin-block: 5px; }

padding: 5px; }
 * 1) redirect-helper-no-templates-message {

padding-top: 10px; margin-top: 15px; border-top: 1px solid gray; }
 * 1) redirect-helper-summary-layout {

margin-top: 10px; }
 * 1) redirect-helper-submit-layout {

margin-bottom: 0; }
 * 1) redirect-helper-submit-layout > * {

.redirect-helper-warning { margin-top: 8px; }

.redirect-helper-autofix-button { margin-left: 5px; font-size: 12px; }

.redirect-helper-autofix-button a { padding: 3px 4px !important; min-height: unset !important; }`),mw.loader.addLinkTag("https://www.mediawiki.org/w/load.php?modules=mediawiki.diff.styles&only=styles"),this.editorBox=new OO.ui.PanelLayout({id:"redirect-helper-box",padded:!0,expanded:!1,framed:!0}),this.pageTitleParsed.isTalkPage&&(await this.api.get({action:"query",formatversion:"2",prop:"info",titles:this.pageTitleParsed.getSubjectPage.getPrefixedText})).query.pages[0].redirect&&await this.loadSyncWithMainButton,this.loadInputElements,await this.loadSubmitElements,this.editorBox.$element[0].append(...[this.syncWithMainButton?.$element?.[0],this.redirectInputLayout.$element[0],this.tagSelectLayout.$element[0],this.templateParametersEditor,this.defaultSortInputLayout.$element[0],this.categorySelectLayout.$element[0],this.summaryInputLayout.$element[0],this.submitLayout.$element[0]].filter(Boolean)),this.contentText.prepend(this.editorBox.$element[0]),this.exists&&this.loadExistingData}async loadSyncWithMainButton{const t=await this.getPageContent(this.pageTitleParsed.getSubjectPage.getPrefixedText);this.syncWithMainButton=new OO.ui.ButtonWidget({label:"Sync with main page",icon:"link",flags:["progressive"]}),this.syncWithMainButton.on("click",=>{const i=this.redirectRegex.exec(t)?.[1];if(!i)return mw.notify("Failed to parse main page content!",{type:"error"});this.redirectInput.setValue(mw.Title.newFromText(i)?.getTalkPage?.toString??""),["R from move",...this.redirectTemplates["R from move"].aliases].some(a=>new RegExp(`)`).test(t))&&this.tagSelect.setValue(["R from move"])})}loadInputElements{this.redirectInput=new x({placeholder:"Target page name",required:!0},this.pageTitleParsed),this.redirectInput.on("change",=>{let e=this.redirectInput.getValue;e=e.replace(new RegExp(`^(https?:)?/{2}?${mw.config.get("wgServer").replace(/^\/{2}/,"")}/wiki/`),""),e=e.replace(/^:/,""),e.length>0?(this.redirectInput.setValue(e[0].toUpperCase+e.slice(1).replaceAll("_"," ")),this.defaultSortSuggestButton.setDisabled(!1),this.submitButton.setDisabled(!1),this.showPreviewButton.setDisabled(!1),this.showChangesButton.setDisabled(!1)):(this.defaultSortSuggestButton.setDisabled(!0),this.submitButton.setDisabled(!0),this.showPreviewButton.setDisabled(!0),this.showChangesButton.setDisabled(!0)),this.updateSummary,this.submitButton.setLabel("Submit"),this.needsCheck=!0}),this.redirectInputLayout=new OO.ui.FieldLayout(this.redirectInput,{label:"Redirect target:",classes:["redirect-input-layout"],align:"top"}),this.tagSelect=new OO.ui.MenuTagMultiselectWidget({allowArbitrary:!1,allowReordering:!1,options:Object.entries(this.redirectTemplates).map(([e,{redirect:a}])=>{if(!a)return{data:e,label:e};const r=new OO.ui.HtmlSnippet(` ${e} `);return{data:e,label:r}})}),this.tagSelect.getMenu.filterMode="substring",this.tagSelect.on("change",=>{const e=this.tagSelect.getValue.sort((r,s)=>r.toLowerCase.localeCompare(s.toLowerCase));this.tagSelect.getValue.join(";")!==e.join(";")&&this.tagSelect.setValue(e),this.updateSummary,this.submitButton.setLabel("Submit"),this.needsCheck=!0;for(const r of this.templateEditorsInfo)r.details.style.display="none";let a=0;for(const r of this.tagSelect.getValue){const s=this.templateEditorsInfo.find(o=>o.name===r);s&&(s.details.style.display="block",a++)}t.textContent=`Template parameters (${a>0?`for ${a} template${a>1?"s":""}`:"none to show"})`,i.style.display=a>0?"none":"block"}),this.tagSelectLayout=new OO.ui.FieldLayout(this.tagSelect,{label:"Redirect categorization templates:",classes:["redirect-input-layout"],align:"top"}),this.templateParametersEditor=document.createElement("details"),this.templateParametersEditor.classList.add("redirect-helper-template-parameters-container");const t=document.createElement("summary");t.textContent="Template parameters (none to show)",this.templateParametersEditor.append(t);for(const[e,a]of Object.entries(this.redirectTemplates)){const r=Object.entries(a.parameters);if(r.length===0)continue;const s=document.createElement("details");s.style.display="none";const o=document.createElement("summary");o.textContent=e,s.append(o);const l={name:e,details:s,parameters:[]};for(const[u,c]of r){const g=new OO.ui.TextInputWidget({placeholder:c.default?.toString,required:c.required});g.on("change",=>{this.updateSummary,this.submitButton.setLabel("Submit"),this.needsCheck=!0});const n=new OO.ui.FieldLayout(g,{label:new OO.ui.HtmlSnippet(`${u}${!c.label||u.toLowerCase===c.label?.toLowerCase?"":` (${c.label})`}${c.description?` (${c.description})`:""} (type: ${c.type}) ${c.suggested?" (suggested)":""}${c.example?` (example: "${c.example}")`:""}`),align:"inline"});s.append(n.$element[0]),l.parameters.push({name:u,aliases:c.aliases,editor:g})}this.templateParametersEditor.append(s),this.templateEditorsInfo.push(l)}const i=document.createElement("div");i.id="redirect-helper-no-templates-message",i.textContent="No templates with parameters to display!",this.templateParametersEditor.append(i),this.defaultSortInput=new OO.ui.TextInputWidget,this.defaultSortInput.on("change",=>{const e=this.defaultSortInput.getValue;e.length>0&&this.defaultSortInput.setValue(e.replaceAll("_"," ")),this.updateSummary,this.submitButton.setLabel("Submit"),this.needsCheck=!0}),this.defaultSortSuggestButton=new OO.ui.ButtonWidget({icon:"robot",label:"Suggest",disabled:!0}),this.defaultSortSuggestButton.on("click",=>{let e=this.pageTitleParsed.getMainText.replace(/ \(.*\)$/,"");if(["R from person","R from birth name","R from fictional character"].some(a=>this.tagSelect.getValue.includes(a))){if(!e.includes(" "))return;let a="";if(/ (?:[JS]r.?|[IVX]+)$/.test(e)&&(a=e.slice(e.lastIndexOf(" ")),e=e.slice(0,e.lastIndexOf(" ")),!e.includes(" ")))return e+a;const r=e.slice(e.lastIndexOf(" ")+1).replace(/,$/,"").replace(/O'/,"O"),s=e.slice(0,e.lastIndexOf(" "));this.defaultSortInput.setValue(r+", "+s+a)}else{let a=e.replaceAll("Mr.","Mister").replaceAll("&","And");for(const r of["An","A","The"])if(a.startsWith(r+" ")){a=a.slice(r.length+1)+", "+r;break}a===e?mw.notify("redirect-helper wasn't able to determine a sort key different from the current page title!",{type:"warn"}):this.defaultSortInput.setValue(a)}}),this.defaultSortInputLayout=new OO.ui.ActionFieldLayout(this.defaultSortInput,this.defaultSortSuggestButton,{label:new OO.ui.HtmlSnippet(`Default sort key (DEFAULTSORT) (see guideline):`),classes:["redirect-input-layout"],align:"top"}),this.categorySelectInput=new O({placeholder:"Add categories here"}),this.categorySelectInput.on("change",=>{let e=this.categorySelectInput.getValue;e=e.replace(new RegExp(`^(https?:)?/{2}?${mw.config.get("wgServer").replace(/^\/{2}/,"")}/wiki/`),""),e=e.replace(/^Category:/,""),e.length>0&&this.categorySelectInput.setValue(e[0].toUpperCase+e.slice(1).replaceAll("_"," "))}),this.categorySelectInput.on("showing-values",e=>{for(const a of e)this.categorySelect.addAllowedValue(a.data)}),this.categorySelect=new OO.ui.TagMultiselectWidget({allowReordering:!1,inputPosition:"outline",inputWidget:this.categorySelectInput}),this.categorySelect.on("change",=>{const e=this.categorySelect.getValue.sort((a,r)=>a.toLowerCase.localeCompare(r.toLowerCase));this.categorySelect.getValue.join(";")!==e.join(";")&&this.categorySelect.setValue(e),this.updateSummary,this.submitButton.setLabel("Submit"),this.needsCheck=!0}),this.categorySelectLayout=new OO.ui.FieldLayout(this.categorySelect,{label:"Categories:",classes:["redirect-input-layout"],align:"top"}),this.summaryInput=new OO.ui.ComboBoxInputWidget({options:[{data:"Resolve double redirect"},{data:"Resolve self redirect"},{data:"Remove incorrect rcats"}]}),this.summaryInputLayout=new OO.ui.FieldLayout(this.summaryInput,{id:"redirect-helper-summary-layout",label:"Summary:",classes:["redirect-input-layout"],align:"top"})}async loadSubmitElements{const t=new OO.ui.WindowManager;document.body.append(t.$element[0]),this.submitButton=new OO.ui.ButtonWidget({label:"Submit",disabled:!0,flags:["progressive"]}),this.submitButton.on("click",=>this.handleSubmitButtonClick);const i=new f({size:"large"},this.pageTitleParsed);t.addWindows([i]),this.showPreviewButton=new OO.ui.ButtonWidget({label:"Show preview",disabled:!0}),this.showPreviewButton.on("click",=>{i.setData(this.createOutput(this.redirectInput.getValue,this.tagSelect.getValue,this.oldStrayText,this.defaultSortInput.getValue,this.categorySelect.getValue)),i.open});const e=new y({size:"large"});t.addWindows([e]),this.showChangesButton=new OO.ui.ButtonWidget({label:"Show changes",disabled:!0}),this.showChangesButton.on("click",async=>{this.exists&&(this.pageContent=await this.getPageContent(this.pageTitle)),e.setData([this.pageContent,this.createOutput(this.redirectInput.getValue,this.tagSelect.getValue,this.oldStrayText,this.defaultSortInput.getValue,this.categorySelect.getValue)]),e.open}),this.pageTitleParsed.isTalkPage||(this.talkData=await this.api.get({action:"query",formatversion:"2",prop:"info",titles:this.pageTitleParsed.getTalkPage.getPrefixedText}),this.syncTalkCheckbox=new OO.ui.CheckboxInputWidget({selected:!!this.talkData.query.pages[0].redirect}),this.syncTalkCheckboxLayout=new OO.ui.Widget({content:[new OO.ui.FieldLayout(this.syncTalkCheckbox,{label:"Sync talk page",align:"inline"})]})),await this.checkShouldPromptPatrol&&(this.patrolCheckbox=new OO.ui.CheckboxInputWidget({selected:!0}),this.patrolCheckboxLayout=new OO.ui.Widget({content:[new OO.ui.FieldLayout(this.patrolCheckbox,{label:"Mark as patrolled",align:"inline"})]})),this.submitLayout=new OO.ui.HorizontalLayout({id:"redirect-helper-submit-layout",items:[this.submitButton,this.showPreviewButton,this.showChangesButton,this.syncTalkCheckboxLayout,this.patrolCheckboxLayout].filter(Boolean)})}async checkShouldPromptPatrol{const t=document.querySelector("#mwe-pt-mark .mwe-pt-tool-icon");if(t?.click,t?.click,mw.config.get("wgNamespaceNumber")!==0)return!1;if(document.querySelector(".patrollink"))return!0;if(document.querySelector("#mwe-pt-mark-as-reviewed-button"))return!0;if(document.querySelector("#mwe-pt-mark-as-unreviewed-button"))return!1;{if(!mw.config.get("wgArticleId")||!(await this.api.get({action:"query",meta:"userinfo",uiprop:"rights"})).query.userinfo.rights.includes("patrol"))return!1;const e=await this.api.get({action:"pagetriagelist",page_id:mw.config.get("wgArticleId")});return e.pagetriagelist.pages[0]?.user_name===mw.config.get("wgUserName")||e.pagetriagelist.result!=="success"||e.pagetriagelist.pages.length===0?!1:!Number.parseInt(e.pagetriagelist.pages[0]?.patrol_status)}}updateSummary{const t=this.redirectInput.getValue.trim;if(!t)this.summaryInput.$tabIndexed[0].placeholder="";else if(this.exists){const i=t!==this.oldRedirectTarget?.replaceAll("_"," "),e=this.tagSelect.getValue.some(l=>!this.oldRedirectTags.includes(l))||this.oldRedirectTags.some(l=>!this.tagSelect.getValue.includes(l));let a=!1;if(this.oldRedirectTagData){const l=Object.entries(this.redirectTemplates).filter(([,u])=>Object.entries(u.parameters).length>0);for(const[u,c]of l){if(!this.oldRedirectTags.includes(u)||!this.tagSelect.getValue.includes(u))continue;const n=this.oldRedirectTagData[u]??Object.entries(c.parameters).map(([d])=>[d,""]),p=this.templateEditorsInfo.find(d=>d.name===u);for(const d of p.parameters){const m=n.find(w=>w[0]===d.name)?.[1]??"",h=d.editor.getValue.trim;if(m!==h){a=!0;break}}if(a)break}}const r=this.defaultSortInput.getValue.trim!==this.oldDefaultSort.replaceAll("_"," "),s=this.categorySelect.getValue.some(l=>!this.oldCategories.includes(l))||this.oldCategories.some(l=>!this.categorySelect.getValue.includes(l)),o=[];i&&o.push(`retarget to ${t}`),e&&o.push(`${this.tagSelect.getValue.length>0&&this.oldRedirectTags.length>0?"change":this.tagSelect.getValue.length>0?"add":"remove"} categorization templates`),a&&o.push("change categorization template arguments"),r&&o.push(`${this.defaultSortInput.getValue.trim.length>0&&this.oldDefaultSort.replaceAll("_"," ").length>0?"change":this.defaultSortInput.getValue.trim.length>0?"add":"remove"} default sort key`),s&&o.push(`${this.categorySelect.getValue.length>0&&this.oldCategories.length>0?"change":this.categorySelect.getValue.length>0?"add":"remove"} categories`),o.length===0&&o.push("perform redirect cleanup"),o[0]=o[0][0].toUpperCase+o[0].slice(1),o.length>1&&(o[o.length-1]=`and ${o.at(-1)}`),this.summaryInput.$tabIndexed[0].placeholder=o.join(o.length>2?", ":" ")}else this.summaryInput.$tabIndexed[0].placeholder=`Create redirect to ${t}`}async loadExistingData{this.exists&&(this.pageContent=await this.getPageContent(this.pageTitle)),this.oldRedirectTarget=this.redirectRegex.exec(this.pageContent)?.[1],this.oldRedirectTags=Object.entries(this.redirectTemplates).map(([i,e])=>[i,...e.aliases].some(a=>new RegExp(`)`).test(this.pageContent))?i:null).filter(Boolean).sort((i,e)=>i.toLowerCase.localeCompare(e.toLowerCase));const t=Object.entries(this.redirectTemplates).flatMap(([i,e])=>[i,...e.aliases]).map(i=>new RegExp(`)`).test(this.pageContent)?i:null).filter(Boolean);this.oldRedirectTagData=Object.fromEntries(t.map(i=>{const e=new RegExp(``).exec(this.pageContent),a=Object.entries(this.redirectTemplates).find(([o,l])=>[o,...l.aliases].includes(i))?.[0];if(!e?.[1])return null;const s=e[1].split("|").map((o,l)=>{if(!o.includes("="))return[(l+1).toString,o.trim];const[u,c]=o.split("=");return[u.trim,c.trim]});return[a,s]}).filter(Boolean)),this.oldDefaultSort=this.pageContent.match(//g)?.at(-1)?.slice(14,-2)?.trim??"",this.oldCategories=this.pageContent.match(/\[\Cc]ategory:.+?/g)?.map(i=>i.slice(11,-2))??[],this.oldStrayText=[this.pageContent.match(//i)?.[0],this.pageContent.match(//)?.[0],this.pageContent.match(//i)?.[0],this.pageContent.match(//)?.[0]].filter(Boolean).join(` `),this.oldRedirectTarget?this.redirectInput.setValue(this.oldRedirectTarget.replaceAll("_"," ")):mw.notify("Could not find redirect target!",{type:"error"}),this.tagSelect.setValue(this.oldRedirectTags);for(const[i,e]of Object.entries(this.oldRedirectTagData)){const a=this.templateEditorsInfo.find(r=>r.name===i);if(a)for(const[r,s]of e){const o=a.parameters.find(l=>[l.name,...l.aliases].includes(r));o&&o.editor.setValue(s)}}this.oldDefaultSort&&this.defaultSortInput.setValue(this.oldDefaultSort);for(const i of this.oldCategories)this.categorySelect.addAllowedValue(i);this.categorySelect.setValue(this.oldCategories.map(i=>({data:i,label:i}))),this.updateSummary}async validateSubmission{const t=[],i=this.redirectInput.getValue.trim,e=this.tagSelect.getValue;/^\s*[^[\]{|}]+\s*$/.test(i)||t.push({title:i,message:"is not a valid page title!"});try{this.parsedDestination=mw.Title.newFromText(i)}catch{t.length===0&&t.push({title:i,message:"is not a valid page title!"})}!this.parsedDestination&&t.length===0&&t.push({title:i,message:"is not a valid page title!"}),this.parsedDestination?.toString===this.pageTitleParsed.toString&&t.push({message:"cannot redirect to itself!"});const a=await this.api.get({action:"query",formatversion:"2",prop:["pageprops","categories"],titles:i}).catch(n=>(n==="missingtitle"?t.push({title:i,message:"does not exist!"}):t.push({title:i,message:`was not able to be fetched from the API (${n})!`}),null)),r=await this.api.get({action:"parse",page:i,prop:"sections",redirects:!0});if(r.parse.redirects?.[0]){const n=r.parse.redirects[0].to+(r.parse.redirects[0].tofragment?`#${r.parse.redirects[0].tofragment}`:"");t.push({title:i,message:`is a redirect to ${n}. Retarget to that page instead, as double redirects aren't allowed.`,autoFixes:[{type:"change-target",target:n}]})}if(i.split("#").length>1)if(r.parse.sections.find(p=>p.line.replaceAll(/<\/?i>/g,"")===i.split("#")[1]))e.includes("R to anchor")&&t.push({message:"is tagged as a redirect to an anchor, but it is actually a redirect to a section!",autoFixes:[{type:"add",tag:"R to section"},{type:"remove",tag:"R to anchor"}]}),e.includes("R to section")||t.push({message:"is a redirect to a section, but it is not tagged with !",autoFixes:[{type:"add",tag:"R to section"}]});else{const p=(await this.api.get({action:"query",formatversion:"2",prop:"revisions",rvprop:"content",rvslots:"main",titles:this.parsedDestination.toString})).query.pages[0].revisions[0].slots.main.content;[...p.match(/(?<=)/g)?.map(m=>m.split("|").map(h=>h.trim))?.flat??[],...p.match(/(?<=)/g)?.map(m=>m.split("|").map(h=>h.trim).filter(h=>!/^text\s*?=/.test(h)))?.flat??[],...p.match(/(?<=id=)"?.+?(?="|>|\|)/g)?.map(m=>m.trim)??[],...p.match(/EpisodeNumber += +\d+/g)?.map(m=>`ep${m.split("=")[1].trim}`)??[]].includes(i.split("#")[1])?(e.includes("R to section")&&t.push({message:"is tagged as a redirect to a section, but it is actually a redirect to an anchor!",autoFixes:[{type:"add",tag:"R to anchor"},{type:"remove",tag:"R to section"}]}),e.includes("R to anchor")||t.push({message:"is a redirect to an anchor, but it is not tagged with  !",autoFixes:[{type:"add",tag:"R to anchor"}]})):t.push({message:`is a redirect to ${i}, but that section or anchor does not exist!`,autoFixes:[{type:"change-target",target:i.split("#")[0]}]})}if(i.split("#").length===1)for(const n of["R to section","R to anchor"])e.includes(n)&&t.push({message:`is not a redirect to a section/anchor, but it is tagged with  !`,autoFixes:[{type:"remove",tag:n}]});const s=!!(a.query.pages[0].pageprops&&"disambiguation"in a.query.pages[0].pageprops),o=!!a.query.pages[0].categories?.some(n=>n.title==="Category:Surnames"),l=["R to disambiguation page","R from incomplete disambiguation"],u=["R from ambiguous sort name","R from ambiguous term"],c=l.some(n=>e.includes(n)),g=u.some(n=>e.includes(n));s&&!c&&!g&&t.push({message:"is a redirect to a disambiguation page, but it is not tagged with a disambiguation categorization template!"}),a.query.pages[0].pageprops&&!s&&((!o&&(c||g)||o&&c)&&t.push({message:"is not a redirect to a disambiguation page, but it is tagged with a disambiguation categorization template!",autoFixes:[...l,...u].map(n=>({type:"remove",tag:n}))}),o&&!g&&t.push({message:"is a redirect to a surname list, but it is not tagged with a correct disambiguation categorization template!"})),s&&e.includes("R to disambiguation page")&&!this.pageTitleParsed.getMainText.endsWith(" (disambiguation)")&&t.push({message:'is tagged with , but this title does not end with " (disambiguation)". Use  or a similar categorization template instead!',autoFixes:[{type:"remove",tag:"R to disambiguation page"}]});for(const n of["R semi-protected","R extended-protected","R template-protected","R fully protected"])e.includes(n)&&t.push({message:`is tagged with unnecessarily tagged with   which will be duplicated by the redirect category shell!`,autoFixes:[{type:"remove",tag:n}]});mw.config.get("wgWikibaseItemId")&&!e.includes("R with Wikidata item")&&t.push({message:"is linked to a Wikidata item but it isn't tagged with  !",autoFixes:[{type:"add",tag:"R with Wikidata item"}]}),e.includes("R with Wikidata item")&&!mw.config.get("wgWikibaseItemId")&&t.push({message:"is tagged with   but it is not actually linked to a Wikidata item!",autoFixes:[{type:"remove",tag:"R with Wikidata item"}]});for(const n of e){const p=this.redirectTemplates[n];if(p)for(const[d,m]of Object.entries(p.parameters)){const h=this.templateEditorsInfo.find(w=>w.name===n)?.parameters.find(w=>[w.name,...w.aliases].includes(d));h&&m.required&&!h.editor.getValue.trim&&t.push({message:`is tagged with   but it is missing the required parameter  !`})}}return this.syncTalkCheckbox?.isSelected&&!this.talkData.query.pages[0].missing&&!this.talkData.query.pages[0].redirect&&t.push({title:this.pageTitleParsed.getTalkPage.getPrefixedText,message:"exists, but is not a redirect!"}),t}async handleSubmitButtonClick{const t=[this.redirectInput,this.tagSelect,...this.templateEditorsInfo.flatMap(s=>s.parameters.map(o=>o.editor)),this.defaultSortInput,this.defaultSortSuggestButton,this.categorySelect,this.summaryInput,this.submitButton,this.showPreviewButton,this.showChangesButton,this.syncTalkCheckbox,this.patrolCheckbox].filter(Boolean);for(const s of t)s.setDisabled(!0);this.submitButton.setLabel("Checking target validity...");let i=[];if(this.needsCheck?i=await this.validateSubmission:this.parsedDestination=mw.Title.newFromText(this.redirectInput.getValue),i.length>0){for(const s of document.querySelectorAll(".redirect-helper-warning"))s.remove;for(const{title:s,message:o,autoFixes:l}of i){const u=new OO.ui.HtmlSnippet(`${s?`${s}`:"This page"} ${o} Click again without making changes to submit anyway.`),c=new OO.ui.MessageWidget({type:"error",classes:["redirect-helper-warning"],inline:!0,label:u});if(l){const g=new OO.ui.ButtonWidget({label:"Perform auto-fix",flags:["progressive"],classes:["redirect-helper-autofix-button"]});g.on("click",=>{const n=this.tagSelect.getValue;for(const p of l)p.type==="add"&&!n.includes(p.tag)&&this.tagSelect.addTag(p.tag,p.tag),p.type==="remove"&&n.includes(p.tag)&&this.tagSelect.removeTagByData(p.tag),p.type==="change-target"&&this.redirectInput.setValue(p.target);c.$element[0].style.textDecoration="line-through 2px black",g.$element[0].remove}),c.$element[0].querySelector(".oo-ui-labelElement-label").append(g.$element[0])}this.editorBox.$element[0].append(c.$element[0])}for(const s of t)s.setDisabled(!1);this.submitButton.setLabel("Submit anyway"),this.needsCheck=!1;return}this.submitButton.setLabel(`${this.exists?"Editing":"Creating"} redirect...`);const e=this.createOutput(this.redirectInput.getValue,this.tagSelect.getValue,this.oldStrayText,this.defaultSortInput.getValue,this.categorySelect.getValue),a=(this.summaryInput.getValue||this.summaryInput.$tabIndexed[0].placeholder)+this.scriptAdvert;if(await this.editOrCreate(this.pageTitle,e,a)){if(mw.notify(`Redirect ${this.exists?"edited":"created"} successfully!`,{type:"success"}),this.syncTalkCheckbox?.isSelected){this.submitButton.setLabel("Editing talk page...");const s=this.tagSelect.getValue.includes("R from move"),o=this.createOutput(this.parsedDestination.getTalkPage.getPrefixedText,s?["R from move"]:[],void 0,void 0,[]);if(!await this.editOrCreate(this.pageTitleParsed.getTalkPage.getPrefixedText,o,"Syncing redirect from main page"+this.scriptAdvert))return;mw.notify("Talk page synced successfully!",{type:"success"})}if(this.patrolCheckbox?.isSelected){this.submitButton.setLabel("Patrolling redirect...");const s=document.querySelector(".patrollink a"),o=document.querySelector("#mwe-pt-mark-as-reviewed-button");s?await this.api.postWithToken("patrol",{action:"patrol",rcid:new URL(s.href).searchParams.get("rcid")}).catch((u,c)=>(mw.notify(`Error patrolling ${this.pageTitle} via API: ${c?.error.info??"Unknown error"} (${u})`,{type:"error"}),null))&&mw.notify("Redirect patrolled successfully!",{type:"success"}):o?(o.click,mw.notify("Redirect patrolled successfully!",{type:"success"})):mw.notify("Page curation toolbar not found, redirect cannot be patrolled!",{type:"error"})}this.submitButton.setLabel("Complete, reloading..."),window.location.href=mw.util.getUrl(this.pageTitle,{redirect:"no"})}}createOutput(t,i,e,a,r){const s=mw.Title.newFromText(t),o=s?`${s.getNamespaceId===14?":":""}${s.getPrefixedText}${s.getFragment?`#${s.getFragment}`:""}`:t.trim;this.pageTitleParsed.getMainText.toLocaleLowerCase.normalize("NFD").replaceAll(/[\u0300-\u036F]/g,"")===a?.toLowerCase.normalize("NFD").replaceAll(/[\u0300-\u036F]/g,"")&&(a=void 0);const l=i.map(u=>{const c=this.templateEditorsInfo.find(n=>n.name===u);if(!c)return``;const g=c.parameters.map((n,p)=>{const d=n.editor.getValue.trim;return d?`|${n.name===(p+1).toString?"":`${n.name}=`}${d}`:null}).filter(Boolean).join("");return``});return[`#REDIRECT ${o} `,i.length>0?` `:null,e?e+` `:null,a?``:null,r.length>0?r.map(u=>``).join(` `):null].filter(Boolean).join(` `)}async getPageContent(t){return(await this.api.get({action:"query",formatversion:"2",prop:"revisions",rvprop:"content",rvslots:"main",titles:t})).query.pages[0].revisions[0].slots.main.content.trim}async editOrCreate(t,i,e){return await this.api.edit(t,=>({text:i,summary:e})).catch((a,r)=>a==="nocreate-missing"?this.api.create(t,{summary:e},i).catch((s,o)=>{mw.notify(`Error creating ${t}: ${o?.error.info??"Unknown error"} (${s})`,{type:"error"})}):(mw.notify(`Error editing or creating ${t}: ${r?.error.info??"Unknown error"} (${a})`,{type:"error"}),null))}}new v.run});

// //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc2NyaXB0cy9yZWRpcmVjdC1oZWxwZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB7XG4gICAgQXBpQ29tcGFyZVBhZ2VzUGFyYW1zLFxuICAgIEFwaVBhcnNlUGFyYW1zLFxuICAgIEFwaVF1ZXJ5SW5mb1BhcmFtcyxcbiAgICBBcGlRdWVyeVBhZ2VQcm9wc1BhcmFtcyxcbiAgICBBcGlRdWVyeVJldmlzaW9uc1BhcmFtcyxcbiAgICBBcGlRdWVyeVVzZXJJbmZvUGFyYW1zLFxuICAgIFBhZ2VUcmlhZ2VBcGlQYWdlVHJpYWdlTGlzdF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PT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG1hdGNoZWRTZWN0aW9ucyA9IHJlc3VsdC5wYXJzZS5zZWN0aW9ucy5maWx0ZXIoKHNlY3Rpb24pID0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlY3Rpb24ubGluZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRvTG93ZXJDYXNlKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlQWxsKC88XFwvP2k+L2csICcnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0YXJ0c1dpdGgodmFsdWUuc3BsaXQoJyMnKVsxXS50b0xvd2VyQ2FzZSgpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hdGNoZWRTZWN0aW9ucy5tYXAoKHNlY3Rpb24pID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBgJHtyZXN1bHQucGFyc2UudGl0bGV9IyR7c2VjdGlvbi5saW5lLnJlcGxhY2VBbGwoLzxcXC8/aT4vZywgJycpfWAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYWJlbDogYCR7cmVzdWx0LnBhcnNlLnRpdGxlfSMke3NlY3Rpb24ubGluZS5yZXBsYWNlQWxsKC88XFwvP2k+L2csICcnKX1gLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBkZWZlcnJlZC5yZXNvbHZlKFtdKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnN0IHBhcnNlZFRpdGxlID0gbXcuVGl0bGUubmV3RnJvbVRleHQodmFsdWUpO1xuXG4gICAgICAgICAgICAgICAgdGhpcy5hcGlcbiAgICAgICAgICAgICAgICAgICAgLmdldCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb246ICdxdWVyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXR2ZXJzaW9uOiAnMicsXG4gICAgICAgICAgICAgICAgICAgICAgICBnYXBsaW1pdDogMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICBnYXBuYW1lc3BhY2U6IHBhcnNlZFRpdGxlPy5nZXROYW1lc3BhY2VJZCgpID8/IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICBnYXBwcmVmaXg6IHBhcnNlZFRpdGxlPy5nZXRNYWluVGV4dCgpID8/IHZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgZ2VuZXJhdG9yOiAnYWxscGFnZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJvcDogWydpbmZvJywgJ3BhZ2Vwcm9wcyddLFxuICAgICAgICAgICAgICAgICAgICB9IHNhdGlzZmllcyBBcGlRdWVyeUFsbFBhZ2VzR2VuZXJhdG9yUGFyYW1zKVxuICAgICAgICAgICAgICAgICAgICAuY2F0Y2goKCkgPT4gbnVsbClcbiAgICAgICAgICAgICAgICAgICAgLnRoZW4oKHJlc3VsdDogeyBxdWVyeTogeyBwYWdlczogeyB0aXRsZTogc3RyaW5nOyBwYWdlcHJvcHM6IHsgZGlzYW1iaWd1YXRpb24/OiBzdHJpbmcgfTsgcmVkaXJlY3Q/OiBzdHJpbmcgfVtdIH0gfSB8IG51bGwpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnF1ZXJ5Py5wYWdlcyAvL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyByZXN1bHQucXVlcnkucGFnZXMgLy9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoKHBhZ2UpID0+IHBhZ2UudGl0bGUgIT09IHRoaXMucGFnZVRpdGxlUGFyc2VkLnRvU3RyaW5nKCkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWFwKChwYWdlKSA9PiAoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHBhZ2UudGl0bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWw6IG5ldyBPTy51aS5IdG1sU25pcHBldChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYCR7cGFnZS50aXRsZX0ke3BhZ2UucGFnZXByb3BzICYmICdkaXNhbWJpZ3VhdGlvbicgaW4gcGFnZS5wYWdlcHJvcHMgPyAnIDxpPihkaXNhbWJpZ3VhdGlvbik8L2k+JyA6ICcnfSR7J3JlZGlyZWN0JyBpbiBwYWdlID8gJyA8aT4ocmVkaXJlY3QpPC9pPicgOiAnJ31gLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogW10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgZGVmZXJyZWQucmVzb2x2ZShbXSk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4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Zyk7XG4gICAgICAgICAgICBPTy51aS5taXhpbi5Mb29rdXBFbGVtZW50LmNhbGwodGhpcyBhcyB1bmtub3duIGFzIE9PLnVpLm1peGluLkxvb2t1cEVsZW1lbnQsIGNvbmZpZyk7XG4gICAgICAgIH1cblxuICAgICAgICBnZXRMb29rdXBSZXF1ZXN0ID0gKCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgdmFsdWUgPSB0aGlzLmdldFZhbHVlKCk7XG4gICAgICAgICAgICBjb25zdCBkZWZlcnJlZCA9ICQuRGVmZXJyZWQoKTtcblxuICAgICAgICAgICAgaWYgKCF2YWx1ZSkgZGVmZXJyZWQucmVzb2x2ZShbXSk7XG5cbiAgICAgICAgICAgIGNvbnN0IHBhcnNlZFRpdGxlID0gbXcuVGl0bGUubmV3RnJvbVRleHQodmFsdWUpO1xuXG4gICAgICAgICAgICB0aGlzLmFwaVxuICAgICAgICAgICAgICAgIC5nZXQoe1xuICAgICAgICAgICAgICAgICAgICBhY3Rpb246ICdxdWVyeScsXG4gICAgICAgICAgICAgICAgICAgIGZvcm1hdHZlcnNpb246ICcyJyxcbiAgICAgICAgICAgICAgICAgICAgZ2FwbGltaXQ6IDIwLFxuICAgICAgICAgICAgICAgICAgICBnYXBuYW1lc3BhY2U6IDE0LFxuICAgICAgICAgICAgICAgICAgICBnYXBwcmVmaXg6IHBhcnNlZFRpdGxlPy5nZXRNYWluVGV4dCgpID8/IHZhbHVlLFxuICAgICAgICAgICAgICAgICAgICBnZW5lcmF0b3I6ICdhbGxwYWdlcycsXG4gICAgICAgICAgICAgICAgICAgIHByb3A6ICdjYXRlZ29yaWVzJyxcbiAgICAgICAgICAgICAgICB9IHNhdGlzZmllcyBBcGlRdWVyeUFsbFBhZ2VzR2VuZXJhdG9yUGFyYW1zKVxuICAgICAgICAgICAgICAgIC5jYXRjaCgoKSA9PiBudWxsKVxuICAgICAgICAgICAgICAgIC50aGVuKChyZXN1bHQ6IHsgcXVlcnk6IHsgcGFnZXM6IHsgdGl0bGU6IHN0cmluZzsgY2F0ZWdvcmllcz86IHsgdGl0bGU6IHN0cmluZyB9W10gfVtdIH0gfSB8IG51bGwpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdD8ucXVlcnk/LnBhZ2VzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBwYWdlcyA9IHJlc3VsdC5xdWVyeS5wYWdlcyAvL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoKHBhZ2UpID0+ICFwYWdlLmNhdGVnb3JpZXM/LnNvbWUoKGNhdGVnb3J5KSA9PiBjYXRlZ29yeS50aXRsZSA9PT0gJ0NhdGVnb3J5Oldpa2lwZWRpYSBzb2Z0IHJlZGlyZWN0ZWQgY2F0ZWdvcmllcycpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoKHBhZ2UpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdGl0bGVXaXRob3V0TmFtZXNwYWNlID0gcGFnZS50aXRsZS5zcGxpdCgnOicpWzFdO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7IGRhdGE6IHRpdGxlV2l0aG91dE5hbWVzcGFjZSwgbGFiZWw6IHRpdGxlV2l0aG91dE5hbWVzcGFjZSB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmVtaXQoJ3Nob3dpbmctdmFsdWVzJywgcGFnZXMpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHBhZ2VzKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGRlZmVycmVkLnJlc29sdmUoW10pO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZSh7IGFib3J0KCkge30gfSk7IC8vIGVzbG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gICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnBhZ2VUaXRsZVBhcnNlZC5nZXRQcmVmaXhlZERiKCksXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiB0aGlzLmdldERhdGEoKSBhcyBzdHJpbmcsXG4gICAgICAgICAgICAgICAgICAgIH0gc2F0aXNmaWVzIEFwaVBhcnNlUGFyYW1zKVxuICAgICAgICAgICAgICAgICAgICAudGhlbigocmVzdWx0KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0YWdzQ29udGVudCA9IChyZXN1bHQgYXMgeyBwYXJzZTogeyB0ZXh0OiBzdHJpbmcgfSB9KS5wYXJzZS50ZXh0O1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2F0ZWdvcmllc0NvbnRlbnQgPSAocmVzdWx0IGFzIHsgcGFyc2U6IHsgY2F0ZWdvcmllc2h0bWw6IHN0cmluZyB9IH0pLnBhcnNlLmNhdGVnb3JpZXNodG1sO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBwYW5lbExheW91dCA9IG5ldyBPTy51aS5QYW5lbExheW91dCh7IHBhZGRlZDogdHJ1ZSwgZXhwYW5kZWQ6IGZhbHNlIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFuZWxMYXlvdXQuJGVsZW1lbnQuYXBwZW5kKHRhZ3NDb250ZW50LCBjYXRlZ29yaWVzQ29udGVudCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICh0aGlzIGFzIHVua25vd24gYXMgeyAkYm9keTogSlF1ZXJ5IH0pLiRib2R5LmFwcGVuZChwYW5lbExheW91dC4kZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgZ2V0QWN0aW9uUHJvY2VzcyA9IChhY3Rpb246IHN0cmluZykgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIGFjdGlvblxuICAgICAg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G4gICAgICAgIGNvbnN0cnVjdG9yKGNvbmZpZzogT08udWkuUHJvY2Vzc0RpYWxvZy5Db25maWdPcHRpb25zKSB7XG4gICAgICAgICAgICBzdXBlcihjb25maWcpO1xuXG4gICAgICAgICAgICBTaG93Q2hhbmdlc0RpYWxvZy5zdGF0aWMubmFtZSA9ICdTaG93Q2hhbmdlc0RpYWxvZyc7XG4gICAgICAgICAgICBTaG93Q2hhbmdlc0RpYWxvZy5zdGF0aWMudGl0bGUgPSAnQ2hhbmdlcyB0byBiZSBtYWRlJztcbiAgICAgICAgICAgIFNob3dDaGFuZ2VzRGlhbG9nLnN0YXRpYy5hY3Rpb25zID0gW3sgYWN0aW9uOiAnY2FuY2VsJywgbGFiZWw6ICdDbG9zZScsIGZsYWdzOiBbJ3NhZmUnLCAnY2xvc2UnXSB9XTtcbiAgICAgICAgfVxuXG4gICAgICAgIGdldFNldHVwUHJvY2VzcyA9ICgpID0+IHtcbiAgICAgICAgICAgIHJldHVybiBTaG93Q2hhbmdlc0RpYWxvZy5zdXBlci5wcm90b3R5cGUuZ2V0U2V0dXBQcm9jZXNzLmNhbGwodGhpcykubmV4dCgoKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgW29sZFRleHQsIG5ld1RleHRdID0gdGhpcy5nZXREYXRhKCkgYXMgc3RyaW5nW107XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5hcGlcbiAgICAgICAgICAgICAgICAgICAgLnBvc3Qoe1xuICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiAnY29tcGFyZScsXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXR2ZXJzaW9uOiAnMicsXG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9wOiBbJ2RpZmYnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZyb21zbG90czogJ21haW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Zyb210ZXh0LW1haW4nOiBvbGRUZXh0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Zyb21jb250ZW50bW9kZWwtbWFpbic6ICd3aWtpdGV4dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICB0b3Nsb3RzOiAnbWFpbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndG90ZXh0LW1haW4nOiBuZXdUZXh0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RvY29udGVudG1vZGVsLW1haW4nOiAnd2lraXRleHQnLFxuICAgICAgICAgICAgICAgICAgICB9IHNhdGlzZmllcyBBcGlDb21wYXJlUGFnZXNQYXJhbXMgJiB7ICdmcm9tdGV4dC1tYWluJzogc3RyaW5nOyAnZnJvbWNvbnRlbnRtb2RlbC1tYWluJzogc3RyaW5nOyAndG90ZXh0LW1haW4nOiBzdHJpbmc7ICd0b2NvbnRlbnRtb2RlbC1tYWluJzogc3RyaW5nIH0pXG4gICAgICAgICAgICAgICAgICAgIC50aGVuKChyZXN1bHQpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNvbXBhcmlzb24gPSAocmVzdWx0IGFzIHsgY29tcGFyZTogeyBib2R5OiBzdHJpbmcgfSB9KS5jb21wYXJlLmJvZHk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG5vQ2hhbmdlc0VsZW1lbnQgPSBuZXcgT08udWkuTWVzc2FnZVdpZGdldCh7IHR5cGU6ICd3YXJuaW5nJywgbGFiZWw6ICdObyBjaGFuZ2VzIHRvIG1ha2UhJyB9KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcGFuZWxMYXlvdXQgPSBuZXcgT08udWkuUGFuZWxMYXlvdXQoeyBwYWRkZWQ6IHRydWUsIGV4cGFuZGVkOiBmYWxzZSB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhbmVsTGF5b3V0LiRlbGVtZW50LmFwcGVuZChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wYXJpc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gYFxuPHRhYmxlIGNsYXNzPVwiZGlmZiBkaWZmLWVkaXRmb250LW1vbm9zcGFjZVwiPlxuICAgIDxjb2xncm91cD5cbiAgICAgICAgPGNvbCBjbGFzcz1cImRpZmYtbWFya2VyXCI+XG4gICAgICAgIDxjb2wgY2xhc3M9XCJkaWZmLWNvbnRlbnRcIj5cbiAgICAgICAgPGNvbCBjbGFzcz1cImRpZmYtbWFya2VyXCI+XG4gICAgICAgIDxjb2wgY2xhc3M9XCJkaWZmLWNvbnRlbnRcIj5cbiAgICA8L2NvbGdyb3VwPlxuICAgIDx0Ym9keT5cbiAgICAgICAgJHtjb21wYXJpc29ufVxuICAgIDwvdGJvZHk+XG48L3RhYmxlPmBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBub0NoYW5nZXNFbGVtZW50LiRlbGVtZW50WzBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgKHRoaXMgYXMgdW5rbm93biBhcyB7ICRib2R5OiBKUXVlcnkgfSkuJGJvZHkuYXBwZW5kKHBhbmVsTGF5b3V0LiRlbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfTtcblxuICAgICAgICBnZXRBY3Rpb25Qcm9jZXNzID0gKGFjdGlvbjogc3RyaW5nKSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gYWN0aW9uXG4gICAgICAgICAgICAgICAgPyBuZXcgT08udWkuUHJvY2VzcygoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgdGhpcy5nZXRNYW5hZ2VyKCkuY2xvc2VXaW5kb3codGhpcyk7XG4gICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIDogU2hvd0NoYW5nZXNEaWFsb2cuc3VwZXIucHJvdG90eXBlLmdldEFjdGlvblByb2Nlc3MuY2FsbCh0aGlzLCBhY3Rpb24pO1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cbiAgICAgICAgICAgIGNvbnN0IGNvbmRpdGlvbnMgPSBbXG4gICAgICAgICAgICAgICAgbXcuY29uZmlnLmdldCgnd2dOYW1lc3BhY2VOdW1iZXInKSA+PSAwLCAvLyBJcyBub3QgdmlydHVhbCBuYW1lc3BhY2VcbiAgICAgICAgICAgICAgICBtdy5jb25maWcuZ2V0KCd3Z0lzUHJvYmFibHlFZGl0YWJsZScpLCAvLyBQYWdlIGlzIGVkaXRhYmxlXG4gICAgICAgICAgICAgICAgbXcuY29uZmlnLmdldCgnd2dJc0FydGljbGUnKSwgLy8gVmlld2luZyB0aGUgY29udGVudCBvZiBhIHBhZ2VcbiAgICAgICAgICAgICAgICBtdy5jb25maWcuZ2V0KCd3Z0FjdGlvbicpID09PSAndmlldycsIC8vIFZpZXdpbmcgdGhlIHBhZ2UgKG5vdCBlZGl0aW5nKVxuICAgICAgICAgICAgICAgIG13LmNvbmZpZy5nZXQoJ3dnUmV2aXNpb25JZCcpID09PSBtdy5jb25maWcuZ2V0KCd3Z0N1clJldmlzaW9uSWQnKSwgLy8gVmlld2luZyB0aGUgY3VycmVudCByZXZpc2lvblxuICAgICAgICAgICAgICAgICFtdy5jb25maWcuZ2V0KCd3Z0RpZmZPbGRJZCcpLCAvLyBOb3Qgdmlld2luZyBhIGRpZmZcbiAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgIHJldHVybiBjb25kaXRpb25zLmV2ZXJ5KEJvb2xlYW4pO1xuICAgICAgICB9XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEZldGNoZXMgdGhlIHJlZGlyZWN0IHRlbXBsYXRlcy5cbiAgICAgICAgICovXG4gICAgICAgIHByaXZhdGUgYXN5bmMgZmV0Y2hSZWRpcmVjdFRlbXBsYXRlcygpIHtcbiAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKFxuICAgICAgICAgICAgICAgIChcbiAgICAgICAgICAgICAgICAgICAgKGF3YWl0IHRoaXMuYXBpLmdldCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb246ICdxdWVyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXR2ZXJzaW9uOiAnMicsXG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9wOiAncmV2aXNpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ2cHJvcDogJ2NvbnRlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgcnZzbG90czogJ21haW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGVzOiAnVXNlcjpFZWppdDQzL3NjcmlwdHMvcmVkaXJlY3QtaGVscGVyLmpzb24nLFxuICAgICAgICAgICAgICAgICAgICB9IHNhdGlzZmllcyBBcGlRdWVyeVJldmlzaW9uc1BhcmFtcykpIGFzIFBhZ2VSZXZpc2lvbnNSZXN1bHRcbiAgICAgICAgICAgICAgICApLnF1ZXJ5LnBhZ2VzPy5bMF0/LnJldmlzaW9ucz8uWzBdPy5zbG90cz8ubWFpbj8uY29udGVudCB8fCAne30nLFxuICAgICAgICAgICAgKSBhcyBSZWRpcmVjdFRlbXBsYXRlRGF0YTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBDaGVja3MgYSBwYWdlJ3Mgc3RhdHVzIGFuZCBsb2FkcyB0aGUgaGVscGVyIGFwcHJvcHJpYXRlbHkuXG4gICAgICAgICAqL1xuICAgICAgICBwcml2YXRlIGFzeW5jIGNoZWNrUGFnZUFuZExvYWQoKSB7XG4gICAgICAgICAgICBjb25zdCBwYWdlSW5mbyA9IChhd2FpdCB0aGlzLmFwaS5nZXQoeyBhY3Rpb246ICdxdWVyeScsIGZvcm1hdHZlcnNpb246ICcyJywgcHJvcDogJ2luZm8nLCB0aXRsZXM6IHRoaXMucGFnZVRpdGxlIH0gc2F0aXNmaWVzIEFwaVF1ZXJ5SW5mb1BhcmFtcykpIGFzIFBhZ2VJbmZvUmVzdWx0O1xuXG4gICAgICAgICAgICBjb25zdCBkaWFs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Ck7XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25zdCBwb3J0bGV0TGluayA9IG13LnV0aWwuYWRkUG9ydGxldExpbmsobXcuY29uZmlnLmdldCgnc2tpbicpID09PSAnbWluZXJ2YScgPyAncC10YicgOiAncC1jYWN0aW9ucycsICcjJywgJ1JlZGlyZWN0IHBhZ2UnLCAncmVkaXJlY3QtaGVscGVyJykhO1xuICAgICAgICAgICAgICAgIHBvcnRsZXRMaW5rLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG5cbiAgICAgICAgICAgICAgICAgICAgbmV3IFJlZGlyZWN0SGVscGVyRGlhbG9nKGRpYWxvZ0luZm8sIGZhbHNlKS5sb2FkKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgd2luZG93LnNjcm9sbFRvKHsgdG9wOiAwLCBiZWhhdmlvcjogJ3Ntb290aCcgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgcG9ydGxldExpbmsucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBBbiBpbnN0YW5jZSBvZiB0aGlzIGNsYXNzIGhhbmRsZXMgdGhlIGRpYWxvZyBwb3J0aW9uIG9mIHJlZGlyZWN0LWhlbHBlciBzY3JpcHQuXG4gICAgICovXG4gICAgY2xhc3MgUmVkaXJlY3RIZWxwZXJEaWFsb2cge1xuICAgICAgICAvLyBVdGlsaXR5IHZhcmlhYmxlc1xuICAgICAgICBwcml2YXRlIGFwaSA9IG5ldyBtdy5BcGkoKTtcbiAgICAgICAgcHJpdmF0ZSByZWRpcmVjdFJlZ2V4ID0gL14jcmVkaXJlY3Q6P1xccypcXFtcXFtcXHMqOj8oW15bXFxde3x9XSs/KVxccyooPzpcXHxbXltc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dpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGVzOiB0aGlzLnBhZ2VUaXRsZVBhcnNlZC5nZXRTdWJqZWN0UGFnZSgpIS5nZXRQcmVmaXhlZFRleHQoKSxcbiAgICAgICAgICAgICAgICB9IHNhdGlzZmllcyBBcGlRdWVyeUluZm9QYXJhbXMpKSBhcyBQYWdlSW5mb1Jlc3VsdDtcblxuICAgICAgICAgICAgICAgIGlmIChtYWluUGFnZURhdGEucXVlcnkucGFnZXNbMF0ucmVkaXJlY3QpIGF3YWl0IHRoaXMubG9hZFN5bmNXaXRoTWFpbkJ1dHRvbigpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLmxvYWRJbnB1dEVsZW1lbnRzKCk7XG4gICAgICAgICAgICBhd2FpdCB0aGlzLmxvYWRTdWJtaXRFbGVtZW50cygpO1xuXG4gICAgICAgICAgICAvKiBBZGQgZWxlbWVudHMgdG8gc2NyZWVuIGFuZCBsb2FkIGRhdGEgKGlmIGFwcGxpY2FibGUpICovXG4gICAgICAgICAgICB0aGlzLmVkaXRvckJveC4kZWxlbWVudFswXS5hcHBlbmQoXG4gICAgICAgICAgICAgICAgLi4uKFtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zeW5jV2l0aE1haW5CdXR0b24/LiRlbGVtZW50Py5bMF0sXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVkaXJlY3RJbnB1dExheW91dC4kZWxlbWVudFswXSxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy50YWdTZWxlY3RMYXlvdXQuJGVsZW1lbnRbMF0sXG4gICAgICAgICAgICAgICAgICAgIHRoaXMudGVtcGxhdGVQYXJhbWV0ZXJzRWRpdG9yLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRlZmF1bHRTb3J0SW5wdXRMYXlvdXQuJGVsZW1lbnRbMF0sXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2F0ZWdvcnlTZWxlY3RMYXlvdXQuJGVsZW1lbnRbMF0sXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc3VtbWFyeUlucHV0TGF5b3V0LiRlbGVtZW50WzBdLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnN1Ym1pdExheW91dC4kZWxlbWVudFswXSxcbiAgICAgICAgICAgICAgICBdLmZpbHRlcihCb29sZWFuKSBhcyBIVE1MRWxlbWVudFtdKSxcbiAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIHRoaXMuY29udGVudFRleHQucHJlcGVuZCh0aGlzLmVkaXRvckJveC4kZWxlbWVudFswXSk7XG5cbiAgICAgICAgICAgIGlmICh0aGlzLmV4aXN0cykgdGhpcy5sb2FkRXhpc3RpbmdEYXRhKCk7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogTG9hZHMgdGhlIFwiU3luYyB3aXRoIG1haW4gcGFnZVwiIGJ1dHRvblwiIG9uIHRhbGsgcGFnZXMuXG4gICAgICAgICAqL1xuICAgICAgICBwcml2YXRlIGFzeW5jIGxvYWRTeW5jV2l0aE1haW5CdXR0b24oKSB7XG4gICAgICAgICAgICBjb25zdCBtYWluUGFnZUNvbnRlbnQgPSBhd2FpdCB0aGlzLmdldFBhZ2VDb250ZW50KHRoaXMucGFnZVRpdGxlUGFyc2VkLmdldFN1YmplY3RQYWdlKCkhLmdldFByZWZpeGVkVGV4dCgpKTtcblxuICAgICAgICAgICAgdGhpcy5zeW5jV2l0aE1haW5CdXR0b24gPSBuZXcgT08udWkuQnV0dG9uV2lkZ2V0KHsgbGFiZWw6ICdTeW5jIHdpdGggbWFpbiBwYWdlJywgaWNvbjogJ2xpbmsnLCBmbGFnczogWydwcm9ncmVzc2l2ZSddIH0pO1xuICAgICAgICAgICAgdGhpcy5zeW5jV2l0aE1haW5CdXR0b24ub24oJ2NsaWNrJywgKCkgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IHRhcmdldCA9IHRoaXMucmVkaXJlY3RSZWdleC5leGVjKG1haW5Q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ICAgICAgICAgdGhpcy5kZWZhdWx0U29ydFN1Z2dlc3RCdXR0b24uc2V0RGlzYWJsZWQodHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc3VibWl0QnV0dG9uLnNldERpc2FibGVkKHRydWUpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNob3dQcmV2aWV3QnV0dG9uLnNldERpc2FibGVkKHRydWUpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNob3dDaGFuZ2VzQnV0dG9uLnNldERpc2FibGVkKHRydWUpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlU3VtbWFyeSgpO1xuICAgICAgICAgICAgICAgIHRoaXMuc3VibWl0QnV0dG9uLnNldExhYmVsKCdTdWJtaXQnKTtcbiAgICAgICAgICAgICAgICB0aGlzLm5lZWRzQ2hlY2sgPSB0cnVlO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHRoaXMucmVkaXJlY3RJbnB1dExheW91dCA9IG5ldyBPTy51aS5GaWVsZExheW91dCh0aGlzLnJlZGlyZWN0SW5wdXQsIHsgbGFiZWw6ICdSZWRpcmVjdCB0YXJnZXQ6JywgY2xhc3NlczogWydyZWRpcmVjdC1pbnB1dC1sYXlvdXQnXSwgYWxpZ246ICd0b3AnIH0pO1xuXG4gICAgICAgICAgICAvKiBSZWRpcmVjdCBjYXRlZ29yaXphdGlvbiB0ZW1wbGF0ZSBzZWxlY3Rpb24gKi9cbiAgICAgICAgICAgIHRoaXMudGFnU2VsZWN0ID0gbmV3IE9PLnVpLk1lbnVUYWdNdWx0aXNlbGVjdFdpZGdldCh7XG4gICAgICAgICAgICAgICAgYWxsb3dBcmJpdHJhcnk6IGZhbHNlLFxuICAgICAgICAgICAgICAgIGFsbG93UmVvcmRlcmluZzogZmFsc2UsXG4gICAgICAgICAgICAgICAgb3B0aW9uczogT2JqZWN0LmVudHJpZXModGhpcy5yZWRpcmVjdFRlbXB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J1dHRvbi5zZXRMYWJlbCgnU3VibWl0Jyk7XG4gICAgICAgICAgICAgICAgdGhpcy5uZWVkc0NoZWNrID0gdHJ1ZTtcblxuICAgICAgICAgICAgICAgIGZvciAoY29uc3QgZWRpdG9ySW5mbyBvZiB0aGlzLnRlbXBsYXRlRWRpdG9yc0luZm8pIGVkaXRvckluZm8uZGV0YWlscy5zdHlsZS5kaXNwbGF5ID0gJ25vbmUnO1xuXG4gICAgICAgICAgICAgICAgbGV0IHNob3duVGVtcGxhdGVFZGl0b3JzID0gMDtcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHRhZyBvZiB0aGlzLnRhZ1NlbGVjdC5nZXRWYWx1ZSgpIGFzIHN0cmluZ1tdKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGVkaXRvckluZm8gPSB0aGlzLnRlbXBsYXRlRWRpdG9yc0luZm8uZmluZCgoZWRpdG9ySW5mbykgPT4gZWRpdG9ySW5mby5uYW1lID09PSB0YWcpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChlZGl0b3JJbmZvKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlZGl0b3JJbmZvLmRldGFpbHMuc3R5bGUuZGlzcGxheSA9ICdibG9jayc7XG4gICAgICAgICAgICAgICAgICAgICAgICBzaG93blRlbXBsYXRlRWRpdG9ycysrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgc3VtbWFyeUVsZW1lbnQudGV4dENvbnRlbnQgPSBgVGVtcGxhdGUgcGFyYW1ldGVycyAoJHtzaG93blRlbXBsYXRlRWRpdG9ycyA+IDAgPyBgZm9yICR7c2hvd25UZW1wbGF0ZUVkaXRvcnN9IHRlbXBsYXRlJHtzaG93blRlbXBsYXRlRWRpdG9ycyA+IDEgPyAncycgOiAnJ31gIDogJ25vbmUgdG8gc2hvdyd9KWA7XG5cbiAgICAgICAgICAgICAgICBub1RlbXBsYXRlc01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AgICAgICAgICAgICAgICBpbnB1dC5vbignY2hhbmdlJywgKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy51cGRhdGVTdW1tYXJ5KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnN1Ym1pdEJ1dHRvbi5zZXRMYWJlbCgnU3VibWl0Jyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm5lZWRzQ2hlY2sgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICBjb25zdCBpbnB1dExheW91dCA9IG5ldyBPTy51aS5GaWVsZExheW91dChpbnB1dCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWw6IG5ldyBPTy51aS5IdG1sU25pcHBldChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgJHtwYXJhbWV0ZXJOYW1lfSR7IXBhcmFtZXRlckRhdGEubGFiZWwgfHwgcGFyYW1ldGVyTmFtZS50b0xvd2VyQ2FzZSgpID09PSBwYXJhbWV0ZXJEYXRhLmxhYmVsPy50b0xvd2VyQ2FzZSgpID8gJycgOiBgICgke3BhcmFtZXRlckRhdGEubGFiZWx9KWB9JHtwYXJhbWV0ZXJEYXRhLmRlc2NyaXB0aW9uID8gYCAoJHtwYXJhbWV0ZXJEYXRhLmRlc2NyaXB0aW9ufSlgIDogJyd9ICh0eXBlOiAke3BhcmFtZXRlckRhdGEudHlwZX0pICR7cGFyYW1ldGVyRGF0YS5zdWdnZXN0ZWQgPyAnIChzdWdnZXN0ZWQpJyA6ICcnfSR7cGFyYW1ldGVyRGF0YS5leGFtcGxlID8gYCAoZXhhbXBsZTogXCIke3BhcmFtZXRlckRhdGEuZXhhbXBsZX1cIilgIDogJyd9YCxcbiAgICAgICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgICAgICBhbGlnbjogJ2lubGluZScsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAg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XRlclwiXG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFuYW1lLmluY2x1ZGVzKCcgJykpIHJldHVybjtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgZ2VuZXJhdGlvbmFsU3VmZml4ID0gJyc7XG4gICAgICAgICAgICAgICAgICAgIGlmICgvICg/OltKU11yLj98W0lWWF0rKSQvLnRlc3QobmFtZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdlbmVyYXRpb25hbFN1ZmZpeCA9IG5hbWUuc2xpY2UobmFtZS5sYXN0SW5kZXhPZignICcpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUgPSBuYW1lLnNsaWNlKDAsIG5hbWUubGFzdEluZGV4T2YoJyAnKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW5hbWUuaW5jbHVkZXMoJyAnKSkgcmV0dXJuIG5hbWUgKyBnZW5lcmF0aW9uYWxTdWZmaXg7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBjb25zdCBsYXN0TmFtZSA9IG5hbWVcbiAgICAgICAgICAgICAgICAgICAgICAgIC5zbGljZShuYW1lLmxhc3RJbmRleE9mKCcgJykgKyAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLywkLywgJycpXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvTycvLCAnTycpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBvdGhlck5hbWVzID0gbmFtZS5zbGljZSgwLCBuYW1lLmxhc3RJbmRleE9mKCcgJykpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGVmYXVsdFNvcnRJbnB1dC5zZXRWYWx1ZShsYXN0TmFtZSArICcsICcgKyBvdGhlck5hbWVzICsgZ2VuZXJhdGlvbmFsU3VmZml4KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbmV3TmFtZSA9IG5hbWUucmVwbGFjZUFsbCgnTXIuJywgJ01pc3RlcicpLnJlcGxhY2VBbGwoJyYnLCAnQW5kJyk7XG5cbiAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBsZWFkaW5nQXJ0aWNsZSBvZiBbJ0FuJywgJ0EnLCAnVGhlJ10pXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3TmFtZS5zdGFydHNXaXRoKGxlYWRpbmdBcnRpY2xlICsgJyAnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld05hbWUgPSBuZXdOYW1lLnNsaWNlKGxlYWRpbmdBcnRpY2xlLmxlbmd0aCArIDEpICsgJywgJyArIGxlYWRpbmdBcnRpY2xlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChuZXdOYW1lID09PSBuYW1lKSBtdy5ub3RpZnkoXCJyZWRpcmVjdC1oZWxwZXIgd2Fzbid0IGFibGUgdG8gZGV0ZXJtaW5lIGEgc29ydCBrZXkgZGlmZmVyZW50IGZyb20gdGhlIGN1cnJlbnQgcGFnZSB0aXRsZSFcIiwgeyB0eXBlOiAnd2FybicgfSk7XG4gICAgICAgICAgICAgICAgICAgIGVsc2UgdGhpcy5kZWZhdWx0U29ydElucHV0LnNldFZhbHVlKG5ld05hbWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICB0aGlzLmRlZmF1bHRTb3J0SW5wdXRMYXlvdXQgPSBuZXcgT08udWkuQWN0aW9uRmllbGRMYXlvdXQodGhpcy5kZWZhdWx0U29ydElucHV0LCB0aGlzLmRlZmF1bHRTb3J0U3VnZ2VzdEJ1dHRvbiwge1xuICAgICAgICAgICAgICAgIGxhYmVsOiBuZXcgT08udWkuSHRtbFNuaXBwZXQoYERlZmF1bHQgc29ydCBrZXkgKERFRkFVTFRTT1JU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gICAgICAgICAgICAgIHRlbXBsYXRlUHJldmlld0RpYWxvZy5zZXREYXRhKFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmNyZWF0ZU91dHB1dChcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVkaXJlY3RJbnB1dC5nZXRWYWx1ZSgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50YWdTZWxlY3QuZ2V0VmFsdWUoKSBhcyBzdHJpbmdbXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub2xkU3RyYXlUZXh0LFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kZWZhdWx0U29ydElucHV0LmdldFZhbHVlKCksXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNhdGVnb3J5U2VsZWN0LmdldFZhbHVlKCkgYXMgc3RyaW5nW10sXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVByZXZpZXdEaWFsb2cub3BlbigpO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIC8qIFNldHVwIHNob3cgY2hhbmdlcyBidXR0b24gKi9cbiAgICAgICAgICAgIGNvbnN0IHNob3dDaGFuZ2VzRGlhbG9nID0gbmV3IFNob3dDaGFuZ2VzRGlhbG9nKHsgc2l6ZTogJ2xhcmdlJyB9KTtcbiAgICAgICAgICAgIHdpbmRvd01hbmFnZXIuYWRkV2luZG93cyhbc2hvd0NoYW5nZXNEaWFsb2ddKTtcblxuICAgICAgICAgICAgdGhpcy5zaG93Q2hhbmdlc0J1dHRvbiA9IG5ldyBPTy51aS5CdXR0b25XaWRnZXQoeyBsYWJlbDogJ1Nob3cgY2hhbmdlcycsIGRpc2FibGVkOiB0cnVlIH0pO1xuICAgICAgICAgICAgdGhpcy5zaG93Q2hhbmdlc0J1dHRvbi5vbignY2xpY2snLCBhc3luYyAoKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuZXhpc3RzKSB0aGlzLnBhZ2VDb250ZW50ID0gYXdhaXQgdGhpcy5nZXRQYWdlQ29udGVudCh0aGlzLnBhZ2VUaXRsZSk7XG5cbiAgICAgICAgICAgICAgICBzaG93Q2hhbmdlc0RpYWxvZy5zZXREYXRhKFtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wYWdlQ29udGVudCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jcmVhdGVPdXRwdXQoXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJlZGlyZWN0SW5wdXQuZ2V0VmFsdWUoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudGFnU2VsZWN0LmdldFZhbHVlKCkgYXMgc3RyaW5nW10sXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm9sZFN0cmF5VGV4dCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGVmYXVsdFNvcnRJbnB1dC5nZXRWYWx1ZSgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jYXRlZ29yeVNlbGVjdC5nZXRWYWx1ZSgpIGFzIHN0cmluZ1tdLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgIF0pO1xuICAgICAgICAgICAgICAgIHNob3dDaGFuZ2VzRGlhbG9nLm9wZW4oKTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAvKiBTZXR1cCBzeW5jIHRhbGsgY2hlY2tib3ggKi9cbiAgICAgICAgICAgIGlmICghdGhpcy5wYWdlVGl0bGVQYXJzZWQuaXNUYWxrUGFnZSgpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy50YWxrRGF0YSA9IChhd2FpdCB0aGlzLmFwaS5nZXQoe1xuICAgICAgICAgICAgICAgICAgICBhY3Rpb246ICdxdWVyeScsXG4gICAgICAgICAgICAgICAgICAgIGZvcm1hdHZlcnNpb246ICcyJyxcbiAgICAgICAgICAgICAgICAgICAgcH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S5pbmNsdWRlcyh0YWcpKSBjb250aW51ZTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgb2xkVGFnRGF0YSA9IHRoaXMub2xkUmVkaXJlY3RUYWdEYXRhW3RhZyBhcyBzdHJpbmddID8/IE9iamVjdC5lbnRyaWVzKGRhdGEucGFyYW1ldGVycykubWFwKChbbmFtZV0pID0+IFtuYW1lLCAnJ10pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBmb3VuZFRhZ0VkaXRvckRhdGEgPSB0aGlzLnRlbXBsYXRlRWRpdG9yc0luZm8uZmluZCgodGVtcGxhdGUpID0+IHRlbXBsYXRlLm5hbWUgPT09IHRhZykhO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHBhcmFtZXRlciBvZiBmb3VuZFRhZ0VkaXRvckRhdGEucGFyYW1ldGVycykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG9sZEFyZ3VtZW50ID0gb2xkVGFnRGF0YS5maW5kKChhcmd1bWVudCkgPT4gYXJndW1lbnRbMF0gPT09IHBhcmFtZXRlci5uYW1lKT8uWzFdID8/ICcnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG5ld0FyZ3VtZW50ID0gcGFyYW1ldGVyLmVkaXRvci5nZXRWYWx1ZSgpLnRyaW0oKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvbGRBcmd1bWVudCAhPT0gbmV3QXJndW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFnQXJndW1lbnRzQ2hhbmdlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRhZ0FyZ3VtZW50c0NoYW5nZWQpI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3RUZW1wbGF0ZXMpXG4gICAgICAgICAgICAgICAgICAgIC5tYXAoKFt0YWcsIHRhZ0RhdGFdKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgW3RhZywgLi4udGFnRGF0YS5hbGlhc2VzXS5zb21lKCh0YWdPclJlZGlyZWN0KSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBSZWdFeHAoYHt7XFxcXHMqWyR7dGFnT3JSZWRpcmVjdFswXS50b0xvd2VyQ2FzZSgpfSR7dGFnT3JSZWRpcmVjdFswXX1dJHt0YWdPclJlZGlyZWN0LnNsaWNlKDEpfVxcXFxzKihcXFxcfHx9fSlgKS50ZXN0KHRoaXMucGFnZUNvbnRlbnQpLFxuICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gdGFnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBudWxsLFxuICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoQm9vbGVhbikgYXMgc3RyaW5nW11cbiAgICAgICAgICAgICkuc29ydCgoYSwgYikgPT4gYS50b0xvd2VyQ2FzZSgpLmxvY2FsZUNvbXBhcmUoYi50b0xvd2VyQ2FzZSgpKSk7XG5cbiAgICAgICAgICAgIGNvbnN0IG9yaWdpbmFsUmVkaXJlY3RUYWdzID0gT2JqZWN0LmVudHJpZXModGhpcy5yZWRpcmVjdFRlbXBsYXRlcylcbiAgICAgICAgICAgICAgICAuZmxhdE1hcCgoW3RhZywgdGFnRGF0YV0pID0+IFt0YWcsIC4uLnRhZ0RhdGEuYWxpYXNlc10pXG4gICAgICAgICAgICAgICAgLm1hcCgodGFnT3JSZWRpcmVjdCkgPT4gKG5ldyBSZWdFeHAoYHt7XFxcXHMqWyR7dGFnT3JSZWRpcmVjdFswXS50b0xvd2VyQ2FzZSgpfSR7dGFnT3JSZWRpcmVjdFswXX1dJHt0YWdPclJlZGlyZWN0LnNsaWNlKDEpfVxcXFxzKihcXFxcfHx9fSlgKS50ZXN0KHRoaXMucGFnZUNvbnRlbnQpID8gdGFnT3JSZWRpcmVjdCA6IG51bGwpKVxuICAgICAgICAgICAgICAgIC5maWx0ZXIoQm9vbGVhbikgYXMgc3RyaW5nW107XG5cbiAgICAgICAgICAgIHRoaXMub2xkUmVkaXJlY3RUYWdEYXRhID0gT2JqZWN0LmZyb21FbnRyaWVzKFxuICAgICAgICAgICAgICAgIG9yaWdpbmFsUmVkaXJlY3RUYWdzXG4gICAgICAgICAgICAgICAgICAgIC5tYXAoKHRhZykgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbWF0Y2ggPSBuZXcgUmVnRXhwKGB7e1xcXFxzKlske3RhZ1swXS50b0xvd2VyQ2FzZSgpfSR7dGFnWzBdfV0ke3RhZy5zbGljZSgxKX1cXFxcfD8oLio/KVxcXFxzKn19YCkuZXhlYyh0aGlzLnBhZ2VDb250ZW50KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbmV3VGFnID0gT2JqZWN0LmVudHJpZXModGhpcy5yZWRpcmVjdFRlbXBsYXRlcykuZmluZCgoW3RlbXBsYXRlLCB0YWdEYXRhXSkgPT4gW3RlbXBsYXRlLCAuLi50YWdEYXRhLmFsaWFzZXNdLmluY2x1ZGVzKHRhZykpPy5bMF07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IG9yaWdpbmFsQXJndW1lbnRzID0gbWF0Y2g/LlsxXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghb3JpZ2luYWxBcmd1bWVudHMpIHJldHVybiBudWxsO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBmb3JtYXR0ZWRBcmd1bWVudHMgPSBtYXRjaFsxXS5zcGxpdCgnfCcpLm1hcCgoYXJndW1lbnQsIGluZGV4KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFhcmd1bWVudC5pbmNsdWRlcygnPScpKSByZXR1cm4gWyhpbmRleCArIDEpLnRvU3RyaW5nKCksIGFyZ3VtZW50LnRyaW0oKV07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBbbmFtZSwgdmFsdWVdID0gYXJndW1lbnQuc3BsaXQoJz0nKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbbmFtZS50cmltKCksIHZhbHVlLnRyaW0oKV07XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtuZXdUYWcsIGZvcm1hdHRlZEFyZ3VtZW50c107XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoQm9vbGVhbikgYXMgW3N0cmluZywgc3RyaW5nW11bXV1bXSxcbiAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIHRoaXMub2xkRGVmYXVsdFNvcnQgPVxuICAgICAgICAgICAgICAgIHRoaXMucGFnZUNvbnRlbnRcbiAgICAgICAgICAgICAgICAgICAgLm1hdGNoKC97e0RFRkFVTFRTT1JUOi4qP319L2cpXG4gICAgICAgICAgICAgICAgICAgID8uYXQoLTEpXG4gICAgICAgICAgICAgICAgICAgID8uc2xpY2UoMTQsIC0yKVxuICAgICAgICAgICAgICAgICAgICA/LnRyaW0oKSA/PyAnJztcblxuICAgICAgICAgICAgdGhpcy5vbGRDYXRlZ29yaWVzID0gdGhpcy5wYWdlQ29udGVudC5tYXRjaCgvXFxbXFxbW0NjXWF0ZWdvcnk6Lis/XV0vZyk/Lm1hcCgoY2F0ZWdvcnkpID0+IGNhdGVnb3J5LnNsaWNlKDExLCAtMikpID8/IFtdO1xuXG4gICAgICAgICAgICB0aGlzLm9sZFN0cmF5VGV4dCA9IFtcbiAgICAgICAgICAgICAgICB0aGlzLnBhZ2VDb250ZW50Lm1hdGNoKC97e3Nob3J0IGRlc2NyaXB0aW9uXFx8Lio/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seSBhIHJlZGlyZWN0IHRvIGEgc2VjdGlvbiEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dG9GaXhlczogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IHR5cGU6ICdhZGQnLCB0YWc6ICdSIHRvIHNlY3Rpb24nIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgdHlwZTogJ3JlbW92ZScsIHRhZzogJ1IgdG8gYW5jaG9yJyB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0YWdzLmluY2x1ZGVzKCdSIHRvIHNlY3Rpb24nKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9ycy5wdXNoKHsgbWVzc2FnZTogJ2lzIGEgcmVkaXJlY3QgdG8gYSBzZWN0aW9uLCBidXQgaXQgaXMgbm90IHRhZ2dlZCB3aXRoIDxjb2RlPnt7UiB0byBzZWN0aW9ufX08L2NvZGU+IScsIGF1dG9GaXhlczogW3sgdHlwZTogJ2FkZCcsIHRhZzogJ1IgdG8gc2VjdGlvbicgfV0gfSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZGVzdGluYXRpb25Db250ZW50ID0gKFxuICAgICAgICAgICAgICAgICAgICAgICAgKGF3YWl0IHRoaXMuYXBpLmdldCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiAncXVlcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1hdHZlcnNpb246ICcyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wOiAncmV2aXNpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydnByb3A6ICdjb250ZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydnNsb3RzOiAnbWFpbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGVzOiB0aGlzLnBhcnNlZERlc3RpbmF0aW9uIS50b1N0cmluZygpLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBzYXRpc2ZpZXMgQXBpUXVlcnlSZXZpc2lvbnNQYXJhbXMpKSBhcyBQYWdlUmV2aXNpb25zUmVzdWx0XG4gICAgICAgICAgICAgICAgICAgICkucXVlcnkucGFnZXNbMF0ucmV2aXNpb25zWzBdLnNsb3RzLm1haW4uY29udGVudDtcblxuICAgICAgICAgICAgICAgICAgICBjb25zdCBhbmNob3JzID0gW1xuICAgICAgICAgICAgICAgICAgICAgICAgLi4uKGRlc3RpbmF0aW9uQ29udGVudFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXRjaCgvKD88PXt7XFxzKj9bQWFdKD86bmNob3JzP3xuY2hvciBmb3IgcmVkaXJlY3R8bmtlcnxOQ0hPUnxuYylcXHMqP1xcfCkuKz8oPz19fSkvZylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/Lm1hcCgoYW5jaG9yOiBzdHJpbmcpID0+IGFuY2hvci5zcGxpdCgnfCcpLm1hcCgocGFydCkgPT4gcGFydC50cmltKCkpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8uZmxhdCgpID8/IFtdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIC4uLihkZXN0aW5hdGlvbkNvbnRlbnRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWF0Y2goLyg/PD17e1xccyo/KD86W1Z2XSg/OmlzaWJsZSBhbmNob3JzP3xpc2FuY3xBbmNofGFuY2hvcnxpc2libGVhbmNob3J8YSl8W0FhXSg/Om5jaG9yZHxjaG9yZWR8bmNob3JcXCspfFtUdF1leHQgYW5jaG9yKVxccyo/XFx8KS4rPyg/PSg/PCEhfD0pfX0pL2cpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPy5tYXAoKGFuY2hvcjogc3RyaW5nKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmNob3JcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zcGxpdCgnfCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAubWFwKChwYXJ0KSA9PiBwYXJ0LnRyaW0oKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoKHBhcnQpID0+ICEvXnRleHRcXHMqPz0vLnRlc3QocGFydCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/LmZsYXQoKSA/PyBbXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAuLi4oZGVzdGluYXRpb25Db250ZW50Lm1hdGNoKC8oPzw9aWQ9KVwiPy4rPyg/PVwifD58XFx8KS9nKT8ubWFwKChhbmNob3I6IHN0cmluZykgPT4gYW5jaG9yLnRyaW0oKSkgPz8gW10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgLi4uKGRlc3RpbmF0aW9uQ29udGVudC5tYXRjaCgvRXBpc29kZU51bWJlciArPSArXFxkKy9nKT8ubWFwKChhbmNob3I6IHN0cmluZykgPT4gYGVwJHthbmNob3Iuc3BsaXQoJz0nKVsxXS50cmltKCl9YCkgPz8gW10pLFxuICAgICAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYW5jaG9ycy5pbmNsdWRlcyhkZXN0aW5hdGlvbi5zcGxpdCgnIycpWzFdKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRhZ3MuaW5jbHVkZXMoJ1IgdG8gc2VjdGlvbicpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogJ2lzIHRhZ2dlZCBhcyBhIHJlZGlyZWN0IHRvIGEgc2VjdGlvbiwgYnV0IGl0IGlzIGFjdHVhbGx5IGEgcmVkaXJlY3QgdG8gYW4gYW5jaG9yIScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dG9GaXhlczogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyB0eXBlOiAnYWRkJywgdGFnOiAnUiB0byBhbmNob3InIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IHR5cGU6ICdyZW1vdmUnLCB0YWc6ICdSIHRvIHNlY3Rpb24nIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXRhZ3MuaW5jbHVkZXMoJ1IgdG8gYW5jaG9yJykpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JzLnB1c2goeyBtZXNzYWdlOiAnaXMgYSByZWRpcmVjdCB0byBhbiBhbmNob3IsIGJ1dCBpdCBpcyBub3QgdGFnZ2VkIHdpdGggPGNvZGU+e3tSIGZyb20gYW5jaG9yfX08L2NvZGU+IScsIGF1dG9GaXhlczogW3sgdHlwZTogJ2FkZCcsIHRhZzogJ1IgdG8gYW5jaG9yJyB9XSB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogYGlzIGEgcmVkaXJlY3QgdG8gPGEgaHJlZj1cIiR7bXcudXRpbC5nZXRVcmwoZGVzdGluYXRpb24pfVwiIHRhcmdldD1cIl9ibGFua1wiPiR7ZGVzdGluYXRpb259PC9hPiwgYnV0IHRoYXQgc2VjdGlvbiBvciBhbmNob3IgZG9lcyBub3QgZXhpc3QhYCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRvRml4ZXM6IFt7IHR5cGU6ICdjaG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mIGF1dG9GaXhlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXV0b0ZpeC50eXBlID09PSAnYWRkJyAmJiAhdGFncy5pbmNsdWRlcyhhdXRvRml4LnRhZykpIHRoaXMudGFnU2VsZWN0LmFkZFRhZyhhdXRvRml4LnRhZywgYXV0b0ZpeC50YWcpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdXRvRml4LnR5cGUgPT09ICdyZW1vdmUnICYmIHRhZ3MuaW5jbHVkZXMoYXV0b0ZpeC50YWcpKSB0aGlzLnRhZ1NlbGVjdC5yZW1vdmVUYWdCeURhdGEoYXV0b0ZpeC50YWcpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdXRvRml4LnR5cGUgPT09ICdjaGFuZ2UtdGFyZ2V0JykgdGhpcy5yZWRpcmVjdElucHV0LnNldFZhbHVlKGF1dG9GaXgudGFyZ2V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YXJuaW5nTWVzc2FnZS4kZWxlbWVudFswXS5zdHlsZS50ZXh0RGVjb3JhdGlvbiA9ICdsaW5lLXRocm91Z2ggMnB4IGJsYWNrJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRvRml4QnV0dG9uLiRlbGVtZW50WzBdLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHdhcm5pbmdNZXNzYWdlLiRlbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3IoJy5vby11aS1sYWJlbEVsZW1lbnQtbGFiZWwnKSEuYXBwZW5kKGF1dG9GaXhCdXR0b24uJGVsZW1lbnRbMF0pO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5lZGl0b3JCb3guJGVsZW1lbnRbMF0u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IC50b0xvY2FsZUxvd2VyQ2FzZSgpXG4gICAgICAgICAgICAgICAgICAgIC5ub3JtYWxpemUoJ05GRCcpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlQWxsKC9bXFx1MDMwMC1cXHUwMzZGXS9nLCAnJykgPT09XG4gICAgICAgICAgICAgICAgZGVmYXVsdFNvcnRcbiAgICAgICAgICAgICAgICAgICAgPy50b0xvd2VyQ2FzZSgpXG4gICAgICAgICAgICAgICAgICAgIC5ub3JtYWxpemUoJ05GRCcpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlQWxsKC9bXFx1MDMwMC1cXHUwMzZGXS9nLCAnJylcbiAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICBkZWZhdWx0U29ydCA9IHVuZGVmaW5lZDsgLy8gQ2hlY2sgaWYgdGl0bGVzIG5vcm1hbGl6ZSB0byB0aGUgc2FtZSB0ZXh0LCBhbmQgcmVtb3ZlcyB0aGUgREVGQVVMVFNPUlQgaWYgc29cblxuICAgICAgICAgICAgY29uc3QgdGFnc1dpdGhBcmd1bWVudHMgPSB0YWdzLm1hcCgodGFnKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgZm91bmRBcmd1bWVudEVkaXRvciA9IHRoaXMudGVtcGxhdGVFZGl0b3JzSW5mby5maW5kKChlZGl0b3JJbmZvKSA9PiBlZGl0b3JJbmZvLm5hbWUgPT09IHRhZyk7XG4gICAgICAgICAgICAgICAgaWYgKCFmb3VuZEFyZ3VtZW50RWRpdG9yKSByZXR1cm4gYHt7JHt0YWd9fX1gO1xuXG4gICAgICAgICAgICAgICAgY29uc3QgbWFwcGVkQXJndW1lbnRzID0gZm91bmRBcmd1bWVudEVkaXRvci5wYXJhbWV0ZXJzXG4gICAgICAgICAgICAgICAgICAgIC5tYXAoKHBhcmFtZXRlciwgaW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gcGFyYW1ldGVyLmVkaXRvci5nZXRWYWx1ZSgpLnRyaW0oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdmFsdWUpIHJldHVybiBudWxsO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYHwke3BhcmFtZXRlci5uYW1lID09PSAoaW5kZXggKyAxKS50b1N0cmluZygpID8gJycgOiBgJHtwYXJhbWV0ZXIubmFtZX09YH0ke3ZhbHVlfWA7XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoQm9vbGVhbilcbiAgICAgICAgICAgICAgICAgICAgLmpvaW4oJycpO1xuXG4gICAgICAgICAgICAgICAgcmV0dXJuIGB7eyR7dGFnfSR7bWFwcGVkQXJndW1lbnRzfX19YDtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAgIGAjUkVESVJFQ1QgW1ske2Zvcm1hdHRlZFRpdGxlfV1dXFxuYCwgLy9cbiAgICAgICAgICAgICAgICB0YWdzLmxlbmd0aCA+IDAgPyBge3tSZWRpcmVjdCBjYXRlZ29yeSBzaGVsbHxcXG4ke3RhZ3NXaXRoQXJndW1lbnRzLmpvaW4oJ1xcbicpfVxcbn19XFxuYCA6IG51bGwsXG4gICAgICAgICAgICAgICAgc3RyYXlUZXh0ID8gc3RyYXlUZXh0ICsgJ1xcbicgOiBudWxsLFxuICAgICAgICAgICAgICAgIGRlZmF1bHRTb3J0ID8gYHt7REVGQVVMVFNPUlQ6JHtkZWZhdWx0U29ydC50cmltKCl9fX1gIDogbnVsbCxcbiAgICAgICAgICAgICAgICBjYXRlZ29yaWVzLmxlbmd0aCA+IDAgPyBjYXRlZ29yaWVzLm1hcCgoY2F0ZWdvcnkpID0+IGBbW0NhdGVnb3J5OiR7Y2F0ZWdvcnl9XV1gKS5qb2luKCdcXG4nKSA6IG51bGwsXG4gICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgLmZpbHRlcihCb29sZWFuKVxuICAgICAgICAgICAgICAgIC5qb2luKCdcXG4nKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBGZXRjaGVzIHRoZSBjb250ZW50IG9mIGEgZ2l2ZW4gcGFnZS5cbiAgICAgICAgICogQHBhcmFtIHRpdGxlIFRoZSB0aXRsZSB0byBmZXRjaC5cbiAgICAgICAgICovXG4gICAgICAgIHByaXZhdGUgYXN5bmMgZ2V0UGFnZUNvbnRlbnQodGl0bGU6IHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAoYXdhaXQgdGhpcy5hcGkuZ2V0KHtcbiAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiAncXVlcnknLFxuICAgICAgICAgICAgICAgICAgICBmb3JtYXR2ZXJzaW9uOiAnMicsXG4gICAgICAgICAgICAgICAgICAgIHByb3A6ICdyZXZpc2lvbnMnLFxuICAgICAgICAgICAgICAgICAgICBydnByb3A6ICdjb250ZW50JyxcbiAgICAgICAgICAgICAgICAgICAgcnZzbG90czogJ21haW4nLFxuICAgICAgICAgICAgICAgICAgICB0aXRsZXM6IHRpdGxlLFxuICAgICAgICAgICAgICAgIH0gc2F0aXNmaWVzIEFwaVF1ZXJ5UmV2aXNpb25zUGFyYW1zKSkgYXMgUGFnZVJldmlzaW9uc1Jlc3VsdFxuICAgICAgICAgICAgKS5xdWVyeS5wYWdlc1swXS5yZXZpc2lvbnNbMF0uc2xvdHMubWFpbi5jb250ZW50LnRyaW0oKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBFZGl0cyBvciBjcmVhdGVzIGEgcGFnZSB3aXRoIGdpdmVuIHRleHQuXG4gICAgICAgICAqIEBwYXJhbSB0aXRsZSBUaGUgcGFnZSB0aXRsZS5cbiAgICAgICAgICogQHBhcmFtIHRleHQgVGhlIHBhZ2UgdGV4dC5cbiAgICAgICAgICogQHBhcmFtIHN1bW1hcnkgVGhlIGVkaXQgc3VtbWFyeS5cbiAgICAgICAgICovXG4gICAgICAgIHByaXZhdGUgYXN5bmMgZWRpdE9yQ3JlYXRlKHRpdGxlOiBzdHJpbmcsIHRleHQ6IHN0cmluZywgc3VtbWFyeTogc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5hcGlcbiAgICAgICAgICAgICAgICAuZWRpdCh0aXRsZSwgKCkgPT4gKHsgdGV4dCwgc3VtbWFyeSB9KSlcbiAgICAgICAgICAgICAgICAuY2F0Y2goKGVycm9yQ29kZTogc3RyaW5nLCBlcnJvckluZm86IE1lZGlhV2lraURhdGFFcnJvcikgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3JDb2RlID09PSAnbm9jcmVhdGUtbWlzc2luZycpXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5hcGkuY3JlYXRlKHRpdGxlLCB7IHN1bW1hcnkgfSwgdGV4dCkuY2F0Y2goKGVycm9yQ29kZTogc3RyaW5nLCBlcnJvckluZm86IE1lZGlhV2lraURhdGFFcnJvcikgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG13Lm5vdGlmeShgRXJyb3IgY3JlYXRpbmcgJHt0aXRsZX06ICR7ZXJyb3JJbmZvPy5lcnJvci5pbmZvID8/ICdVbmtub3duIGVycm9yJ30gKCR7ZXJyb3JDb2RlfSlgLCB7IHR5cGU6ICdlcnJvcicgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtdy5ub3RpZnkoYEVycm9yIGVkaXRpbmcgb3IgY3JlYXRpbmcgJHt0aXRsZX06ICR7ZXJyb3JJbmZvPy5lcnJvci5pbmZvID8/ICdVbmtub3duIGVycm9yJ30gKCR7ZXJyb3JDb2RlfSlgLCB7IHR5cGU6ICdlcnJvcicgfSk7XG4gICAgICAgICAgICA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