Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@禁漫天堂@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi56aB5ryr5aSp5aCCIiwiYXV0aG9yIjoiTElVJuWtkOS4keWvheWNryZLaWxsZXImTG95RGdJayblraPpo44iLCJ1cmwiOiJoaWtlcjovL2VtcHR5IyMvYWxidW1zP289bXImcGFnZT1meXBhZ2UiLCJ2ZXJzaW9uIjowLCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6ImNhcnRvb24iLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbnZhciBkID0gW107XG5yYyhmZXRjaFBDKCdodHRwczovL2dpdGVlLmNvbS9taXN0eXdhdGVyL2hpa2VyX2luZm8vcmF3L21hc3Rlci9naXRodWJwcm94eS5qc29uJykgKyAnaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL21pc3R5d2F0ZXIvaGlrZXIvbWFpbi9mJywgMjQpO1xuLy9ldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL3lpP3J1bGU9zrEnKSkucnVsZSk7XG5ldmFsKEpTT04ucGFyc2UoZmV0Y2goXCJoaWtlcjovL3BhZ2UveWpcIiwge30pKS5ydWxlKTtcbnB1dFZhcignbGluaycsY29uZmlnLmhvc3QpXG52YXIgbGluayA9IGdldFZhcignbGluaycpXG5jb25zdCBwYWdlID0gTVlfUEFHRTtcbmNvbnN0IGRjID0gZHluYW1pY0NsYXNzKHtcbiAgICDliIbnsbvpopzoibI6IGdldFJhbmdlQ29sb3JzKClcbn0pO1xudmFyIGdldFJ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AgICAgdXJsOiBNWV9VUkwsXG4gICAgICAgICAgICAgICAgZGVzYzogJ2xpc3QmJnNjcmVlbicsXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJVc2VyLUFnZW50XCI6IFwiTW96aWxsYS81LjAgKExpbnV4OyBBbmRyb2lkIDEyOyBTTS1HOTc1MCBCdWlsZC9TUDFBLjIxMDgxMi4wMTY7IHd2KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBWZXJzaW9uLzQuMCBDaHJvbWUvODkuMC40Mzg5LjcyIE1RUUJyb3dzZXIvNi4yIFRCUy8wNDYyNzkgTW9iaWxlIFNhZmFyaS81MzcuMzZcIiwvL1BDX1VBLCAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgc2hvd1Byb2dyZXNzOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjbyA9IGZiYS5nZXRDb29raWUodSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvLmluY2x1ZGVzKCdyZW1lbWJlcj0nKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEucGFyc2VMYXp5UnVsZSgkJCQoKS5sYXp5UnVsZSgoY28pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS9KTV9jb29raWUudHh0JywgY28pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoJ+i0puWPt+W3sueZu+W9lScpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjayh0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgY28pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGNoZWNrLCA1MDApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrKCk7XG4gICAgICAgICAgICAgICAgICAgIH0sIE1ZX1VSTClcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJldHVybiBzZXRSZXN1bHQoZCk7XG4gICAgICAgIH0pLFxuICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcidcbiAgICB9KTtcblxufVxubGV0IG5hdiA9IFtcIummlumhtVwiLFwiQea8q1wiLFwi5YiG57G7XCJdO1xubGV0IGNvbG9ycz0gWyc5RjVGOUYnLCdmN2U4YWEnLCcyMGExNjInXTtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5hdi5sZW5ndGg7IGkrKykge1xuICAgICAgICBsZXQgbXl0aXRsZSA9IG5hdltpXTtcbiAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcignbmF2dGl0bGUnLCBcIummlumhtVwiKSA9PSBteXRpdGxlID8gY29sb3IobXl0aXRsZSxnZXRSYW5nZUNvbG9ycygpKTogbXl0aXRsZSxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMjbm9IaXN0b3J5IycpLmxhenlSdWxlKChteXRpdGxlKSA9PiB7XG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXCJuYXZ0aXRsZVwiLCBteXRpdGxlKTtcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcbiAgICAgICAgICAgIH0sIG15dGl0bGUpL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lK1wiJm1haW5fdGFnPTAmbz1tdiZ0PWEmcGFnZT1cIjtcclxuICAgICAgICAgICAgICAgIGQucHVzaCh7IFxyXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwrJ2Z5cGFnZSNmdWxsVGhlbWUjI25vSGlzdG9yeSNAcnVsZT1qczokLnJlcXVpcmUoXCJoaWtlcjovL3BhZ2Uvc2VhcmNoXCIpJyxcclxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXCJmbGV4X2J1dHRvblwiLFxuICAgICAgICAgICAgICAgICAgICBleHRyYTp7XG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICB1cmw6IHVybFxuICAgICAgICAgfVxufSk7XG59KVxufSlcbiovXG52YXIgTGFiID0gcGRmYShodG1sLCdib2R5JiYucm93OmhhcyguYnRuLXRvb2xiYXIpOm5vdCg6bWF0Y2hlcyjnsbvliKt85o6S6KGMKSknKTtcclxuICAgICAgICBMYWIuZm9yRWFjaCgoZGF0YSkgPT4ge1xuICAgICAgICAgICBkLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgdGl0bGU6IHNwKHBkZmgoZGF0YSwgJ2g0JiZUZXh0JykpLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcInJpY2hfdGV4dFwiLFxyXG4gICAgICAgICAgICB9KTsgICAgICAgICAgICBcclxuICAgICAgICAgICAgdmFyIGl0ZW0gPSBwZGZhKGRhdGEsICcucm93JiZsaScpO1xyXG4gICAgICAgICAgICBpdGVtLmZvckVhY2goKGRhdGFzKSA9PiB7XG52YXIgdGl0bGU9IHNwKHBkZmgoZGF0YXMsICdhJiZUZXh0JykpO1xuICAgICAgICAgICAgICAgIGQucHVzaCh7IFxyXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAgICAgICAgICAgICAgICAgICAna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AgICAgICAgICAgLy8g5Zyo6L+Z6YeM5omn6KGM5oKo55qE5pON5L2cXFxuICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHldID0gdmFsdWU7XFxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmRlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhwcm9wZXJ0eSArIFxcXCI6XFxcIiArIHZhbHVlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSxcXG4gICAgICAgIGV2YWxKU1J1bGUoaXRlbSxcXG4gICAgICAgICAgICBqc1J1bGUpIHtcXG4gICAgICAgICAgICBsZXQgcnVsZSA9IGpzUnVsZS5yZXBsYWNlKFxcXCJAanM6XFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgIHJ1bGUgPSBydWxlLnRyaW0oKTtcXG4gICAgICAgICAgICAvL2xvZygkLnN0cmluZ2lmeShydWxlKSlcXG4gICAgICAgICAgICBsZXQgaW5wdXQgPSBpdGVtO1xcbiAgICAgICAgICAgIGlmIChydWxlLnN0YXJ0c1dpdGgoXFxcIihcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBldmFsKFxcXCJyZXN1bHQgPSBcXFwiICsgcnVsZSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgLyoqXFxuICAgICAgICAgICAgICAgICAqIOi/mOWOn+aIkCAkLnRvU3RyaW5nKC4uLikg55qE5pyA57uI57uT5p6c77yM6L6+5Yiw5pyA57uI5aSE55CG5pa55byP6Lef5LiK6Z2i55qEIGlmIOS4gOiHtOeahOebrueahFxcbiAgICAgICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICAgICAgZXZhbChcXFwicmVzdWx0ID0gXFxcIiArIFxcXCIoKCkgPT4ge1xcXCIgKyBydWxlICsgXFxcIn0pKClcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICA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CIpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gY2F0ZWdvcnku6ZO+5o6l5aSE55CGKHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgfHwgXFxcIlxcXCI7XFxuICAgICAgICB9LFxcbiAgICAgICAgaXNOdWxsKHBhcmFtKSB7XFxuICAgICAgICAgICAgaWYgKHBhcmFtID09IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgIH0sXFxuICAgICAgICBpc0Jvb2xlYW4odmFyaWFibGUpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhcmlhYmxlICE9PSBcXFwiYm9vbGVhblxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLlvIDlkK/mipjlj6Dor7fkvKDlhaXluIPlsJTlgLxcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcbiAgICAgICAg5riF6ZmkKGxpc3QpIHtcXG4gICAgICAgICAgICBpZiAodGhpcy5pc051bGwobGlzdCkpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChsaXN0LmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIua4hemZpOaKpemUmTror7fkvKDliJfooahcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGhpcy5jbGVhcnMgPSBsaXN0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOWFqOa4hShsaXN0KSB7XFxuICAgICAgICAgICAgaWYgKHRoaXMuaXNOdWxsKGxpc3QpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgYyA9IHRoaXMuY2xlYXJhbGw7XFxuICAgICAgICAgICAgbGlzdCA9IGMuY29uY2F0KGxpc3QpO1xcbiAgICAgICAgICAgIHRoaXMuY2xlYXJhbGwgPSBsaXN0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOa6kOeggShpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMuaHRtbCA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOeVjOmdoihpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMubGF5b3V0ID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAg6aG156CBKGlucHV0KSB7XFxuICAgICAgICAgICAgdGhpcy5wYWdlID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAg54q25oCBKGlucHV0KSB7XFxuICAgICAgICAgICAgdGhpcy5zdGF0ZSA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOW8gOWQr+aQnOe0oihpbnB1dCkge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSB0cnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0aGlzLnNlYXJjaCA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOW8gOWQr+aKmOWPoChpbnB1dCkge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSB0cnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0aGlzLmlzQm9vbGVhbihpbnB1dCk7XFxuICAgICAgICAgICAgdGhpcy5vcGVuID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAgc2V0VGl0bGUoaywgaSwgdCkge1xcbiAgICAgICAgICAgIHJldHVybiBrID09IGkgPyBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIHQuZm9udGNvbG9yKHRoaXMu5YiG57G76aKc6ImyKSA6IHQ7XFxuICAgICAgICB9LFxcbiAgICAgICAgYWN0aW9uKG9iaikge1xcbiAgICAgICAgICAgIHJldHVybiBbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIua4hemZpOeKtuaAgVxcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChvYmopID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhvYmopO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihvYmouc3RhdGUpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiaGVhZC5jYXRlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjYXRlX2J1dHRvbicpO1xcbiAgICAgICAgICAgICAgICAgICAgb2JqLmFsbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgb2JqLmNsLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICB9LCBvYmopLFxcbiAgICAgICAgICAgIH0sIF07XFxuICAgICAgICB9LFxcbiAgICAgICAgY2hlY2tQYXJhbSgpIHtcXG4gICAgICAgICAgICB2YXIgb2JqID0ge307XFxuICAgICAgICAgICAgaWYgKHRoaXMucGFnZSA9PSAwICYmIHR5cGVvZiBwYWdlID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl6aG156CBXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwYWdlID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIumhteeggVxcXCJdID0gdGhpcy5wYWdlO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLpobXnoIFcXFwiXSA9IHBhZ2U7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRoaXMuaHRtbCA9PSBcXFwiZW1wdHlcXFwiICYmIHR5cGVvZiBodG1sID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl5rqQ56CBXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBodG1sID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIua6kOeggVxcXCJdID0gdGhpcy5odG1sO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLmupDnoIFcXFwiXSA9IGh0bWw7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRoaXMubGF5b3V0ID09IFxcXCJ1bmRlZmluZWRcXFwiICYmIHR5cGVvZiBkID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl55WM6Z2iXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBkID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIueVjOmdolxcXCJdID0gdGhpcy5sYXlvdXQ7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIueVjOmdolxcXCJdID0gZDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gb2JqO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOWIm+W7uuWKqOaAgeWIhuexuyhydWxlT2JqKSB7XFxuICAgICAgICAgICAgbGV0IGl0ZW1zID0gW107XFxuICAgICAgICAgICAgbGV0IGNhdGVzID0gW107XFxuICAgICAgICAgICAgaWYgKHJ1bGVPYmogPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIHJ1bGVPYmogPSBbXTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy/liJ3lp4vljJblj5jph4/lvIDlp4tcXG4gICAgICAgICAgICBjb25zdCBwYXJhbSA9IHRoaXMuY2hlY2tQYXJhbSgpO1xcbiAgICAgICAgICAgIGNvbnN0IHBhZ2UgPSBwYXJhbS7pobXnoIE7XFxuICAgICAgICAgICAgY29uc3QgaHRtbCA9IHBhcmFtLua6kOeggTtcXG4gICAgICAgICAgICBjb25zdCBkID0gcGFyYW0u55WM6Z2iO1xcbiAgICAgICAgICAgIGNvbnN0IOeKtuaAgSA9IHRoaXMuc3RhdGU7XFxuICAgICAgICAgICAgY29uc3Qgc2VhcmNoID0gdGhpcy5zZWFyY2g7XFxuICAgICAgICAgICAgY29uc3QgZW1wdHkgPSBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgY29uc3Qg5oqY5Y+g54q25oCBID0gdGhpcy5vcGVuO1xcbiAgICAgICAgICAgIHZhciDlsZXlvIAgPSB0aGlzLuWxleW8gDtcXG4gICAgICAgICAgICB2YXIg5oqY5Y+gID0gdGhpcy7mipjlj6A7XFxuICAgICAgICAgICAgdmFyIOWFqOa4hSA9IHRoaXMuY2xlYXJhbGw7XFxuICAgICAgICAgICAgdmFyIOa4hemZpCA9IHRoaXMuY2xlYXJzO1xcbiAgICAgICAgICAgIC8v5Yid5aeL5YyW5Y+Y6YeP57uT5p2fXFxuICAgICAgICAgICAgbGV0IGluaXRfY2F0ZSA9IG5ldyBBcnJheSgyMCkuZmlsbChcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgIGNvbnN0IGZvbGQgPSBnZXRNeVZhcihNWV9SVUxFLmdyb3VwLCBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgIGNvbnN0IGNhdGVfdGVtcCA9IEpTT04ucGFyc2UoXFxuICAgICAgICAgICAgICAgIGdldE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShpbml0X2NhdGUpKVxcbiAgICAgICAgICAgICk7XFxuICAgICAgICAgICAgaWYgKHNlYXJjaCAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCInaGlrZXI6Ly9zZWFyY2g/cnVsZT1cXFwiICsgTVlfUlVMRS50aXRsZSArIFxcXCImcz0nK2lucHV0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLmkJzntKLlhbPplK7or41cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcImtleXdvcmRcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwia2V5d29yZFxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBjb25zdCBjYXRlZ29yaWVzID0gW107XFxuICAgICAgICAgICAgcnVsZU9iai5mb3JFYWNoKCh4KSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgIC8vbG9nKHgpXFxuICAgICAgICAgICAgICAgIGlmICh4Lmpzb24gIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgICAgICB4Lmpzb24ubWFwKGsgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaChKU09OLnN0cmluZ2lmeShrKS5yZXBsYWNlKC9eXFxcXFt8XFxcXF0kL2csICcnKSlcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAvL2NhdGVnb3JpZXMucHVzaCh4Lmpzb24pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHgu5LiA57qn5a6a5L2NKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoeC7kuIDnuqflrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShodG1sLCB4LuS4gOe6p+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIHgu5LiA57qn5a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoeC7lpKfnsbvlrprkvY0pIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh4LuWkp+exu+WumuS9jS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gdGhpcy5ldmFsSlNSdWxlKGh0bWwsIHgu5aSn57G75a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IFtwZGZhKGh0bWwsIHgu5aSn57G75a6a5L2NKS5qb2luKCdcXFxcbicpXTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvLy0t6aKd5aSW5aSE55CGLS1cXG4gICAgICAgICAgICAgICAgaWYgKCgn5aKe5YqgJyBpbiB4KSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHgu5aKe5YqgLmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHgu5aKe5YqgID0gZXZhbCh4LuWinuWKoCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBzbGlzdCA9IHgu5aKe5YqgLmNvbmNhdChzbGlzdCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCgn6KGl5YWFJyBpbiB4KSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHgu6KGl5YWFLmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHgu6KGl5YWFID0gZXZhbCh4LuihpeWFhSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBzbGlzdCA9IHNsaXN0LmNvbmNhdCh4LuihpeWFhSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy8tLemineWkluWkhOeQhi0tXFxuICAgICAgICAgICAgICAgIHZhciDkuIDnuqcgPSBsaXN0Lm1hcCgocykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgICAgICBpZiAoIShcXFwi5bCP57G7XFxcIiBpbiB4KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHgu5bCP57G7ID0gXFxcImJvZHkmJmE6bm90KDptYXRjaGVzKOmmlumhtSkpOm5vdChhOm5vdChbaHJlZl0pKVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAoeC7lsI/nsbsuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2xpc3QgPSB0aGlzLmV2YWxKU1J1bGUocywgeC7lsI/nsbspO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzbGlzdCA9IHBkZmEocywgeC7lsI/nsbspO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIOWumuS9jSA9IHNsaXN0Lm1hcCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IHNwKHRoaXMuZ2V0VGl0bGUoaXRlbSwgeC7moIfpopgpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgeCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9iaiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KG9iaik7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiDlrprkvY07XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAvL2xvZyjkuIDnuqcpXFxuICAgICAgICAgICAgICAgIC8vbG9nKOS4gOe6py5sZW5ndGgpXFxuICAgICAgICAgICAgICAgIGlmICjkuIDnuqcubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaCjkuIDnuqcuam9pbihcXFwiXFxcXG5cXFwiKSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICDkuIDnuqcuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaChpdGVtLmpvaW4oXFxcIixcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvL2xvZyhjYXRlZ29yaWVzKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGlmICjmipjlj6DnirbmgIEpIHtcXG4gICAgICAgICAgICAgICAgaWYgKHBhZ2UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGZvbGQgPT09IFxcXCIxXFxcIiA/IOaKmOWPoCA6IOWxleW8gCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0aXRsZSwgZm9sZCwgdSwgYWxsLCBleHBzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZm9sZCA9IGdldE15VmFyKE1ZX1JVTEUuZ3JvdXAsIGZvbGQpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFvlsZXlvIAsIOaKmOWPoF0gPSBleHBzO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvbGQgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjeCA9IGZpbmRJdGVtc0J5Q2xzKHRpdGxlICsgJ2NhdGVfYnV0dG9uJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2NhdGVfYnV0dG9uJywgY3gpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyh0aXRsZSArICdjYXRlX2J1dHRvbicpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3ggPSBzdG9yYWdlMC5nZXRNeVZhcignY2F0ZV9idXR0b24nLCBbXSkubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4Wydjb2xfdHlwZSddID0geFsnY29sX3R5cGUnXSA/IHhbJ2NvbF90eXBlJ10gOiB4Wyd0eXBlJ107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB4O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcih0aXRsZSArICdjYXRlX2xpbmUnLCBjeClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qYWxsLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOyovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHRpdGxlICsgJ2NhdGVfZXhwJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBmb2xkID09IDEgPyDlsZXlvIAgOiDmipjlj6AsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCA9PT0gXFxcIjFcXFwiID8gXFxcIjBcXFwiIDogXFxcIjFcXFwiKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVlfUlVMRS50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9sZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAg54q25oCBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICDlhajmuIUsIFvlsZXlvIAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDmipjlj6BcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9leHAnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IHRoaXMuYWN0aW9uKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGw6IOWFqOa4hSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsOiDmuIXpmaQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMuZm9yRWFjaCgoY2F0ZWdvcnksIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhjYXRlZ29yeSlcXG4gICAgICAgICAgICAgICAgICAgIGxldCBzdWJfY2F0ZWdvcmllcyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgLyppZiAo5bCP57G75a6a5L2NLmluY2x1ZGVzKFxcXCI7XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0uc3BsaXQoXFxcIjtcXFwiKVswXSk7XFxuICAgICAgICAgICAgICAgICAgICAgIGlmIChzdWJfY2F0ZWdvcmllcy5sZW5ndGggPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gcGRmYShjYXRlZ29yeSwg5bCP57G75a6a5L2NLnNwbGl0KFxcXCI7XFxcIilbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyovXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhpbmRleClcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gSlNPTi5wYXJzZShgWyR7Y2F0ZWdvcnl9XWApO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coc3ViX2NhdGVnb3JpZXMpXFxuICAgICAgICAgICAgICAgICAgICAvLyBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICAvL31cXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8v5aSn57G7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbGV0IHRpdGxlID0gcGRmaChpdGVtLCBf5aSn57G75qCH6aKYKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gc3AoaXRlbS50aXRsZSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOaOkumZpCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ld1JlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9ICcnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhcmFtcyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJzOiDmuIXpmaQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uOiBqc29uLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGU6IOeKtuaAgSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsbGNsZWFyczog5YWo5riFLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xldCB1cmwgPSBwZChpdGVtLCBf5aSn57G76ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKmlmICjlpKfnsbvlpITnkIYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSDkuIDnuqfliIbnsbvlpITnkIYodXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogc3AodGhpcy5zZXRUaXRsZShrZXkudG9TdHJpbmcoKSwgY2F0ZV90ZW1wW2luZGV4XSwgdGl0bGUpKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiZHRfXFxcIiArIHBhcmFtcy5qc29uLnR5cGUsIHBhcmFtcy5qc29uLnZhbHVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5zdGF0ZSwgcGFyYW1zLmpzb24pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9saW5lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL+Wwj+exu1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmFwb3MgPSBmYWxzZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAoaXRlbS5pbmNsdWRlcygndHlwZT1cXFwiQGV4dHJhXFxcIicpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFwb3MgPSB0cnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKCfpmYTliqDlrprkvY0nKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4dHJhcG9zKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBzcChwZGZoKGl0ZW0sIFxcXCJhJiZUZXh0XFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcInVuZGVmaW5lZFxcXCIgJiYg5o6S6ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIFxcXCJhJiZzdGF0ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIFxcXCJhJiZ2YWx1ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOaOkumZpCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXcgUmVnRXhwKOaOkumZpCwgXFxcImdcXFwiKSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGpzb24gPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qc3dpdGNoICh0cnVlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Ug5YiG57G76ZO+5o6lLmluY2x1ZGVzKFxcXCJAQEBcXFwiKTpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAQFxcXCIpWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBAXFxcIilbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Ug5YiG57G76ZO+5o6lLmluY2x1ZGVzKFxcXCJAQFxcXCIpOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAXFxcIilbMF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAXFxcIilbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGpzb24gPSBwZChpdGVtLCDliIbnsbvpk77mjqUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKnZhciBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEBAJyk/e1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVswXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOuWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVswXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAJylbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTsqL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eVxcXCIgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5qc29uLmNvbnN0cnVjdG9yID09PSBPYmplY3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkdF9cXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhbXMuanNvbik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoZm9sZCA9PT0gXFxcIjFcXFwiIHx8IOaKmOWPoOeKtuaAgSA9PSBmYWxzZSkge1xcbiAgICAgICAgICAgICAgICBpdGVtcyA9IGl0ZW1zLmNvbmNhdChjYXRlcyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChmb2xkID09PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2NhdGVfYnV0dG9uJywgY2F0ZXMpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygc2V0UHJlUmVzdWx0ICE9ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zID0gZC5jb25jYXQoaXRlbXMpO1xcbiAgICAgICAgICAgICAgICAvL+a4heepuue7p+aJv+aVsOe7hFxcbiAgICAgICAgICAgICAgICBkLmxlbmd0aCA9IDA7XFxuICAgICAgICAgICAgICAgIHNldFByZVJlc3VsdChpdGVtcyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaXRlbXMuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaChpdGVtKTtcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcbiAgICB9O1xcbiAgICBvYmou6aKE6K6+KG9wdGlvbnMpO1xcbiAgICByZXR1cm4gb2JqO1xcbn1cXG5cXG52YXIg54q25oCBID1cXG4gICAgdHlwZW9mIOeKtuaAgeagh+iusCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDnirbmgIHmoIforrAgIT0gXFxcIlxcXCIgPyDnirbmgIHmoIforrAgOiBNWV9SVUxFLnVybDtcXG5cXG5sZXQgZHRfZGVidWcgPSBmYWxzZTtcXG5cXG5hZGRMaXN0ZW5lcihcXG4gICAgXFxcIm9uQ2xvc2VcXFwiLFxcbiAgICAkLnRvU3RyaW5nKCgpID0+IHt9KVxcbik7XFxuXFxudmFyIENyZWF0ZSA9IHtcXG4gICAgbmV4dFBhZ2U6IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgdmFyIHJlc3VsdCA9IGZhbHNlO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICB2YXIgbmV4dCA9IGV2YWwo5LiL5LiA6aG1KTtcXG4gICAgICAgICAgICAvL2xvZygnbjonK25leHQpXFxuICAgICAgICAgICAgaWYgKG5leHQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCfkuIvkuIDpobXpk77mjqXkuLrnqbonKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXN1bHQgPSB0cnVlO1xcbiAgICAgICAgICAgIGlmICh0cnVlX3VybCA9PSBuZXh0KSB7XFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAvL2xvZyhcXFwi5Y+v6IO95LiN5a2Y5Zyo5LiL5LiA6aG15oiW6ICF5LiL5LiA6aG15a6a5L2N5pyJ6Zeu6aKYXFxcIik7XFxuICAgICAgICAgICAgbG9nKFxcXCLplJnor6/kv6Hmga86XFxcIiArIGUubWVzc2FnZSk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoKG5leHQgPT0gXFxcIlxcXCIgfHwgbmV4dCA9PSB1bmRlZmluZWQpICYmIHBhZ2UgPT0gMSkge1xcbiAgICAgICAgICAgIG5leHQgPSB0cnVlX3VybDtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgLy9yZXN1bHQ9ZmFsc2U7XFxuICAgICAgICAgICAgbmV4dCA9IGdldE15VmFyKOeKtuaAgSk7XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZygnbCcrdHJ1ZV91cmwpXFxuICAgICAgICAvL2xvZygnbicrbmV4dClcXG4gICAgICAgIGlmIChwYWdlICE9IDEpIHtcXG4gICAgICAgICAgICBpZiAodHJ1ZV91cmwgPT0gbmV4dCAmJiAhcmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IHRydWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcXG4gICAgICAgIC8vcHV0TXlWYXIo54q25oCBLCBuZXh0KTtcXG4gICAgfSxcXG4gICAgZ2V0QmFja0ltYWdlOiBmdW5jdGlvbihpbWd1cmwpIHtcXG4gICAgICAgIHZhciByZXN1bHQgPSBpbWd1cmw7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHJlc3VsdCA9IC91cmwoPzpcXFxccyspP1xcXFwoKC4qPylcXFxcKS9nXFxuICAgICAgICAgICAgICAgIC5leGVjKGltZ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ICAgICAgICBpZiAoIWltZy5zdGFydHNXaXRoKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgaW1nID0gcGQoaXRlbSwgcnVsZS5pbWcpO1xcbiAgICAgICAgICAgICAgICBpbWcgPSB0aGlzLmh0dHBIYW5kbGUoaW1nKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gaW1nICsgcnVsZS5yZWY7XFxuICAgIH0sXFxuICAgIHVybEhhbmRsZTogZnVuY3Rpb24oaXRlbSwgcnVsZSkge1xcbiAgICAgICAgdmFyIGhyZWYgPSBcXFwiXFxcIjtcXG4gICAgICAgIGlmIChydWxlLnVybC5zdGFydHNXaXRoKFxcXCJwZFxcXCIpKSB7XFxuICAgICAgICAgICAgaHJlZiA9IGV2YWwocnVsZS51cmwpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBocmVmID0gcGQoaXRlbSwgcnVsZS51cmwpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaHJlZiA9IHJ1bGUuaW10ID8gaHJlZiArIFxcXCIjaW1tZXJzaXZlVGhlbWUjI2F1dG9DYWNoZSNcXFwiIDogaHJlZjtcXG4gICAgICAgIHJldHVybiBocmVmO1xcbiAgICB9LFxcbiAgICBzZXRDb250ZW50OiBmdW5jdGlvbihpdGVtLCBpbnB1dCkge1xcbiAgICAgICAgbGV0IG91dHB1dCA9IFxcXCJcXFwiO1xcbiAgICAgICAgaWYgKGlucHV0ID09IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgIHJldHVybiBvdXRwdXQ7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFwicGRcXFwiKSkge1xcbiAgICAgICAgICAgIG91dHB1dCA9IGV2YWwoaW5wdXQpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBvdXRwdXQgPSBwZGZoKGl0ZW0sIGlucHV0KTtcXG4gICAgICAg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0bGV9ICAtLS0+IOe7k+aenDogICR7b2JqLnRpdGxlfWAgK1xcbiAgICAgICAgICAgIGBcXFxcblxcXFx0ZGVzY+WumuS9jTogICR7cnVsZS5kZXNjfSAgLS0tPiDnu5Pmnpw6ICAke29iai5kZXNjfWAgK1xcbiAgICAgICAgICAgIGBcXFxcblxcXFx0aW1n5a6a5L2NOiAgJHtydWxlLmltZ30gIC0tLT4g57uT5p6cOiAgJHtvYmouaW1nfWAgK1xcbiAgICAgICAgICAgIChydWxlLmNvbnRlbnQgIT0gdW5kZWZpbmVkID8gYFxcXFxuXFxcXHRjb250ZW505a6a5L2NOiAgJHtydWxlLmNvbnRlbnR9ICAtLS0+IOe7k+aenDogICR7b2JqLmNvbnRlbnR9YCA6ICcnKSArXFxuICAgICAgICAgICAgYFxcXFxuXFxcXHR1cmzlrprkvY06ICAke3J1bGUudXJsfSAgLS0tPiDnu5Pmnpw6ICAke29iai51cmx9YFxcbiAgICAgICAgKTtcXG4gICAgICAgIGxvZygnLS0tLS0tLS0tLScgKyAoaSArIDEpICsgJzrosIPor5Xnu5PmnZ8tLS0tLS0tLS0tJyk7XFxuICAgIH0sXFxuICAgIGpzb25MaXN0OiBmdW5jdGlvbihhcnIsIGpzb24sIHJ1bGUpIHtcXG4gICAgICAgIGlmIChqc29uLmNvbnN0cnVjdG9yICE9IE9iamVjdCkge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGpzb24gPSBKU09OLnBhcnNlKGpzb24pO1xcbiAgICAgICAgICAgIH0gY2F0Y2gge31cXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChqc29uW3J1bGUubGlzdF0gPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgYXJyLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48c21hbGw+5peg5YaF5a65PC9zbWFsbD48L2ZvbnQ+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7fSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgZGVidWcgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmRlYnVnLCBmYWxzZSk7XFxuICAgICAgICB2YXIgZW1wdHkgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmVtcHR5KTtcXG4gICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgIGxvZygn5a6a5L2N5YiX6KGoOicgKyBydWxlLmxpc3QpO1xcbiAgICAgICAgfVxcbiAgICAgICAganNvbltydWxlLmxpc3RdLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSBzcChldmFsKHJ1bGUudGl0bGUpKTtcXG4gICAgICAgICAgICB2YXIgZGVzYyA9IHNwKGV2YWwocnVsZS5kZXNjKSk7XFxuICAgICAgICAgICAgdmFyIGNvbnRlbnQgPSBzcChldmFsKHJ1bGUuY29udGVudCkpO1xcbiAgICAgICAgICAgIHZhciBpbWcgPSBldmFsKHJ1bGUuaW1nKSArIHJ1bGUucmVmO1xcbiAgICAgICAgICAgIHZhciBocmVmID0gZXZhbChydWxlLnVybCk7XFxuICAgICAgICAgICAgdmFyIHVybCA9IHJ1bGUuaW10ID8gaHJlZiArIFxcXCIjaW1tZXJzaXZlVGhlbWUjI2F1dG9DYWNoZSNcXFwiIDogaHJlZjtcXG4gICAgICAgICAgICB2YXIgbGF6eSA9IHJ1bGUubGF6eSA/IHJ1bGUubGF6eSA6IFxcXCJcXFwiO1xcblxcbiAgICAgICAgICAgIHZhciBkZCA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBjb250ZW50LFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxuICAgICAgICAgICAgICAgIHVybDogKGVtcHR5ID8gXFxcImhpa2VyOi8vZW1wdHkjI1xcXCIgOiAnJykgKyB1cmwsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICBpZiAoZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHJ4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgIHVybFxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB0aGlzLmRlYnVnbG9nKGksIGl0ZW0sIHJ1bGUsIHJ4KTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgaWYgKGxhenkgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgZGRbXFxcInVybFxcXCJdID0gaHJlZiArIGxhenk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGFyci5wdXNoKGRkKTtcXG4gICAgICAgIH0pO1xcbiAgICB9LFxcbiAgICBydWxlTGlzdDogZnVuY3Rpb24oYXJyLCBodG1sLCBydWxlKSB7XFxuICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCxcXG4gICAgICAgICAgICBydWxlLmxpc3QpO1xcbiAgICAgICAgdmFyIGRlYnVnID0gdGhpcy5nZXRCb29sZWFuVmFsdWUocnVsZS5kZWJ1ZyxcXG4gICAgICAgICAgICBmYWxzZSk7XFxuICAgICAgICB2YXIgZW1wdHkgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmVtcHR5KTtcXG4gICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgIGxvZygn5a6a5L2N5YiX6KGoOicgKyBydWxlLmxpc3QpO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGlzdC5mb3JFYWNoKChpdGVtLCBpKSA9PiB7XFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gc3AodGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUudGl0bGUpKTtcXG4gICAgICAgICAgICB2YXIgZGVzYyA9IHNwKHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmRlc2MpKTtcXG4gICAgICAgICAgICB2YXIgaW1nID0gdGhpcy5pbWdIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICAgICAgdmFyIHVybCA9IHRoaXMudXJsSGFuZGxlKGl0ZW0sIHJ1bGUpO1xcbiAgICAgICAgICAgIHZhciBjb250ZW50ID0gc3AodGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUuY29udGVudCkpO1xcblxcbiAgICAgICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgICAgICB2YXIgcnggPSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICBpbWcsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgdXJsXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHRoaXMuZGVidWdsb2coaSwgaXRlbSwgcnVsZSwgcngpO1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICB2YXIgbGF6eSA9IHJ1bGUubGF6eSA/IHJ1bGUubGF6eSA6IFxcXCJcXFwiO1xcbiAgICAgICAgICAgIHZhciBkZCA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxuICAgICAgICAgICAgICAgIHVybDogKGVtcHR5ID8gXFxcImhpa2VyOi8vZW1wdHkjI1xcXCIgOiAnJykgKyB1cmwsXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZiAobGF6eSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICBkZFtcXFwidXJsXFxcIl0gPSB1cmwgKyBsYXp5O1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhcnIucHVzaChkZCk7XFxuICAgICAgICB9KTtcXG4gICAgfSxcXG4gICAgTGlzdDogZnVuY3Rpb24oYXJyLCBodG1sLCBydWxlLCBwYXJhbSkge1xcbiAgICAgICAgcGFyYW0gPSBwYXJhbSA/IHBhcmFtIDoge307XFxuICAgICAgICB2YXIgYXV0byA9IHBhcmFtLmF1dG8gPyBwYXJhbS5hdXRvIDogZmFsc2U7XFxuICAgICAgICB2YXIgc2hvdyA9IHBhcmFtLnNob3cgPyBwYXJhbS5zaG93IDogZmFsc2U7XFxuICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgLy90aGlzLnNwYWdlLnNldCh0cnVlX3VybCk7XFxuICAgICAgICB9XFxuICAgICAgICB0aGlzLnJlZnJlc2goKTtcXG4gICAgICAgIHZhciBkZWJ1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AgICB2YXIgY29udGVudCA9IHNwKHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmNvbnRlbnQpKTtcXG5cXG4gICAgICAgICAgICAgICAgaWYgKGRlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnggPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRlYnVnbG9nKGksIGl0ZW0sIHJ1bGUsIHJ4KTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICBpZiAoaSA9PSBsaXN0Lmxlbmd0aCAtIDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gXFxcImxhc3RpZF9cXFwiICsgcGFnZTtcXG4gICAgICAgICAgICAgICAgICAgIGNscyA9IFxcXCJsYXN0bWFya1xcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IChlbXB0eSA/IFxcXCJoaWtlcjovL2VtcHR5IyNcXFwiIDogJycpICsgdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBjbHMsXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxICYmIHNob3cpIHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcInBhZ2VsaW5lXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHNtYWxsPuWKoOi9veS4rS4uLjwvc21hbGw+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwicGFnZW51bVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcInBhZ2VudW1cXFwiLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPjxzbWFsbD7liLDlupXkuoY8L3NtYWxsPjwvZm9udD4nLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBcXFwibGFzdFxcXCIsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAobGlzdC5sZW5ndGggPT0gMCAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVcXFwiLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPjxzbWFsbD7ml6DlhoXlrrk8L3NtYWxsPjwvZm9udD4nLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHt9LFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHRoaXMubmV4dFBhZ2UoKSkge1xcbiAgICAgICAgICAgIC8vbG9nKCd0Jyk7XFxuICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ3lpX2lzbmV4dCcsICd0Jyk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIC8vbG9nKCdmJyk7XFxuICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ3lpX2lzbmV4dCcsICdmJyk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoYXV0bykge1xcbiAgICAgICAgICAgIC8vY3JlYXRlTmV4dFBhZ2UoKTtcXG4gICAgICAgICAgICBhdXRvUGFnZSgpO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbn07XFxuXFxudmFyIGV4dE1ldGhvZCA9IHtcXG4gICAgVG9QYXJhbXM6IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgdmFyIGpzb24gPSBhcmd1bWVudHNbMF07XFxuICAgICAgICByZXR1cm4gT2JqZWN0LmtleXMoanNvbilcXG4gICAgICAgICAgICAubWFwKChrZXkpID0+IGtleSArIFxcXCI9XFxcIiArIGpzb25ba2V5XSlcXG4gICAgICAgICAgICAuam9pbihcXFwiJlxcXCIpO1xcbiAgICB9LFxcbiAgICB1cmxQYXJzZTogZnVuY3Rpb24odSkge1xcbiAgICAgICAgdmFyIGRpY3QgPSB7fTtcXG4gICAgICAgIGRpY3QuU291cmNlID0gdTtcXG4gICAgICAgIGxldCBwYXJhbXMgPSAodXJsKSA9PiB7XFxuICAgICAgICAgICAgbGV0IHF1ZXJ5UGFyYW1zID0ge307XFxuICAgICAgICAgICAgbGV0IHJlZyA9IC8oW14/PSZdKyk9KFtePz0mXSspL2c7XFxuICAgICAgICAgICAgdXJsLnJlcGxhY2UocmVnLCBmdW5jdGlvbigpIHtcXG4gICAgICAgICAgICAgICAgcXVlcnlQYXJhbXNbYXJndW1lbnRzWzFdXSA9IGFyZ3VtZW50c1syXTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm4gcXVlcnlQYXJhbXM7XFxuICAgICAgICB9O1xcbiAgICAgICAgdmFyIGphdmFVcmwgPSBKYXZhSW1wb3J0ZXIoamF2YS5uZXQuVVJMKTtcXG4gICAgICAgIHdpdGgoamF2YVVybCkge1xcbiAgICAgICAgICAgIHZhciB1cmwgPSBuZXc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gPCBzdHIyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgaWYgKHN0cjFbaV0gIT09IHN0cjJbaV0pIHtcXG4gICAgICAgICAgICAgICAgZGlmZkNoYXJzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGksXFxuICAgICAgICAgICAgICAgICAgICBzMTogc3RyMVtpXSxcXG4gICAgICAgICAgICAgICAgICAgIHMyOiBzdHIyW2ldLFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gZGlmZkNoYXJzO1xcbiAgICB9LFxcbiAgICByZXBsYWNlQ2hhckF0OiBmdW5jdGlvbihzdHIsIGluZGV4LCByZXBsYWNlbWVudCkge1xcbiAgICAgICAgaWYgKGluZGV4IDwgMCB8fCBpbmRleCA+PSBzdHIubGVuZ3RoKSB7XFxuICAgICAgICAgICAgcmV0dXJuIHN0cjtcXG4gICAgICAgIH1cXG4gICAgICAgIC8vbG9nKGluZGV4KVxcbiAgICAgICAgY29uc3QgYXJyID0gc3RyLnNwbGl0KFxcXCJcXFwiKTtcXG4gICAgICAgIGFycltpbmRleF0gPSByZXBsYWNlbWVudDtcXG4gICAgICAgIHJldHVybiBhcnIuam9pbihcXFwiXFxcIik7XFxuICAgIH0sXFxuICAgIGdldE9iamVjdEtleXNEaWZmOiBmdW5jdGlvbihvYmoxLCBvYmoyKSB7XFxuICAgICAgICBjb25zdCBkaWZmZXJlbnRLZXlzID0gW107XFxuICAgICAgICBmb3IgKGxldCBrZXkgaW4gb2JqMSkge1xcbiAgICAgICAgICAgIGlmICghb2JqMi5oYXNPd25Qcm9wZXJ0eShrZXkpIHx8IG9iajFba2V5XSAhPT0gb2JqMltrZXldKSB7XFxuICAgICAgICAgICAgICAgIGRpZmZlcmVudEtleXMucHVzaChrZXkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGtleSBp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dTIuUGFyYW1zKSkge1xcbiAgICAgICAgICAgICAgICBpZiAoZHRfZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh1MS5QYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh1Mi5QYXRoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgZGYgPSB0aGlzLmZpbmREaWZmZXJlbnRJbmRleChTdHJpbmcodTEuUGF0aCksIFN0cmluZyh1Mi5QYXRoKSk7XFxuICAgICAgICAgICAgICAgIGlmIChkdF9kZWJ1Zykge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKGRmKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoZGYubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZSA9IGRmWzBdLmluZGV4O1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGYgPSBkZi5maWx0ZXIoKHgpID0+IC9cXFxcZCsvLnRlc3QoeC5zMikpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlID0gZlswXS5pbmRleDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgZXEgPSB0aGlzLnJlcGxhY2VDaGFyQXQoU3RyaW5nKHUyLlBhdGgpLCByZSwgXFxcImZ5cGFnZVxcXCIpO1xcbiAgICAgICAgICAgICAgICBuZXh0dXJsID0gdTIuSG9zdHMgKyBlcSArIGNhICsgdGhpcy5Ub1BhcmFtcyh1Mi5QYXJhbXMpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciBlcCA9IHRoaXMuZ2V0T2JqZWN0S2V5c0RpZmYodTEuUGFyYW1zLCB1Mi5QYXJhbXMpXFxuICAgICAgICAgICAgICAgIGlmIChlcC5sZW5ndGggPT0gMSkge1xcbiAgICAgICAgICAg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gICAgICBjb25zdCBoaWtlclBvcCA9IHJlcXVpcmUoXFxcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS93ZWlzeXIvanMvaGlrZXJQb3AuanNcXFwiKTtcXG4gICAgICBsZXQg5qCH562+ID0gYXV0aG9yLm1hcCh4ID0+IHtcXG4gICAgICAgICAgbGV0IHRpdGxlID0gcGRmaCh4LCdhJiZUZXh0Jyk7XFxuICAgICAgICAgICAgICByZXR1cm4geyAgICAgICAgXFxuICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsICAgICAgICBcXG4gICAgICAgICAgICAgIGljb246IGdldFZhcignbGluaycpK1xcXCIvdGVtcGxhdGVzL2Zyb250ZW5kL2FpcmF2L2ltZy9hcHBfbGluazMucG5nP3Y9M1xcXCIsICAgICAgICBcXG4gICAgICAgICAgICAgIHVybDogdGl0bGUsICAgIH19KTsgICAgICAgICAgIGhpa2VyUG9wLnNlbGVjdENlbnRlckljb24oe1xcbiAgICAgICAgICAgICAgaWNvbkxpc3Q6IOagh+etviwgICAgICAgICAgICBcXG4gICAgICAgICAgICAgIHRpdGxlOiBcXFwi5bCP8J+mjOaAoeaDhVxcXCIsICAgICAgICAgICAgXFxuICAgICAgICAgICAgICBjb2x1bW5zOiAyLCAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgY2xpY2soYSkgeyAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3NlYXJjaD90aXRsZT1cXFwiK2ErXFxcIiZwYWdlPWZ5cGFnZSNmdWxsVGhlbWUjI25vSGlzdG9yeSNcXFwiOyAgICAgICAgICAgIH0gICAgICAgIH0pOyAgICAgICAgXFxuICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiOyAgICB9LGF1dGhvciksXFxuY29sX3R5cGU6IFxcXCJ0ZXh0XzRcXFwiLFxcbn0se1xcbnRpdGxlOiBcXFwi5qCH562+8J+Pt++4j1xcXCIsXFxudXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCh0YWcpID0+IHtcXG4gICAgICBjb25zdCBoaWtlclBvcCA9IHJlcXVpcmUoXFxcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS93ZWlzeXIvanMvaGlrZXJQb3AuanNcXFwiKTtcXG4gICAgICBsZXQg5qCH562+ID0gdGFnLm1hcCh4ID0+IHtcXG4gICAgICAgICAgbGV0IHRpdGxlID0gcGRmaCh4LCdhJiZUZXh0Jyk7XFxuICAgICAgICAgIGxldCB1cmwgPSBwZCh4LCdhJiZocmVmJykrXFxcIiZtYWluX3RhZz0wJm89bXYmdD1hJnBhZ2U9XFxcIjtcXG4gICAgICAgICAgICAgIHJldHVybiB7ICAgICAgICBcXG4gICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSwgICAgICAgIFxcbiAgICAgICAgICAgICAgaWNvbjogZ2V0VmFyKCdsaW5rJykrXFxcIi90ZW1wbGF0ZXMvZnJvbnRlbmQvYWlyYXYvaW1nL3BoaWNvbi9saWJyYXJ5LnBuZ1xcXCIsICAgICAgICBcXG4gICAgICAgICAgICAgIHVybDogdGl0bGUsICAgIH19KTsgICAgICAgICAgIGhpa2VyUG9wLnNlbGVjdENlbnRlckljb24oe1xcbiAgICAgICAgICAgICAgaWNvbkxpc3Q6IOagh+etviwgICAgICAgICAgICBcXG4gICAgICAgICAgICAgIHRpdGxlOiBcXFwi5aSn8J+mjOS8pOi6q1xcXCIsICAgICAgICAgICAgXFxuICAgICAgICAgICAgICBjb2x1bW5zOiAyLCAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgY2xpY2soYSkgeyAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3NlYXJjaD90aXRsZT1cXFwiK2ErXFxcIiZwYWdlPWZ5cGFnZSNmdWxsVGhlbWUjI25vSGlzdG9yeSNcXFwiOyAgICAgICAgICAgIH0gICAg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FxcXCIwXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNoc29ydFxcXCIsIFxcXCIxXFxcIilcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouaOkuW6j+aIkOWKnydcXG4gICAgICAgIH0pLFxcbiAgICAgICBwaWNfdXJsOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS85LnN2ZycsXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbidcXG4gICAgfSk7XFxuXFxuXFxuICBpZiAoY29udHMubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi54K55Ye755u05o6l6ZiF6K+7XFxcIixcXG4gICAgICAgICAgICB1cmw6IHVybCArIGxhenlCam0sXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+S4jeino+WvhicsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCwgbGF6eUJqbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgbGF6eUJqbVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCwgbGF6eUJqbSlcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfop6Plr4YnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwsIGxhenlKbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgbGF6eUptXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsLCBsYXp5Sm0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIF1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGNoYXB0ZXJMaXN0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBkZXNfdGl0bGUsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaHR0cHM6Ly9qbWNvbWljLm1lL3Bob3RvL1xcXCIgKyBNWV9VUkwuc3BsaXQoXFxcIlxcXFwvXFxcIilbNF1cXG4gICAgICAgIH0pO1xcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgbGV0IGxpc3QgPSBjb250cy5tYXAodiA9PiB7XFxuICAgICAgICAgICAgbGV0IHRpdGxlID0gc3AocGRmaCh2LCAnYSYmVGV4dCcpKSxcXG4gICAgICAgICAgICAgICAgdXJsID0gcGQodiwgJ2EmJmhyZWYnKTtcXG4gICAgICAgICAgICBjaGFwdGVyTGlzdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwgKyBsYXp5Sm0sXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfkuI3op6Plr4YnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodXJsLCBsYXp5QmptKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgbGF6eUJqbVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwsIGxhenlCam0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn6Kej5a+GJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCwgbGF6eUptKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgbGF6eUptXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCwgbGF6eUptKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIF1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgaWYgKGdldE15VmFyKCdzaHNvcnQnKSA9PT0gJzEnKSB7XFxuICAgICAgICAgICAgbGlzdC5yZXZlcnNlKCk7XFxuICAgICAgICB9XFxuXFxuICAgICAgICBkID0gZC5jb25jYXQobGlzdCk7XFxuICAgIH1cXG4gICAgdmFyIHJlY29tbWVuZCA9IHBkZmEoaHRtbCxcXFwiI3JlbGF0ZWRfY29taWNzJiYucm93OmhhcyhoNClcXFwiKVxcbiAgICByZWNvbW1lbmQuZm9yRWFjaCgoZGF0YSkgPT4ge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogcGRmaChkYXRhLFxcXCJoNCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcbiAgICAgICAgICAgIFxcbiAgICAgICAgfSlcX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gICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibW92aWVfM1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiB0aXRsZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KVxcclxcblxcbn0gY2F0Y2ggKGUpIHtcXG4gICAgbG9nKGUudG9TdHJpbmcoKSk7XFxufVxcblxcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuavj+WRqOW/heeci1wiLFwicGF0aFwiOlwiYmtcIixcInJ1bGVcIjpcImpzOlxcbnZhciBkID0gW107XFxucmMoZmV0Y2hQQygnaHR0cHM6Ly9naXRlZS5jb20vbWlzdHl3YXRlci9oaWtlcl9pbmZvL3Jhdy9tYXN0ZXIvZ2l0aHVicHJveHkuanNvbicpICsgJ2h0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taXN0eXdhdGVyL2hpa2VyL21haW4vZicsIDI0KTtcXG5ldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS95alxcXCIsIHt9KSkucnVsZSk7XFxuY29uc3QgcGFnZSA9IE1ZX1BBR0U7XFxuY29uc3QgaG9zdCA9IGdldFZhcignbGluaycpK1xcXCIvd2Vlaz9za2RhZD0xXFxcIjtcXG52YXIg5a6a5L2N5L+h5oGvID0gW3tcXG4gICAg5aSn57G75a6a5L2NOiAnYm9keSYmLndlZWstdGltZS1pdGVtJyxc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ImVqXFxcIiknLFxcclxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycsXFxyXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogcGQoaXRlbSwgJ2ltZyYmZGF0YS1jZnNyY3x8c3JjfHxkYXRhLXNyYycpLFxcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9KTtcXHJcXG4gICAgICAgICAgICB9KTtcXHJcXG4gICAgICAgIFxcclxcbiAgICAgIHNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaOqOiNkFwiLFwicGF0aFwiOlwicmVjb21tZW5kXCIsXCJydWxlXCI6XCJqczpcXG52YXIgZCA9IFtdO1xcbnJjKGZldGNoUEMoJ2h0dHBzOi8vZ2l0ZWUuY29tL21pc3R5d2F0ZXIvaGlrZXJfaW5mby9yYXcvbWFzdGVyL2dpdGh1YnByb3h5Lmpzb24nKSArICdodHRwczovL3Jhdy5naXRodWJ1c2VyY29udGVudC5jb20vbWlzdHl3YXRlci9oaWtlci9tYWluL2YnLCAyNCk7XFxudmFyIGh0bWwgPSBnZXRSZXNDb2RlKCk7XFxuY29uc3QgcGFnZSA9IE1ZX1BBR0U7XFxudmFyIGxpc3QgPSBwZGZhKGh0bWwsICdib2R5JiYuY29sLXhsLTInKTtcXG5mb3IgKHZhciBqIGluIGxpc3QpIHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBzcChwZGZoKGxpc3Rbal0sICcudmlkZW8tdGl0bGUmJlRleHQnKSksXFxuICAgICAgICBkZXNjOiBzcChwZGZoKGxpc3Rbal0sICdzcGFuJiZUZXh0JykrJ1xcXFx0XFxcXHQnK3BkZmgobGlz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BpY191cmw6IEljb24rTGFiX2ljb25baWRdLFxcbiAgICAgICAgICAgICAgICB1cmw6IGxpbmsrcGRmaChkYXRhLCdhJiZocmVmJykrICcmcGFnZT1meXBhZ2VAcnVsZT1qczokLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9yZWNvbW1lbmRcXFwiKScsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXHJcXG4gICAgICAgICAgICB9KTtcXG59KSAgICAgICAgICAgIFxcclxcbiAgICAgICAgICAgIHZhciBpdGVtID0gcGRmYShkYXRhLCAnLnJvdyYmLnAtYi0xNSwwOjknKTtcXHJcXG4gICAgICAgICAgICBpdGVtLmZvckVhY2goKGRhdGFzKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogc3AocGRmaChkYXRhcywgJ2ltZyYmYWx0JykpLFxcbiAgICAgICAgZGVzYzogc3AocGRmaChkYXRhcywgJ3NwYW4mJlRleHQnKSsnXFxcXHRcXFxcdCcrcGRmaChkYXRhcywgJy5sYWJlbC1jYXRlZ29yeSYmVGV4dCcpKSxcXG4gICAgICAgIGltZzogcGRmaChkYXRhcywgJ2ltZyYmZGF0YS1zcmN8fGRhdGEtb3JpZ2luYWwnKSxcXG4gICAgICAgIHVybDogbGluaytwZGZoKGRhdGFzLCAnYSYmaHJlZicpKycjaW1tZXJzaXZlVGhlbWUjI2F1dG9DYWNoZSNAcnVsZT1qczokLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9lalxcXCIpJyxcXG4gICAgICAgY29sX3R5cGU6IFxcXCJtb3ZpZV8zXFxcIixcXG4gICAgfSk7XFxufSlcXG59KVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIue9kemhteeZu+W9lVwiLFwicGF0aFwiOlwiWDVcIixcInJ1bGVcIjpcInZhciBodG1sID0gcmVxdWVzdChzdXJsLHtcXG4gICAgaGVhZGVyczogaGVhZGVyc1xcbn0pXFxuaWYoaHRtbC5pbmNsdWRlcyhcXFwi55m75Ye6XFxcIikpe1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxiaWc+PGZvbnQgY29sb3I9I0ZGMDBGRj7otKblj7flt7LnmbvlvZU8L2ZvbnQ+PC9iaWc+JyxcXG4gICAgICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdJyArICfliLfmlrDpobXpnaLlhoXlrrknLmZvbnRjb2xvcignI0ZGMDBGRicpLmJpZygpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICB9KTtcXG4gICAgfWVsc2V7XFxuXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyAn54K55Ye755m75b2V6LSm5Y+3Jy5mb250Y29sb3IoJyNGRjAwRkYnKS5iaWcoKSxcXG4gICAgICAgIHVybDogc3VybCArICQoJycpLnJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIHZhciBkID0gW107XFxuICAgICAgICAgICAgbG9nKGZldGNoQ29va2llKE1ZX1VSTCkpXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZScsXFxuICAgICAgICAgICAgICAgIHVybDogTVlfVVJMLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAnbGlzdCYmc2NyZWVuJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIk1vemlsbGEvNS4wIChMaW51eDsgQW5kcm9pZCAxMjsgU00tRzk3NTAgQnVpbGQvU1AxQS4yMTA4MTIuMDE2OyB3dikgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgVmVyc2lvbi80LjAgQ2hyb21lLzg5LjAuNDM4OS43MiBNUVFCcm93c2VyLzYuMiBUQlMvMDQ2Mjc5IE1vYmlsZSBTYWZhcmkvNTM3LjM2XFxcIiwvL1BDX1VBLCAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICAgIHNob3dQcm9ncmVzczogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrKCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY28gPSBmYmEuZ2V0Q29va2llKHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY28uaW5jbHVkZXMoJ3JlbWVtYmVyPScpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEucGFyc2VMYXp5UnVsZSgkJCQoKS5sYXp5UnVsZSgoY28pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvY2FjaGUvSk1fY29va2llLnR4dCcsIGNvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn6LSm5Y+35bey55m75b2VJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjayh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGNvKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGNoZWNrLCA1MDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgIC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