Advertisement
xiaomianao666

邀您一起看:帮助

Jun 9th, 2024
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥帮助@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmLkZpbGXlt6XlhbdcIixcInBhdGhcIjpcIkZpbGUuanNcIixcInJ1bGVcIjpcImNvbnN0IEZpbGUgPSBqYXZhLmlvLkZpbGU7XFxuY29uc3Qge1xcbiAgICBGaWxlcyxcXG4gICAgUGF0aHMsXFxuICAgIFN0YW5kYXJkQ29weU9wdGlvbixcXG4gICAgU3RhbmRhcmRPcGVuT3B0aW9uXFxufSA9IGphdmEubmlvLmZpbGU7XFxuY29uc3QgamF2YVN0cmluZyA9IGphdmEubGFuZy5TdHJpbmc7XFxubGV0IGphdmFTY29wZSA9IG5ldyBKYXZhSW1wb3J0ZXIoamF2YS5pbywgamF2YS5sYW5nLCBqYXZhLmxhbmcucmVmbGVjdCwgamF2YS51dGlsLlZlY3Rvcik7XFxuXFxuZnVuY3Rpb24gZGVsZXRlRmlsZXMoZmlsZU5hbWUpIHtcXG4gICAgbGV0IGZpbGUgPSBuZXcgRmlsZShmaWxlTmFtZSk7XFxuICAgIGlmICghZmlsZS5leGlzdHMoKSk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RfMlxcXCJcXG4gICAgfSk7XFxuXFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBbXFxcIlvlj5bmtojkuIvovb1dXFxcIiwgXFxcIlvmraPlnKjlgZzmraIuLi5dXFxcIiwgXFxcIlvov5Tlm55dXFxcIiwgXFxcIlvlpITnkIblpLHotKVdXFxcIiwgXFxcIlvph43mlrDlvIDlp4tdXFxcIl1bc3RhdHVzXSxcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoTVlfSUQpID0+IHtcXG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gZ2V0TXlWYXIoTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCIwXFxcIik7XFxuICAgICAgICAgICAgaWYgKHN0YXR1cyA9PT0gXFxcIjBcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiMVxcXCIpO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiW+ato+WcqOWBnOatoi4uLl1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3mjqfliLZcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5q2j5Zyo5Y+W5raI5LiL6L295Lu75YqhXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PT0gXFxcIjFcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mraPlnKjmmoLlgZwuLi5cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSBcXFwiMlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey6YCA5Ye65LiL6L295ZmoXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKFtcXFwiM1xcXCIsIFxcXCI0XFxcIl0uaW5jbHVkZXMoc3RhdHVzKSkge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKE1ZX0lEICsgXFxcIjppc1N0YXJ0XFxcIik7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKE1ZX0lEICsgXFxcIjpsb2dcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mHjeaWsOeCueWHu+S4i+i9vVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCBNWV9JRCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwiPHN0cm9uZz7kuIvovb3ml6Xlv5c8L3N0cm9uZz5cXFwiLmJpZygpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiLFxcbiAgICAgICAgXFxuICAgIH0pO1xcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICBjb2xfdHlw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Rhc2tDb3VudCxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwi4paHXFxcIi5yZXBlYXQoc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXCIjZmZhYzJkXFxcIikgKyBcXFwi4paHXFxcIi5yZXBlYXQoMTAgLSBzdHJpcENvdW50KS5mb250Y29sb3IoXFxcIiNlNWUxZTRcXFwiKSArIFxcXCIgXFxcIiArIFN0cmluZygocmF0aW8gKiAxMDApKS5zbGljZSgwLCA1KSArIFxcXCIlXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9vei/m+W6plxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXeW3suWujOaIkOS4i+i9ve+8mlxcXCIgKyBpZCk7XFxuICAgICAgICB9IGVsc2UgaWYgKENJRCA9PT0gLTEpIHtcXG4gICAgICAgICAgICBmYWlsTmFtZS5wdXNoKGlkKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIltsaXN0ZW5lcl3lt7LlgZzmraLvvJpcXFwiICsgaWQpO1xcbiAgICAgICAgICAgIGNvdW50ID0gdGFza0NvdW50O1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgaWYgKHRhc2tDb3VudCAhPT0gY291bnQpIHJldHVybjtcXG4gICAgICAgIGlmIChzdWNjZXNzQ0lELmxlbmd0aCA9PT0gdGFza0NvdW50KSB7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIuKWh1xcXCIucmVwZWF0KDEwKS5mb250Y29sb3IoXFxcIiMwMGZmMDBcXFwiKSArIFxcXCIgMTAwJVxcXCIsXFxuICAgICAgICAgICA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AgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSBpZiAoZmFpbFRlYW0ubGVuZ3RoID4gMCAmJiBzdGF0dXMgPT09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgIHB1dE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiNFxcXCIpO1xcbiAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXSPlt7LlgZzmraLmiYDmnInku7vliqHvvIzkvYblt7LmnInov5vluqbkuI3kvJrmtojlpLEjXFxcIik7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiW+mHjeaWsOW8gOWni11cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L295o6n5Yi2XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJicmVha1xcXCI7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHB1dE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiMlxcXCIpO1xcbiAgICAgICAgICAgIHB1dExvZyhcXFwi5LiL6L295Lu75YqhW1xcXCIgKyBpbmZvLmJvb2tOYW1lICsgXFxcIl3lt7Llhajpg6jmiJDlip/lrozmiJBcXFwiKTtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJb6L+U5ZueXVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3mjqfliLZcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIHRvYXN0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MVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBlcnJvck51bSA9IDA7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgaWYgKGkgPT09IDkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gdGFza1BhcmFtLkNJRDtcXG4gICAgfVxcbiAgICBsZXQgY291bnQgPSAwO1xcbiAgICBsZXQgdG90YWxDb3VudCA9IDA7XFxuICAgIGxldCBzdWNjZXNzQ0lEID0gW107XFxuXFxuICAgIGZ1bmN0aW9uIGxpc3RlbmVyKHBhcmFtLCBpZCwgZXJyb3IsIHJlc3VsdCkge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICB0b3RhbENvdW50Kys7XFxuXFxuICAgICAgICAgICAgaWYgKGVycm9yICE9IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5LiL6L295aSx6LSl77yaXFxcIiArIGlkICsgXFxcIjxFUlJPUkAgXFxcIiArIGVycm9yICsgXFxcIj5cXFwiKTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3VsdCA9PT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5YGc5q2i77yaXFxcIiArIGlkKTtcXG4gICAgICAgICAgICAgICAgdG90YWxDb3VudCA9IHBhcmFtLnBpdkNvdW50O1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGNvdW50Kys7XFxuICAgICAgICAgICAgICAgIGxldCByYXRpbyA9ICgoY291bnQgLyBwYXJhbS5waXZDb3VudCkpLnRvRml4ZWQoNCk7XFxuICAgICAgICAgICAgICAgIGxldCBzdHJpcENvdW50ID0gTWF0aC5jZWlsKHJhdGlvICogMTApO1xcbiAgICAgICAgICAgICAgICBpZiAocGFyYW0ucGl2Q291bnQgPT09IHRvdGFsQ291bnQgJiYgdG90YWxDb3VudCA9PT0gY291bnQpIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3NDSUQucHVzaChwYXJhbS5DSUQpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkuIvovb3ov5vluqbvvJpcXFwiICsgKHN1Y2Nlc3NDSUQubGVuZ3RoKSArIFxcXCIvXFxcIiArIHBhcmFtLnRvdGFsLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwi4paHXFxcIi5yZXBlYXQoc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXCIjZmZhYzJkXFxcIikgKyBcXFwi4paHXFxcIi5yZXBlYXQoMTAgLSBzdHJpcENvdW50KS5mb250Y29sb3IoXFxcIiNlNWUxZTRcXFwiKSArIFxcXCIgXFxcIiArIFN0cmluZygocmF0aW8gKiAxMDApKS5zbGljZSgwLCA1KSArIFxcXCIlXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L296L+b5bqmXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgLy9wdXRMb2coXFxcIltsaXN0ZW5lcl3lt7LlrozmiJDkuIvovb3vvJpcXFwiICsgaWQpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodG90YWxDb3VudCAhPT0gcGFyYW0ucGl2Q291bnQpIHJldHVybjtcXG4gICAgICAgICAgICBpZiAodG90YWxDb3VudCA9PT0gY291bnQpIHtcXG4gICAgICAgICAgICAgICAgRmlsZS5yZW5hbWVGaWxlKHBhcmFtLmNoYXB0ZXJQYXRoLCBwYXJhbS5DSUQgKyBcXFwiJEEkXFxcIiArIFRvb2wudGV4dFNoaWVsZChwYXJhbS50aXRsZSkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0b3RhbENvdW50ID0gY291bnQgPSAwO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiYnJlYWtcXFwiO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGxldCB0YXNrVGVhbSA9IFtdO1xcbiAgICBsZXQgbWFpblBhdGggPSBDb25maWcuY29taWNQYXRoICsgXFxcIi9cXFwiICsgaW5mby5ydWxlTmFtZSArIFxcXCIvXFxcIiArIFRvb2wudGV4dFNoaWVsZChpbmZvLmJvb2tOYW1lKSArIFxcXCIvXFxcIjtcXG4gICAgaWYgKGluZm8uYm9va1RvcFBpYykge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgYm9va1RvcFBpYyA9IFRvb2wuaGlrZXJQaWMoaW5mby5ib29rVG9wUGljKTtcXG4gICAgICAgICAgICBUb29sLnBpY0Rvd25sb2FkKGJvb2tUb3BQaWNbMF0sIG1haW5QYXRoICsgaW5mby5ib29rTmFtZSArIFxcXCIuanBnXFxcIiwgYm9va1RvcFBpY1sxXSwgaW5mby5kZWNvZGUpO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhcXFwiPOWwgemdouS4i+i9vemUmeivrz4gXFxcIiArIGUubWVzc2FnZSk7XFxuICAgICAgICB9XFxuICAgIH1cXG5cXG4gICAgZm9yIChsZXQgayA9IDA7IGsgPCBjaGFwdGVyVGVhbS5sZW5ndGg7IGsrKykge1xcbiAgICAgICAgbGV0IGl0ZW0gPSBjaGFwdGVyVGVhbVtrXTtcXG4gICAgICAgIGxldCBvcmRlciA9IGs7XFxuICAgICAgICBsZXQgY2hhcHRlclBhdGggPSBtYWluUGF0aCArIGl0ZW0uQ0lEICsgXFxcIiRCJFxcXCIgKyBUb29sLnRleHRTaGllbGQoaXRlbS50aXRsZSkgKyBcXFwiL1xcXCI7XFxuICAgICAgICBsZXQgcGljTGlzdCA9IFtdO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgZ2V0UGljTGlzdCA9IG5ldyBGdW5jdGlvbihcXFwiaW5wdXRcXFwiLCBcXFwidXJsXFxcIiwgXFxcImluZGV4XFxcIiwgXFxcInRpdGxlXFxcIiwgXFxcInJldHVyblxcXCIgKyBpbmZvLnBhcnNlQ29kZSk7XFxuICAgICAgICAgICAgcGljTGlzdCA9IGdldFBpY0xpc3QoaXRlbS51cmwsIGl0ZW0udXJsLCBrLCBpdGVtLnRpdGxlKTtcXG4gICAgICAgICAgICBpZiAodHlwZW9mIHBpY0xpc3QgPT09IFxcXCJzdHJpbmdcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHBpY0xpc3QgPSBwaWNMaXN0LnJlcGxhY2UoXFxcInBpY3M6Ly9cXFwiLCBcXFwiXFxcIikuc3BsaXQoXFxcIiYmXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHB1dExvZyhcXFwiPOa8q+eUu+WbvueJh+ino+aekOmUmeivrz4gXFxcIiArIGUubWVzc2FnZSk7XFxuICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAocGljTGlzdC5sZW5ndGggPT09IDApIHtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIjzmvKvnlLvlm77niYfop6PmnpDplJnor6/vvJrlm77niYfpk77mjqXov5Tlm57kuLrnqbo+XFxcIik7XFxuICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICB9XFxuICAgICAgICBwaWNMaXN0ID0gcGljTGlzdC5maWx0ZXIocCA9PiBwKTtcXG4gICAgICAgIHZhciB0YXNrVGVhbSA9IHBpY0xpc3QubWFwKCh1cmwsIGkpID0+ICh7XFxuICAgICAgICAgICAgZnVuYzogdGFzayxcXG4gICAgICAgICAgICBpZDogaSxcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgaTogaSxcXG4gICAgICAgICAgICAgICAgY2hhcHRlclBhdGg6IGNoYXB0ZXJQYXRoLFxcbiAgICAgICAgICAgICAgICBNWV9JRDogTVlfSUQsXFxuICAgICAgICAgICAgICAgIGRlY29kZTogaW5mby5kZWNvZGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSk7XFxuICAgICAgICBiZSh0YXNrVGVhbSwge1xcbiAgICAgICAgICAgIGZ1bmM6IGxpc3RlbmVyLFxcbiAgICAgICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgICAgIHBpdkNvdW50OiBwaWNMaXN0Lmxlbmd0aCxcXG4gICAgICAgICAgICAgICAgdG90YWw6IGNoYXB0ZXJUZWFtLmxlbmd0aCxcXG4gICAgICAgICAgICAgICAgb3JkZXI6IG9yZGVyLFxcbiAgICAgICAgICAgICAgICBDSUQ6IGl0ZW0uQ0lELFxcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS50aXRsZSxcXG4gICAgICAgICAgICAgICAgY2hhcHRlclBhdGg6IGNoYXB0ZXJQYXRoXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBpZiAoZ2V0TXlWYXIoTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCJcXFwiKSA9PT0gXFxcIjFcXFwiKSB7XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH1cXG5cX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ZVwiOlwiY29uc3QgdiA9IHtcXG4gICAgc3BsaXQodGV4dCwgdGFyZ2V0LCBjb3VudCkge1xcbiAgICAgICAgY291bnQgPSBjb3VudCA9PT0gdW5kZWZpbmVkID8gMSA6IGNvdW50O1xcbiAgICAgICAgbGV0IGFycmF5ID0gW3RleHRdO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7XFxuICAgICAgICAgICAgdGV4dCA9IGFycmF5W2ldO1xcbiAgICAgICAgICAgIGxldCBpbmRleCA9IHRleHQuaW5kZXhPZih0YXJnZXQpO1xcbiAgICAgICAgICAgIGlmIChpbmRleCA9PT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGFycmF5W2ldID0gdGV4dC5zbGljZSgwLCBpbmRleCk7XFxuICAgICAgICAgICAgYXJyYXlbaSArIDFdID0gdGV4dC5zbGljZShpbmRleCArIHRhcmdldC5sZW5ndGgpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGFycmF5O1xcbiAgICB9LFxcbiAgICBjaHVuayhhcnIsIHNpemUpIHtcXG4gICAgICAgIHZhciByZXN1bHQgPSBbXTtcXG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBhcnIubGVuZ3RoOyBpIDwgbGVuOyBpICs9IHNpemUpIHtcXG4gICAgICAgICAgICByZXN1bHQucHVzaChhcnIuc2xpY2UoaSwgaSArIHNpemUpKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiByZXN1bHQ7XFxuICAgIH0sXFxuICAgIGhpa2VyUGljKHVybCkge1xcbiAgICAgICAgdmFyIGhlYWRlcnMgPSB7fTtcXG4gICAgICAgIGxldCB1cmxzID0gdXJsLnNwbGl0KFxcXCJAXFxcIik7XFxuICAgICAgICBsZXQgcGljVXJsID0gdXJscy5zaGlmdCgpO1xcbiAgICAgICAgbGV0IGxlbmd0aCA9IHVybHMubGVuZ3RoO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGxldCBba2V5LCB2YWx1ZV0gPSB2LnNwbGl0KHVybHNbaV0sIFxcXCI9XFxcIik7XFxuICAgICAgICAgICAgaWYgKGtleSA9PT0gXFxcImhlYWRlcnNcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKGhlYWRlcnMsIEpTT04ucGFyc2UodmFsdWUpKTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGtleS5pbmNsdWRlcyhcXFwiLlxcXCIpIHx8IGtleS5pbmNsdWRlcyhcXFwiP1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgIHBpY1VybCArPSBcXFwiQFxcXCIgKyBrZXkgKyAodmFsdWUgPyBcXFwiPVxcXCIgKyB2YWx1ZSA6IFxcXCJcXFwiKTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGtleSAhPT0gXFxcImpzXFxcIikge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzW2tleV0gPSB2YWx1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gW3BpY1VybCwgaGVhZGVyc107XFxuICAgIH0sXFxuICAgIHJhbmdlKHN0YXJ0LCBlbmQpIHtcXG4gICAgICAgIHJldHVybiBBcnJheShlbmQgLSBzdGFydCkuZmlsbCgwKS5tYXAoKGVsLCBpKSA9PiBzdGFydCArIGkpO1xcbiAgICB9LFxcbiAgICBwaWNEb3dubG9hZCh1cmwsIHBhdGgsIGhlYWRlcnMsIGRlY2lwaGUpIHtcXG4gICAgICAgIGlmICh0eXBlb2YgZGVjaXBoZSA9PT0gXFxcInN0cmluZ1xcXCIgJiYgZGVjaXBoZS5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgbGV0IGluc3RyZWFtO1xcbiAgICAgICAgICAgIGxldCBvdXRzdHJlYW07XFxuICAgICAgICAgICAgbGV0IGZpbGU7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZmlsZSA9IG5ldyBqYXZhLmlvLkZpbGUocGF0aCk7XFxuICAgICAgICAgICAgICAgIGlmIChmaWxlLmV4aXN0cygpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IGRpciA9IGZpbGUuZ2V0UGFyZW50RmlsZSgpO1xcbiAgICAgICAgICAgICAgICBpZiAoZGlyICE9IG51bGwgJiYgIWRpci5leGlzdHMoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZGlyLm1rZGlycygpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGluc3RyZWFtID0gZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgaW5wdXRTdHJlYW06IHRydWVcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgIG91dHN0cmVhbSA9IG5ldyBqYXZhLmlvLkZpbGVPdXRwdXRTdHJlYW0ocGF0aCk7XFxuICAgICAgICAgICAgICAgIGxldCB0ID0gJC5oaWtlci5pbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgIGMgPSAkLmhpa2VyLnVybDtcXG4gICAgICAgICAgICAgICAgJC5oaWtlci5pbnB1dCA9IGluc3RyZWFtO1xcbiAgICAgICAgICAgICAgICAkLmhpa2VyLnVybCA9IHVybDtcXG4gICAgICAgICAgICAgICAgbGV0IHBpY2luID0gKG5ldyBGdW5jdGlvbihcXFwicmV0dXJuIFxcXCIgKyBkZWNpcGhlKSkoKTtcXG4gICAgICAgICAgICAgICAgJC5oaWtlci5pbnB1dCA9IHQ7XFxuICAgICAgICAgICAgICAgICQuaGlrZXIudXJsID0gYztcXG4gICAgICAgICAgICAgICAgbGV0IGJ1ZiA9IGphdmEubGFuZy5yZWZsZWN0LkFycmF5Lm5ld0luc3RhbmNlKGphdmEubGFuZy5CeXRlLlRZUEUsIDEwMjQpO1xcbiAgICAgICAgICAgICAgICBsZXQgbGVuO1xcbiAgICAgICAgICAgICAgICB3aGlsZSAoKGxlbiA9IHBpY2luLnJlYWQoYnVmKSkgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIG91dHN0cmVhbS53cml0ZShidWYsIDAsIGxlbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY2xvc2VNZShpbnN0cmVhbSk7XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUob3V0c3RyZWFtKTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxuICAgICAgICAgICAgICAgIGlmIChmaWxlIGluc3RhbmNlb2YgamF2YS5pby5GaWxlICYmIGZpbGUuZXhpc3RzKCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZpbGUuZGVsZXRlKCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbG9nKFxcXCI86Kej5a+G5LiL6L29RXJyb3I+XFxcIiArIGUudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICAgICAgdGhyb3cgZTtcXG4gICAgICAgICAgICB9IGZpbmFsbHkge1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShvdXRzdHJlYW0pO1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAg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3J1bGU9JytNWV9SVUxFLl90aXRsZSk7XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KGFycjEpO1xcbiAgICAgICAgICAgIH0sIHRhZywgdHlwZSksXFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcignc2VhcmNoS2V5JywgJycpLFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ3NlYXJjaEtleScsaW5wdXQpXFxcIlxcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG4gICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLigJjigJjimpnorr7nva7igJnigJlcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9TZXR0aW5nLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB2ZXJzaW9uOiBNWV9SVUxFLnZlcnNpb25cXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuXFxuICAgIGZvciAobGV0IGkgaW4gdGFnKSB7XFxuICAgICAgICBsZXQgaXQgPSB0YWdbaV07XFxuICAgICAgICBpZiAodGdudW0gPT09IGkpIHtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCcXFxcIiArIGl0Lm5hbWUgKyBcXFwi4oCd4oCdXFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFtcXFwi5Yig6Zmk6K+l55uu5b2VXFxcIiwgXFxcIui3s+i9rOWwj+eoi+W6j1xcXCIsIFxcXCLmiZPlvIDkuabmnrZcXFwiXSwgMSwgXFxcIumAieaLqeaTjeS9nFxcXCIpLnNlbGVjdCgoaXQsIHR5cGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChcXFwi6Lez6L2s5bCP56iL5bqPXFxcIiA9PT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vaG9tZUBcXFwiICsgaXQubmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZihcXFwi5Yig6Zmk6K+l55uu5b2VXFxcIj09PWlucHV0KXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiB0aGVuKFtcXFwi6K+l5pON5L2c5LiN5Lya5Yig6Zmk5bCP56iL5bqP77yM5L2G6K+l5bCP56iL5bqP5LiL6L2955qE5omA5pyJ5ryr55S75bCG6KKr5Yig6ZmkXFxcIl0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLor6Xmk43kvZzkuI3kvJrliKDpmaTlsI/nqIvluo/vvIzkvYbor6XlsI/nqIvluo/kuIvovb3nmoTmiYDmnIkg5ryr55S7L+Wwj+ivtCDlsIbooqvliKDpmaRcXFwiKS5jb25maXJtKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGaWxlLmRlbGV0ZUZpbGVzKHBhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXCIudGdudW1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXQucGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9Cb29rcmFjay52aWV3P3J1bGU95pys5Zyw6LWE5rqQ566h55CGJnJ1bGVOYW1lPVxcXCIraXQubmFtZStcXFwiJnR5cGU9XFxcIit0eXBlO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBpdCwgdHlwZSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXQubmFtZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKGkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcIi50Z251bVxcXCIsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIGkpLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICA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gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbmFtZXNbMF0sXFxuICAgICAgICAgICAgZGVzYzogbmFtZXNbMV0sXFxuICAgICAgICAgICAgcGljX3VybDogcGljLFxcbiAgICAgICAgICAgIHVybDogdHlwZSA9PT0gXFxcIm5vdmVsXFxcIiA/cGFnZVVybCArIFxcXCI/cnVsZT1cXFwiICsgTVlfUlVMRS50aXRsZTokKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYWdlVXJsLCBwYXRoKT0+e1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsb25nUHJlc3MuanNcXFwiKS5zaW5nbGVFbnRlcihwYWdlVXJsLCBwYXRoKTtcXG4gICAgICAgICAgICB9LCBwYWdlVXJsLCBpdGVtLnBhdGgpLFxcbiAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKGl0ZW0sIHtcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsb25nUHJlc3MuanNcXFwiKS5kZWxldGVGaWxlRm9yQm9vayhwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgaXRlbS5wYXRoKVxcbiAgICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICAgICAgaWQ6IGl0ZW0ucGF0aFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBzZXRSZXN1bHQobGF5b3V0KTtcXG59XFxuXFxubWFpbigpO1wifSx7XCJjb2xfdHlwZVwiOlwidGV4dF8xXCIsXCJuYW1lXCI6XCIjdi7mvKvnlLvnq6DoioLli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wiICsgZW5jb2RlVVJJQ29tcG9uZW50KGl0ZW0ucGF0aCksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBDb25maWcuZGVmX0NvbWljX1N0eWxlLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdGVtLnBhdGggKyBcXFwiLzEuanBnXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGF0aCxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRUaXRsZTIoaXRlbS5uYW1lKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH1cXG5cXG59IGVsc2Uge1xcbiAgICBmb3IgKGxldCBpdGVtIG9mIG1obGlzdCkge1xcbiAgICAgICAgbGV0IG5hbWUgPSBnZXRUaXRsZTIoaXRlbS5uYW1lKTtcXG4gICAgICAgIGFycmF5LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIHVybDogJChcXFwi56Gu6K6k5Yig6ZmkW1xcXCIgKyBuYW1lICsgXFxcIl3vvJ9cXFwiKS5jb25maXJtKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmIChGaWxlLmRlbGV0ZUZpbGVzKHBhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCI7XFxuICA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ICAgICAgICBsZXQgcmVwbGFjZVJ1bGUgPSBydWxlTGlzdFtpXTtcXG4gICAgICAgICAgICAgICAgaWYgKCFib29rSW5mby5zZWxlY3RlZC5pbmNsdWRlcyhyZXBsYWNlUnVsZS5pZCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCByZXBsYWNlID0gcmVwbGFjZVBhdHRlcm5bMCArIHJlcGxhY2VSdWxlLmlzUmVnZXhdO1xcbiAgICAgICAgICAgICAgICBqYXZhU3RyaW5nID0gamF2YVN0cmluZ1tyZXBsYWNlXShyZXBsYWNlUnVsZS5wYXR0ZXJuLCByZXBsYWNlUnVsZS5yZXBsYWNlbWVudCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBqYXZhU3RyaW5nLmdldEJ5dGVzKCk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGlmICghZmxhZykge1xcbiAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WQiOW5tuWksei0pVxcXCI7XFxuICAgICAgICB9XFxuXFxuICAgIH1cXG4gICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WQiOW5tuWujOaIkFxcXCI7XFxufVxcbmxheW91dC5wdXNoKHtcXG4gICAgdGl0bGU6IFxcXCLlkIjlubblsI/or7RcXFwiLFxcbiAgICB1cmw6ICQoXFxcIuehruWumuWQiOW5tj9cXFxcbuS8muimhuebluW3suaciVRYVFxcXCIpLmNvbmZpcm0odHh0LCBNWV9QQVJBTVMpLFxcbiAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiXFxufSk7XFxubGF5b3V0LnB1c2goe1xcbiAgICB0aXRsZTogW1xcXCLimJDliIbpobVcXFwiLCBcXFwi4piR5YiG6aG1XFxcIl1bbW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AgICAgICAgIGxldCBpbnB1dE51bSA9IHBhZ2VOdW0gLSAxO1xcbiAgICAgICAgICAgIGlmIChpbnB1dE51bSA8IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sue7j+aYr+esrOS4gOmhteS6hlxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCIucGFnZU51bVxcXCIsIFxcXCJcXFwiICsgaW5wdXROdW0pO1xcbiAgICAgICAgICAgIGNvbnN0IGJvb2tJbmZvID0gSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiKSB8fCBcXFwie31cXFwiKTtcXG4gICAgICAgICAgICBib29rSW5mby5mb290ID0gaW5wdXROdW07XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShib29rSW5mbykpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgfSwgcGFnZU51bSwgcGF0aCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfNVxcXCJcXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5LiL5LiA6aG1XFxcIixcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgodmlld1BhZ2VDb3VudCwgcGFnZU51bSwgcGF0aCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBpbnB1dE51bSA9IHBhZ2VOdW0gKyAxO1xcbiAgICAgICAgICAgIGlmIChpbnB1dE51bSA+IHZpZXdQYWdlQ291bnQgLSA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BcXFwi6YGT6ZW/5qih5p2/5Li05pe257yT5a2YW+W7uuiurua4hemZpF1cXFwiXVxcbiAgICAgICAgXSk7XFxuXFxuICAgICAgICBsZXQgY2FjaGVEaXIgPSBGaWxlLmdldEZpbGVQYXRoKENvbmZpZy5ob21lUGF0aCwgXFxcImRpclxcXCIpO1xcblxcbiAgICAgICAgZnVuY3Rpb24gY2xlYW5DYWNoZShwYXRoKSB7XFxuICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/muIXpmaTlrozmiJBcXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/muIXpmaTlpLHotKVcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGNhY2hlIG9mIGNhY2hlRGlyKSB7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogY2FjaGUubmFtZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuWkp+Wwj++8mlxcXCIgKyBGaWxlLmdldEZpbGVTaXplKGNhY2hlLnBhdGgpICsgXFxcIlxcXFxu5o+P6L+w77yaXFxcIiArIChrbm93bkxpc3QuZ2V0KGNhY2hlLm5hbWUpIHx8IFxcXCLmnKrnn6Xnm67lvZVb6aOO6Zmp5pyq55+lXVxcXCIpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwi56Gu6K6k5riF6ZmkI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tcXG4gICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IHVybDtcXG4gICAgICAgICAgICBzYXZlRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShDb25maWcpLCAwKTtcXG4gICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgc3RhcnQgPSAxO1xcbiAgICAgICAgaWYgKHR5cGVvZihNWV9OQU1FKSAhPT0gXFxcInVuZGVmaW5lZFxcXCIgJiYgTVlfTkFNRSA9PT0gXFxcIuWXheiniea1j+iniOWZqFxcXCIpIHtcXG4gICAgICAgICAgICBzdGFydCA9IDQ7XFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Zu+54mHbGF0ZVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibW92aWVfM1xcXCIsXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJoaWtlcjovL2ltYWdlcy9ob21lX2xhdGVcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoc2V0RGVmYXVsdFBpYywgXFxcImhpa2VyOi8vaW1hZ2VzL2hvbWVfbGF0ZVxcXCIpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuXFxuICAgICAgICBmb3IgKGxldCBpID0gc3RhcnQ7IGkgPD0gNDsgaSsrKSB7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWbvueJh1xcXCIgKyBpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcIm1vdmllXzNcXFwiLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaG9tZV9waWNcXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKHNldERlZmF1bHRQaWMsIFxcXCJoaWtlcjovL2ltYWdlcy9ob21lX3BpY1xcXCIgKyBpKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6Ieq5a6a5LmJ4p6VXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFtcXFwi6Ieq5a6a5LmJdXJsXFxcIiwgXFxcIumAieaLqeaWh+S7tui3r+W+hFxcXCJdKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXCLoh6rlrprkuYl1cmxcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIui+k+WFpeWbvueJh+eahOi3r+W+hOaIluiAhemTvuaOpVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCAwKSB8fCBcXFwie31cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9ICQucmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IENvbmZpZyA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgMCkgfHwgXFxcInt9XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gXFxcImZpbGU6Ly9cXFwiICsgUEFUSDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoQ29uZmlnKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCI6ZGVmYXVsdFBpY0JhY2tcXFwiLCBcXFwidHJ1ZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFwiLmpwZ3wuanBlZ3wuZ2lmfC5wbmd8LnN2Z3wuYm1wXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcImNvbmZpcm1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlOiBcXFwic2VsZWN0UGF0aENhY2hlMlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVtb3J5UGF0aDogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlIFxcXCJyZXBsYWNlUnVsZVxcXCI6XFxuICAgICAgICBpZiAoTVlfUEFSQU1TLmlzUmVmcmVzaCkge1xcbiAgICAgICAgICAgIGFkZExpc3RlbmVyKFxcXCJvbkNsb3NlXFxcIiwgJC50b1N0cmluZygoKSA9PiByZWZyZXNoUGFnZSgpKSk7XFxuICAgICAgICB9XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIuabv+aNouinhOWImXzorr7nva5cXFwiKTtcXG4gICAgICAgIGxldCBydWxlTGlzdCA9IFtdO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBydWxlTGlzdCA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiKSB8fCBcXFwiW11cXFwiKTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfplJnor6/mj5DnpLonLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiAn5pu/5o2i5pWw5o2u6K+75Y+W5aSx6LSl77yM5piv5ZCm5Yid5aeL5YyW77yfXFxcXG7or6Xmk43kvZzkvJrmuIXpmaTkvaDnmoTmm7/mjaLmlbDmja4hISEnLFxcbiAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLliJ3lp4vljJblrozmiJBcXFwiKTtcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAvL3RvYXN0KFxcXCLlj5bmtohcXFwiKTtcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5paw5bu65pu/5o2iXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZWRpdFJlcGxhY2VSdWxlLnZpZXcjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjI25vUmVmcmVzaCM/aXNOZXc9dHJ1ZVxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuWvvOWHuuinhOWImVxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCLnoa7orqTlr7zlh7pcXFwiICsgcnVsZUxpc3QubGVuZ3RoICsgXFxcIuadoeinhOWIme+8n1xcXFxuKHtob21lUHRhaH0vcmVwbGFjZVJ1bGUuanNvbilcXFwiKS5jb25maXJtKChudW0pID0+IHtcXG4gICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBzYXZlUHRhID0gQ29uZmlnLmhv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InJlcGxhY2VSdWxlLmpzb25cXFwiKSB8fCBcXFwiW11cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IG5ld0NvdW50ID0gMCxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUNvdW50ID0gMDtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSBpbiBuZXdSdWxlTGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5ld1J1bGUgPSBuZXdSdWxlTGlzdFtpXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICghbmV3UnVsZS5oYXNPd25Qcm9wZXJ0eShcXFwicmVwbGFjZW1lbnRcXFwiKSB8fCAhbmV3UnVsZS5oYXNPd25Qcm9wZXJ0eShcXFwicGF0dGVyblxcXCIpIHx8ICFuZXdSdWxlLmhhc093blByb3BlcnR5KFxcXCJuYW1lXFxcIikgfHwgKG5ld1J1bGUuc2NvcGVDb250ZW50ID09PSB1bmRlZmluZWQgPyBmYWxzZSA6ICFuZXdSdWxlLnNjb3BlQ29udGVudCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGxldCBpZCA9IG5ld1J1bGUuaWQ7XFxuICAgICAgICAgICAgICAgICAgICBuZXdSdWxlLmlkID0gaWQgfHwgbmV3IERhdGUoKS5nZXRUaW1lKCk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWRJbmRleCA9IHJ1bGVMaXN0LmZpbmRJbmRleChydWxlID0+IHJ1bGUuaWQgPT09IGlkKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpZEluZGV4ID4gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb3VudCsrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnNwbGljZShpZEluZGV4LCAxLCBuZXdSdWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3Q291bnQrKztcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5wdXNoKG5ld1J1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkocnVsZUxpc3QpKTtcXG4gICAgICAgICAgICAgICAgaWYgKGlzYmFjaykge1xcbiAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsb2coXFxcIlxcXFxu6Lev5b6E77yaXFxcIiArIGlucHV0ICsgXFxcIlxcXFxu5oC76KeE5YiZ5pWw77yaXFxcIiArIG5ld1J1bGVMaXN0Lmxlbmd0aCArIFxcXCJcXFxcbuabtOaWsOinhOWImSBcXFwiICsgdXBkYXRlQ291bnQgKyBcXFwiIOadoVxcXFx05paw5aKe6KeE5YiZIFxcXCIgKyBuZXdDb3VudCArIFxcXCIg5p2hXFxcIik7XFxuICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLlr7zlhaXmiJDlip9cXFwiKTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICBpZiAoaXNiYWNrKSBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLlr7zlhaXlpLHotKVcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLlr7zlhaXop4TliJlcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChbXFxcIuWklumDqOaWh+S7tlxcXCIsIFxcXCLlhoXpg6jmlofku7ZcXFwiXSwgMSwgXFxcIuinhOWImeWvvOWFpVxcXCIpLnNlbGVjdCgoaW1wb3J0UnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXCLlpJbpg6jmlofku7ZcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImZpbGVTZWxlY3Q6Ly9cXFwiICsgJC50b1N0cmluZyhpbXBvcnRSdWxlKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSByZXF1aXJlKHJlcXVpcmVVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoaW1wb3J0UnVsZSwgdHJ1ZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZVVybDogcmVxdWlyZVVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcIi5qc29uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcImNvbmZpcm1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lbW9yeTogXFxcInNlbGVjdFBhdGhDYWNoZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgaW1wb3J0UnVsZSksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBsZW4gPSBydWxlTGlzdC5sZW5ndGg7IGkgPCBsZW47IGkrKykge1xcbiAgICAgICAgICAgIGxldCByZXBsYWNlUnVsZSA9IHJ1bGVMaXN0W2ldO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHJlcGxhY2VSdWxlLm5hbWUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoaWQsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIikgfHwgXFxcIltdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZyA9IHJ1bGVMaXN0LnNwbGljZShpbmRleCwgMSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1bGVMaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICAvL2RlbGV0ZUl0ZW1CeUNscyhpZCArIFxcXCIuXFxcIiArIGluZGV4KTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLliKDpmaTmiJDlip9cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIGlkLCBpKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiLlxcXCIgKyBpXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLnvJbovpFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZWRpdFJlcGxhY2VSdWxlLnZpZXcjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjI25vUmVmcmVzaCM/aW5kZXg9XFxcIiArIGksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiLlxcXCIgKyBpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSBcXFwiY29udGVudHNcXFwiOlxcbiAgICAgICAgbGV0IGYgPSByZXF1aXJlKFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIik7XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIuebruW9leiuvue9rnzorr7nva5cXFwiKTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIumAieaLqeaWh+S7tuWkuVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBKU09OLnN0cmluZ2lmeShmLmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0YXJnZXQgPSBmaW5kSXRlbShpZCkuZXh0cmE7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGlkLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24odGFyZ2V0LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgICAgICB9LCBpZCksXFxuICAgICAgICAgICAgICAgIGluaXRpYWxQYXRoOiBDb25maWcuaG9tZVBhdGgsXFxuICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIixcXG4gICAgICAgICAgICAgICAgcGF0dGVybjogMVxcbiAgICAgICAgICAgIH0pKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBkZXNjOiBcXFwi5pSv5oyBaGlrZXI6Ly9maWxlc+i3r+W+hCjor6Xmk43kvZzkuI3kvJrliJ3lp4vljJbnm67lvZUpXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IENvbmZpZy5ob21lUGF0aCxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihpZCwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICB9LCBpZCksXFxuICAgICAgICAgICAgICAgIGlkOiBpZFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi56Gu6K6kXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBpbnB1dCA9IGdldE15VmFyKGlkLCBmaW5kSXRlbShpZCkuZXh0cmEuZGVmYXVsdFZhbHVlIHx8IFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvQ29uZmln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AgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuW8gOWQr1xcXCIsXFxuICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCRpZCwgcmVwbGFjZVJ1bGUsIHBhdGgpID0+IHtcXG4gICAgICAgICAgICBpZiAoZmluZEl0ZW0oJGlkKS5leHRyYS5pc1RydWUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suW8gOWQr1xcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNvbnN0IGJvb2tJbmZvID0gT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkOiBbXVxcbiAgICAgICAgICAgIH0sIEpTT04ucGFyc2UocmVxdWVzdChcXFwiZmlsZTovL1xcXCIgKyBwYXRoICsgXFxcIi9ib29rSW5mby5qc29uXFxcIikgfHwgXFxcInt9XFxcIikpO1xcbiAgICAgICAgICAgIGJvb2tJbmZvLnNlbGVjdGVkLnB1c2gocmVwbGFjZVJ1bGUuaWQpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJGlkLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4pePXFxcIiArIHJlcGxhY2VSdWxlLm5hbWUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpc1RydWU6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICBpZDogJGlkLFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIvYm9va0luZm8uanNvblx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q6Ly9cXFwiICsgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoIS8oXFxcXC50eHR8LmVwdWIpJC9pLnRlc3QoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIumAieaLqeS6humUmeivr+eahOaWh+S7tuexu+Wei1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0NvbmZpZy5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVNYXRjaCA9IGlucHV0Lm1hdGNoKC9cXFxcLyhbXlxcXFwvXSo/KShcXFxcLnR4dHxcXFxcLmVwdWIpJC9pKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBub3ZlbE5hbWUgPSBmaWxlTWF0Y2hbMV0ucmVwbGFjZShcXFwiX2ZpbGVTZWxlY3RfXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aCA9IENvbmZpZy5leHRlcm5hbEltcG9ydFBhdGggKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoQ2FjaGUgPSBDb25maWcuY29udGVudHNDYWNoZSArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXRoID0gaW5wdXQucmVwbGFjZShcXFwiZmlsZTovL1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWvvOWFpeaPkOekulxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IFxcXCLlt7LlrZjlnKhbXFxcIiArIG5vdmVsTmFtZSArIFxcXCJd5piv5ZCm6KaG55uWP1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCwgdHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aENhY2hlKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aENhY2hlKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLlr7zlhaXmiJDlip9cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiO1xcbiAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9ICQucmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVNYXRjaCA9IFBBVEgubWF0Y2goL1xcXFwvKFteXFxcXC9dKj8pKFxcXFwudHh0fFxcXFwuZXB1YikkL2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3ZlbE5hbWUgPSBmaWxlTWF0Y2hbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aCA9IENvbmZpZy5leHRlcm5hbEltcG9ydFBhdGggKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aENhY2hlID0gQ29uZmlnLmNvbnRlbnRzQ2FjaGUgKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBQQVRIO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi5bey5a2Y5ZyoW1xcXCIgKyBub3ZlbE5hbWUgKyBcXFwiXeaYr+WQpuimhueblj9cXFwiKS5jb25maXJtKChwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgsIHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIudHh0fC5lcHViXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFwiY29uZmlybVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBzdG9yZTogXFxcInNlbGVjdFBhdGhDYWNoZTFcXFwiLFxcbiAgICAgICAgICAg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xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgcGF0aCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgXFxcIumYheivu1xcXCI6XFxuICAgICAgICAgICAgICAgIHJldHVybiAodHlwZT09PVxcXCIudHh0XFxcIj9cXFwiaGlrZXI6Ly9wYWdlL3R4dFBhcnNlci52aWV3XFxcIjpcXFwiaGlrZXI6Ly9wYWdlL2VwdWJQYXJzZXIudmlldyNhdXRvQ2FjaGUjXFxcIikrXFxcIj9ydWxlPVxcXCIgKyBNWV9SVUxFLnRpdGxlO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlIFxcXCLmiZPlvIDmlrnlvI9cXFwiOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcIm9wZW5GaWxlOi8vZmlsZTovL1xcXCIgKyBwYXRoO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgfVxcblxcbiAgICBmb3IgKGxldCBub3ZlbCBvZiBmaWxlcykge1xcbiAgICAgICAgbGV0IHR5cGUgPSBub3ZlbC5uYW1lLnN1YnN0cmluZyhub3ZlbC5uYW1lLmxhc3RJbmRleE9mKFxcXCIuXFxcIikpO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBub3ZlbC5uYW1lLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShvcGVyYXRpb24sIG5vdmVsLnBhdGgsIG5vdmVsLm5hbWUsIHR5cGUpLFxcbiAgICAgICAgICAgIGRlc2M6IFxcXCLlpKflsI/vvJpcXFwiICsgRmlsZS5nZXRGaWxlU2l6ZShub3ZlbC5wYXRoKSArIFxcXCJcXFxcbuS/ruaUueaXtumXtO+8mlxcXCIgKyAkLmRhdGVGb3JtYXQobm92ZWwubGFzdE1vZGlmaWVkLCBcXFwieXl5eS1NTS1kZCBISDptbTpzc1xcXCIpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBwYXRoOiBub3ZlbC5wYXRoLFxcbiAgICAgICAgICAgICAgICBpc0NhY2hlOiB0cnVlLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbm92ZWwubmFtZSxcXG4gICAgICAgICAgICAgICAgaWQ6IG5vdmVsLnBhdGgsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG5LqrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeShcXFwic2hhcmU6Ly9cXFwiICsgbm92ZWwucGF0aClcXG4gICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLpmIXor7tcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6IEpTT04uc3RyaW5naWZ5KCh0eXBlPT09XFxcIi50eHRcXFwiP1xcXCJoaWtlcjovL3BhZ2UvdHh0UGFyc2VyLnZpZXdcXFwiOlxcXCJoaWtlcjovL3BhZ2UvZXB1YlBhcnNlci52aWV3I2F1dG9DYWNoZSNcXFwiKStcXFwiP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGUpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5omT5byA5pa55byPXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeShcXFwib3BlbkZpbGU6Ly9maWxlOi8vXFxcIiArIG5vdmVsLnBhdGgpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibG9uZ1ByZXNzLmpzXFxcIikuZGVsZXRlRmlsZUZvclR4dChwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbm92ZWwucGF0aClcXG4gICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBpZiAoZmlsZXMubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLorr7nva5cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9TZXR0aW5nLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiBNWV9SVUxFLnZlcnNpb25cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnO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AgICAgY2hhcHRlck5hbWVzID0gYy5jaGFwdGVyTmFtZXM7XFxuICAgICAgICAgICAgaW50ZXJ2YWxzID0gYy5pbnRlcnZhbHM7XFxuICAgICAgICAgICAgaGFzUHJlZmFjZSA9IGMuaGFzUHJlZmFjZTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6YeN5paw6Kej5p6Q55uu5b2VXFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcIi5qc29uXFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTpmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTpcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICBzZXRSZXN1bHQoW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08c3Ryb25nPuebruW9leino+aekOWksei0pSjph43mlrDop6PmnpApPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcIi5qc29uXFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1dKTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuXFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBzaG93TG9hZGluZyhcXFwi5q2j5Zyo6Kej5p6Q55uu5b2VXFxcIik7XFxuICAgICAgICBsZXQgdHh0ID0gcmVxdWVzdChwYXRoLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAvL1xcXCJjb250ZW50LXR5cGVcXFwiOiBcXFwidGV4dC9wbGFpbjsgY2hhcnN0PVxcXCIgKyBjaGFyc3RcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCBwYXR0ZXJuID0gcmVncy5nZXRUb2NSdWxlKHR4dCk7XFxuICAgICAgICBpZiAoIXBhdHRlcm4pIHtcXG4gICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxzdHJvbmc+55uu5b2V6Kej5p6Q5aSx6LSlPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1dKTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgbWF0Y2hlciA9IHBhdHRlcm4ubWF0Y2hlcih0eHQpO1xcbiAgICAgICAgbGV0IHBvaW50ZXIgPSAwO1xcbiAgICAgICAgd2hpbGUgKG1hdGNoZXIuZmluZCgpKSB7XFxuICAgICAgICAgICAgbGV0IHN0YXJ0ID0gbWF0Y2hlci5zdGFydCgpO1xcbiAgICAgICAgICAgIGxldCBlbmQgPSBtYXRjaGVyLmVuZCgpO1xcbiAgICAgICAgICAgIGxldCB0ID0gbWF0Y2hlci5ncm91cCgpO1xcbiAgICAgICAgICAgIGlmIChwb2ludGVyID09PSAwICYmIHN0YXJ0ID4gMzApIHtcXG4gICAgICAgICAgICAgICAgaGFzUHJlZmFjZSA9IHRydWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNoYXB0ZXJOYW1lcy5wdXNoKHQpO1xcbiAgICAgICAgICAgIGludGVydmFscy5wdXNoKFtwb2ludGVyLCBzdGFydF0pO1xcbiAgICAgICAgICAgIHBvaW50ZXIgPSBlbmQ7XFxuICAgICAgICB9XFxuICAgICAgICBpbnRlcnZhbHMucHVzaChbcG9pbnRlciwgdHh0Lmxlbmd0aF0pO1xcbiAgICAgICAgaWYgKGlzQ2FjaGUpIHtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoY2FjaGVQYXRoLCBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJOYW1lczogY2hhcHRlck5hbWVzLFxcbiAgICAgICAgICAgICAgICBpbnRlcnZhbHM6IGludGVydmFscyxcXG4gICAgICAgICAgICAgICAgaGFzUHJlZmFjZTogaGFzUHJlZmFjZVxcbiAgICAgICAgICAgIH0pKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgIH1cXG5cXG5cXG4gICAgaWYgKGhhc1ByZWZhY2UpIHtcXG4gICAgICAgIGxldCBpbnRlcnZhbCA9IGludGVydmFsc1swXTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuW6j+iogFxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9UWFRWaWV3ZXIudmlldyNhdXRvUGFnZSMjcmVhZFRoZW1lI1xcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2hhcHRlck5hbWU6IFxcXCLluo/oqIBcXFwiLFxcbiAgICAgICAgICAgICAgICBzdGFydDogaW50ZXJ2YWxbMF0sXFxuICAgICAgICAgICAgICAgIGVuZDogaW50ZXJ2YWxbMV0sXFxuICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxuICAgICAgICAgICAgICAgIGNoYXJzdDogY2hhcnN0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFwdGVyTmFtZXMubGVuZ3RoOyBpKyspIH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gIFxcXCJpZFxcXCI6IC0xNCxcXG4gICAgICAgIFxcXCJlbmFibGVcXFwiOiB0cnVlLFxcbiAgICAgICAgXFxcIm5hbWVcXFwiOiBcXFwi54m55q6K56ym5Y+3IOagh+mimCjljZXkuKopXFxcIixcXG4gICAgICAgIFxcXCJydWxlXFxcIjogXFxcIig/PD1bXFxcXFxcXFxz44CAXXswLDR9KSg/OlvimIbimIXinKbinKddLnsxLDMwfXwoPzrlhoXlrrl85paH56ugKT/nroDku4t85paH5qGIfOWJjeiogHzluo/nq6B85qWU5a2QfOato+aWhyg/IeWujHznu5MpfOe7iOeroHzlkI7orrB85bC+5aOwfOeVquWklilbIOOAgF17MCw0fSRcXFwiLFxcbiAgICAgICAgXFxcImV4YW1wbGVcXFwiOiBcXFwi4piG44CB5pmL5rGf5L2c6ICF5pyA5Zac5qyi55qE5qC85byPXFxcIixcXG4gICAgICAgIFxcXCJzZXJpYWxOdW1iZXJcXFwiOiAxMlxcbiAgICB9LFxcbiAgICB7XFxuICAgICAgICBcXFwiaWRcXFwiOiAtMTUsXFxuICAgICAgICBcXFwiZW5hYmxlXFxcIjogdHJ1ZSxcXG4gICAgICAgIFxcXCJuYW1lXFxcIjogXFxcIueroC/ljbcg5bqP5Y+3IOagh+mimFxcXCIsXFxuICAgICAgICBcXFwicnVsZVxcXCI6IFxcXCJeWyBcXFxcXFxcXHTjgIBdezAsNH0oPzooPzrlhoXlrrl85paH56ugKT/nroDku4t85paH5qGIfOWJjeiogHzluo/nq6B85qWU5a2QfOato+aWhyg/IeWujHznu5MpfOe7iOeroHzlkI7orrB85bC+5aOwfOeVquWklnxb5Y2356ugXVtcXFxcXFxcXGTjgIfpm7bkuIDkuozkuKTkuInlm5vkupTlha3kuIPlhavkuZ3ljYHnmb7ljYPkuIflo7notLDlj4HogobkvI3pmYbmn5LmjYznjpbmi77kvbDku59dezEsOH0pWyDjgIBdezAsNH0uezAsMzB9JFxcXCIsXFxuICAgICAgICBcXFwiZXhhbXBsZVxcX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vZHMgPSBbXFxcIuezu+e7n1xcXCIsIFxcXCLlpKflsI9cXFwiLCBcXFwi5ZCN56ewXFxcIiwgXFxcIuaXtumXtFxcXCJdO1xcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB1cmw6ICdcXFwiaGlrZXI6Ly9zZWFyY2g/cz1cXFwiK2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLmkJzkvaDmg7PopoHnmoQjXFxcIiArIHR5cGUgKyBcXFwiIy4uLi4uLlxcXCIsXFxuICAgICAgICB0aXRsZTogXFxcIvCflI1cXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHJ1bGVzOiAkLnRvU3RyaW5nKChydWxlTmFtZSwgdHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgYXJyMSA9IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogcnVsZU5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaF91cmxcXFwiOiBcXFwiaGlrZXI6Ly9lbXB0eT9pc0FsbD0xJnNlYXJjaFRlcm1zPSoqJnR5cGU9XFxcIiArIHR5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaEZpbmRcXFwiOiBcXFwianM6JC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvU2VhcmNoLnZpZXc/cnVsZT0nK01ZX1JVTEUuX3RpdGxlKTtcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShhcnIxKTtcXG4gICAgICAgICAgICB9LCBydWxlTmFtZSwgdHlwZSksXFxuICAgICAgICAgICAgLypkZWZhdWx0VmFsdWU6IGdldE15VmFyKCdzZWFyY2hLZXknLCAnJyksXFxuICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc2VhcmNoS2V5JyxpbnB1dClcXFwiKi9cXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi8J+nqVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgIHVybDogJChjb2xUeXBlcy5tYXAodj0+dj09PWNvbF90eXBlP1xcXCLigJzigJxcXFwiK3YrXFxcIuKAneKAnVxcXCI6dikpLnNlbGVjdCgobmFtZSkgPT4ge1xcbiAgICAgICAgICAgIGlmKC/igJzigJwuKj/igJ3igJ0vLnRlc3QoaW5wdXQpKSByZXR1cm47XFxuICAgICAgICAgICAgc2V0SXRlbShcXFwiYm9va3JhY2s6Y29sX3R5cGVcXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgIH0pXFxuICAgIH0pO1xcbiAgICBmb3IgKGxldCBuYW1lIG9mIHJhbmtNZXRob2RzKSB7XFxuICAgICAgICBsZXQgYSA9IHJhbmtNZXRob2QgPT09IG5hbWU7XFxuICAgICAgICBsZXQgdGl0bGVhID0gYSA/IFxcXCLigJjigJhcXFwiICsgbmFtZSArIFxcXCLigJnigJlcXFwiIDogbmFtZTtcXG4gICAgICAgIGxldCB0aXRsZWIgPSBcXFwiXFxcIjtcXG4gICAgICAgIGlmIChhKSB7XFxuICAgICAgICAgICAgdGl0bGViID0gIXJhbmtJc1JldmVyc2UgPyBcXFwi4oaTXFxcIiA6IFxcXCLihpFcXFwiO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB0aXRsZWIgPSBcXFwi4oaVXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGVhICsgdGl0bGViLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcmFua01ldGhvZCA9IGdldEl0ZW0oXFxcImJvb2tyYWNrOnJhbmtNZXRob2RcXFwiLCBcXFwi57O757ufXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCByYW5rSXNSZXZlcnNlID0gZ2V0SXRlbShcXFwiYm9va3JhY2s6cmFua0lzUmV2ZXJzZVxcXCIsIFxcXCJcXFwiKTtcXG5cXG4gICAgICAgICAgICAgICAgaWYgKHJhbmtNZXRob2QgPT09IG5hbWUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyYW5rSXNSZXZlcnNlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmFua0lzUmV2ZXJzZSA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByYW5rSXNSZXZlcnNlID0gXFxcIjFcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwiYm9va3JhY2s6cmFua0lzUmV2ZXJzZVxcXCIsIHJhbmtJc1JldmVyc2UpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwiYm9va3JhY2s6cmFua0lzUmV2ZXJzZVxcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcImJvb2tyYWNrOnJhbmtNZXRob2RcXFwiLCBuYW1lKTtcXG5cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZX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FxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZXJyb3JOdW0gPSAwO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpID09PSA5KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiB0YXNrUGFyYW0uQ0lEO1xcXFxuICAgIH1cXFxcbiAgICBsZXQgY291bnQgPSAwO1xcXFxuICAgIGxldCB0b3RhbENvdW50ID0gMDtcXFxcbiAgICBsZXQgc3VjY2Vzc0NJRCA9IFtdO1xcXFxuXFxcXG4gICAgZnVuY3Rpb24gbGlzdGVuZXIocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICB0b3RhbENvdW50Kys7XFxcXG5cXFxcbiAgICAgICAgICAgIGlmIChlcnJvciAhPSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgcHV0TG9nKFxcXFxcXFwiW2xpc3RlbmVyXeS4i+i9veWksei0pe+8mlxcXFxcXFwiICsgaWQgKyBcXFxcXFxcIjxFUlJPUkAgXFxcXFxcXCIgKyBlcnJvciArIFxcXFxcXFwiPlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzdWx0ID09PSAtMSkge1xcXFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFxcXFxcIltsaXN0ZW5lcl3lt7LlgZzmraLvvJpcXFxcXFxcIiArIGlkKTtcXFxcbiAgICAgICAgICAgICAgICB0b3RhbENvdW50ID0gcGFyYW0ucGl2Q291bnQ7XFxcXG4gICAgICAgICAgICB9I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cXFxcXFxcInx85LiL6L296L+b5bqmXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIC8vcHV0TG9nKFxcXFxcXFwiW2xpc3RlbmVyXeW3suWujOaIkOS4i+i9ve+8mlxcXFxcXFwiICsgaWQpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHRvdGFsQ291bnQgIT09IHBhcmFtLnBpdkNvdW50KSByZXR1cm47XFxcXG4gICAgICAgICAgICBpZiAodG90YWxDb3VudCA9PT0gY291bnQpIHtcXFxcbiAgICAgICAgICAgICAgICBGaWxlLnJlbmFtZUZpbGUocGFyYW0uY2hhcHRlclBhdGgsIHBhcmFtLkNJRCArIFxcXFxcXFwiJEEkXFxcXFxcXCIgKyBUb29sLnRleHRTaGllbGQocGFyYW0udGl0bGUpKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHRvdGFsQ291bnQgPSBjb3VudCA9IDA7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJicmVha1xcXFxcXFwiO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBsZXQgdGFza1RlYW0gPSBbXTtcXFxcbiAgICBsZXQgbWFpblBhdGggPSBDb25maWcuY29taWNQYXRoICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpbmZvLnJ1bGVOYW1lICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBUb29sLnRleHRTaGllbGQoaW5mby5ib29rTmFtZSkgKyBcXFxcXFxcIi9cXFxcXFxcIjtcXFxcbiAgICBpZiAoaW5mby5ib29rVG9wUGljKSB7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBsZXQgYm9va1RvcFBpYyA9IFRvb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FxcXG4gICAgICAgICAgICBpZiAodHlwZW9mIHBpY0xpc3QgPT09IFxcXFxcXFwic3RyaW5nXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICBwaWNMaXN0ID0gcGljTGlzdC5yZXBsYWNlKFxcXFxcXFwicGljczovL1xcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKS5zcGxpdChcXFxcXFxcIiYmXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBwdXRMb2coXFxcXFxcXCI85ryr55S75Zu+54mH6Kej5p6Q6ZSZ6K+vPiBcXFxcXFxcIiArIGUubWVzc2FnZSk7XFxcXG4gICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpZiAocGljTGlzdC5sZW5ndGggPT09IDApIHtcXFxcbiAgICAgICAgICAgIHB1dExvZyhcXFxcXFxcIjzmvKvnlLvlm77niYfop6PmnpDplJnor6/vvJrlm77niYfpk77mjqXov5Tlm57kuLrnqbo+XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgcGljTGlzdCA9IHBpY0xpc3QuZmlsdGVyKHAgPT4gcCk7XFxcXG4gICAgICAgIHZhciB0YXNrVGVhbSA9IHBpY0xpc3QubWFwKCh1cmwsIGkpID0+ICh7XFxcXG4gICAgICAgICAgICBmdW5jOiB0YXNrLFxcXFxuICAgICAgICAgICAgaWQ6IGksXFxcXG4gICAgICAgICAgICBwYXJhbToge1xcXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcXFxuICAgICAgICAgICAgICAgIGk6IGksXFxcXG4gICAgICAgICAgICAgICAgY2hhcHRlclBhdGg6IGNoYXB0ZXJQYXRoLFxcXFxuICAgICAgICAgICAgICAgIE1ZX0lEOiBNWV9JRCxcXFxcbiAgICAgICAgICAgICAgICBkZWNvZG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rZXkuaW5jbHVkZXMoXFxcXFxcXCI/XFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgcGljVXJsICs9IFxcXFxcXFwiQFxcXFxcXFwiICsga2V5ICsgKHZhbHVlID8gXFxcXFxcXCI9XFxcXFxcXCIgKyB2YWx1ZSA6IFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChrZXkgIT09IFxcXFxcXFwianNcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIGhlYWRlcnNba2V5XSA9IHZhbHVlO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiBbcGljVXJsLCBoZWFkZXJzXTtcXFxcbiAgICB9LFxcXFxuICAgIHJhbmdlKHN0YXJ0LCBlbmQpIHtcXFxcbiAgICAgICAgcmV0dXJuIEFycmF5KGVuZCAtIHN0YXJ0KS5maWxsKDApLm1hcCgoZWwsIGkpID0+IHN0YXJ0ICsgaSk7XFxcXG4gICAgfSxcXFxcbiAgICBwaWNEb3dubG9hZCh1cmwsIHBhdGgsIGhlYWRlcnMsIGRlY2lwaGUpIHtcXFxcbiAgICAgICAgaWYgKHR5cGVvZiBkZWNpcGhlID09PSBcXFxcXFxcInN0cmluZ1xcXFxcXFwiICYmIGRlY2lwaGUubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgbGV0IGluc3RyZWFtO1xcXFxuICAgICAgICAgICAgbGV0IG91dHN0cmVhbTtcXFxcbiAgICAgICAgICAgIGxldCBmaWxlO1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBmaWxlID0gbmV3IGphdmEuaW8uRmlsZShwYXRoKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZmlsZS5leGlzdHMoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGxldCBkaXIgPSBmaWxlLmdldFBhcmVudEZpbGUoKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZGlyICE9IG51bGwgJiYgIWRpci5leGlzdHMoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBkaXIubWtkaXJzKCk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGluc3RyZWFtID0gZmV0Y2godXJsLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0U3RyZWFtOiB0cnVlXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICBvdXRzdHJlYW0gPSBuZXcgamF2YS5pby5GaWxlT3V0cHV0U3RyZWFtKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgIGxldCB0ID0gJC5oaWtlci5pbnB1dCxcXFxcbiAgICAgICAgICAgICAgICAgICAgYyA9ICQuaGlrZXIudXJsO1xcXFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSBpbnN0cmVhbTtcXFxcbiAgICAgICAgICAgICAgICAkLmhpa2VyLnVybCA9IHVybDtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcGljaW4gPSAobmV3IEZ1bmN0aW9uKFxcXFxcXFwicmV0dXJuIFxcXFxcXFwiICsgZGVjaXBoZSkpKCk7XFxcXG4gICAgICAgICAgICAgICAgJC5oaWtlci5pbnB1dCA9IHQ7XFxcXG4gICAgICAgICAgICAgICAgJC5oaWtlci51cmwgPSBjO1xcXFxuICAgICAgICAgICAgICAgIGxldCBidWYgPSBqYXZhLmxhbmcucmVmbGVjdC5BcnJheS5uZXdJbnN0YW5jZShqYXZhLmxhbmcuQnl0ZS5UWVBFLCAxMDI0KTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgbGVuO1xcXFxuICAgICAgICAgICAgICAgIHdoaWxlICgobGVuID0gcGljaW4ucmVhZChidWYpKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBvdXRzdHJlYW0ud3JpdGUoYnVmLCAwLCBsZW4pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXFxcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShpbnN0cmVhbSk7XFxcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShvdXRzdHJlYW0pO1xcXFxuICAgICAgICAgICAgICAgIGlmIChmaWxlIGluc3RhbmNlb2YgamF2YS5pby5GaWxlICYmIGZpbGUuZXhpc3RzKCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZS5kZWxldGUoKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgbG9nKFxcXFxcXFwiPOino+WvhuS4i+i9vUVycm9yPlxcXFxcXFwiICsgZS50b1N0cmluZygpKVxcXFxuICAgICAgICAgICAgICAgIHRocm93IGU7XFxcXG4gICAgICAgICAgICB9IGZpbmFsbHkge1xcXFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcXFxuICAgICAgICAgICAgICAgIGNsb3NlTWUob3V0c3RyZWFtKTtcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgcmVxdWlyZURvd25sb2FkKHVybCwgcGF0aCwgaGVhZGVycyk7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LFxcXFxuICAgIHRleHRTaGllbGQodGV4dCkge1xcXFxuICAgICAgICBsZXQgZSA9IC8jfDp8JnxcXFxcXFxcXHx8XFxcXFxcXFxefEB8XFxcXFxcXFw8fFxcXFxcXFxcPnwlfFxcXFxcXFxcL3xc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ruW9lVxcXFxcXFwiLCBcXFxcXFxcIui3s+i9rOWwj+eoi+W6j1xcXFxcXFwiLCBcXFxcXFxcIuaJk+W8gOS5puaetlxcXFxcXFwiXSwgMSwgXFxcXFxcXCLpgInmi6nmk43kvZxcXFxcXFxcIikuc2VsZWN0KChpdCwgdHlwZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoXFxcXFxcXCLot7PovazlsI/nqIvluo9cXFxcXFxcIiA9PT0gaW5wdXQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vaG9tZUBcXFxcXFxcIiArIGl0Lm5hbWU7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZihcXFxcXFxcIuWIoOmZpOivpeebruW9lVxcXFxcXFwiPT09aW5wdXQpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gdGhlbihbXFxcXFxcXCLor6Xmk43kvZzkuI3kvJrliKDpmaTlsI/nqIvluo/vvIzkvYbor6XlsI/nqIvluo/kuIvovb3nmoTmiYDmnInmvKvnlLvlsIbooqvliKDpmaRcXFxcXFxcIl0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCLor6Xmk43kvZzkuI3kvJrliKDpmaTlsI/nqIvluo/vvIzkvYbor6XlsI/nqIvluo/kuIvovb3nmoTmiYDmnIkg5ryr55S7L+Wwj+ivtCDlsIbooqvliKDpmaRcXFxcXFxcIikuY29uZmlybSgocGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXFxcXFwiLnRnbnVtXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXQucGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0Jvb2tyYWNrLnZpZXc/cnVsZT3mnKzlnLDotYTmupDnrqHnkIYmcnVsZU5hbWU9XFxcXFxcXCIraXQubmFtZStcXFxcXFxcIiZ0eXBlPVxcXFxcXFwiK3R5cGU7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LCBpdCwgdHlwZSlcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdC5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZShpID0+IHtcXFxcbiAgICA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gYXJyYXkucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIHVybDogaXRlbS5wYXRoICsgbGF6eSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogQ29uZmlnLmRlZl9Db21pY19TdHlsZSxcXFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdGVtLnBhdGggKyBcXFxcXFxcIi8xLmpwZ1xcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIGZvciAobGV0IGl0ZW0gb2YgbWhsaXN0KSB7XFxcXG4gICAgICAgICAgICBsZXQgdGl0bGUgPSBnZXRUaXRsZShpdGVtLm5hbWUpO1xcXFxuICAgICAgICAgICAgYXJyYXkucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvY29taWNDb21wYXRpYmxlLnZpZXcjYXV0b1BhZ2UjI3JlYWRUaGVtZSM/cGF0aD1cXFxcXFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChpdGVtLnBhdGgpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBDb25maWcuZGVmX0NvbWljX1N0eWxlLFxcXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IGl0ZW0ucGF0aCArIFxcXFxcXFwiLzEuanBnXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXRoLFxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ2V0VGl0bGUyKGl0ZW0ubmFtZSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1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gICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBmb3IgKGxldCBjYWNoZSBvZiBjYWNoZURpcikge1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBjYWNoZS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi5aSn5bCP77yaXFxcXFxcXCIgKyBGaWxlLmdldEZpbGVTaXplKGNhY2hlLnBhdGgpICsgXFxcXFxcXCJcXFxcXFxcXG7mj4/ov7DvvJpcXFxcXFxcIiArIChrbm93bkxpc3QuZ2V0KGNhY2hlLm5hbWUpIHx8IFxcXFxcXFwi5pyq55+l55uu5b2VW+mjjumZqeacquefpV1cXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwi56Gu6K6k5riF6ZmkIFxcXFxcXFwiICsgY2FjaGUubmFtZSArIFxcXFxcXFwiID9cXFxcXFxcIikuY29uZmlybShjbGVhbkNhY2hlLCBjYWNoZS5wYXRoKVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLlhajpg6jmuIXpmaQoXFxcXFxcXCIgKyBGaWxlLmdldEZpbGVTaXplKENvbmZpZy5ob21lUGF0aCkgKyBcXFxcXFxcIilcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHV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9hc3Q6Ly/kv67mlLnmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFxcXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSAkLnJlcXVpcmUocmVxdWlyZVVybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXFxcXFwiY29uZmlnLmpzb25cXFxcXFxcIiwgMCkgfHwgXFxcXFxcXCJ7fVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgUEFUSDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFxcXFxcImNvbmZpZy5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiOmRlZmF1bHRQaWNCYWNrXFxcXFxcXCIsIFxcXFxcXFwidHJ1ZVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV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1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBjb25maXJtKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+mUmeivr+aPkOekuicsXFxcXG4gICAgICAgICAgICAgICAgY29udGVudDogJ+abv+aNouaVsOaNruivu+WPluWksei0pe+8jOaYr+WQpuWIneWni+WMlu+8n1xcXFxcXFxcbuivpeaTjeS9nOS8mua4hemZpOS9oOeahOabv+aNouaVsOaNriEhIScsXFxcXG4gICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUoXFxcXFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuWIneWni+WMluWujOaIkFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICBjYW5jZWw6ICQudG9TdHJpbmcoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAvL3RvYXN0KFxcXFxcXFwi5Y+W5raIXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuaWsOW7uuabv+aNolxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9lZGl0UmVwbGFjZVJ1bGUudmlldyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSMjbm9SZWZyZXNoIz9pc05ldz10cnVlXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzNcXFxcXFxcIlxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICA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xcXFxcXCJwYXR0ZXJuXFxcXFxcXCIpIHx8ICFuZXdSdWxlLmhhc093blByb3BlcnR5KFxcXFxcXFwibmFtZVxcXFxcXFwiKSB8fCAobmV3UnVsZS5zY29wZUNvbnRlbnQgPT09IHVuZGVmaW5lZCA/IGZhbHNlIDogIW5ld1J1bGUuc2NvcGVDb250ZW50KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gbmV3UnVsZS5pZDtcXFxcbiAgICAgICAgICAgICAgICAgICAgbmV3UnVsZS5pZCA9IGlkIHx8IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWRJbmRleCA9IHJ1bGVMaXN0LmZpbmRJbmRleChydWxlID0+IHJ1bGUuaWQgPT09IGlkKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlkSW5kZXggPiAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlQ291bnQrKztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnNwbGljZShpZEluZGV4LCAxLCBuZXdSdWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0NvdW50Kys7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5wdXNoKG5ld1J1bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXFxcXFwicmVwbGFjZVJ1bGUuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChpc2JhY2spIHtcXFxcbiAgICAgICAgICAgIC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VsZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcXFxcXCLlpJbpg6jmlofku7ZcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJmaWxlU2VsZWN0Oi8vXFxcXFxcXCIgKyAkLnRvU3RyaW5nKGltcG9ydFJ1bGUpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZyhpbXBvcnRSdWxlLCB0cnVlKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IHJlcXVpcmVVcmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcXFxcXCIuanNvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DbGlja1R5cGU6IFxcXFxcXFwiY29uZmlybVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVtb3J5OiBcXFxcXFxcInNlbGVjdFBhdGhDYWNoZVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIGltcG9ydFJ1bGUpLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXF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25cXFxcXFxcIikgfHwgXFxcXFxcXCJbXVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGcgPSBydWxlTGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXFxcXFwicmVwbGFjZVJ1bGUuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2RlbGV0ZUl0ZW1CeUNscyhpZCArIFxcXFxcXFwiLlxcXFxcXFwiICsgaW5kZXgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi5Yig6Zmk5oiQ5YqfXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSwgaWQsIGkpLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIi5cXFxcXFxcIiArIGlcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMlxcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLnvJbovpFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2VkaXRSZXBsYWNlUnVsZS52aWV3I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IyNub1JlZnJlc2gjP2luZGV4PVxcXFxcXFwiICsgaSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcXFxcXCIuXFxcXFxcXCIgKyBpXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIi5cXFxcXFxcIiArIGlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBicmVhaztcXFxcbiAgICBjYXNlIFxcXFxcXFwiY29udGVudHNcXFxcXFxcIjpcXFxcbiAgICAgICAgbGV0IGYgPSByZXF1aXJlKFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiKTtcXFxcbiAgICAgICAgc2V0UGFnZVRpdGxlKFxcXFxcXFwi55uu5b2V6K6+572ufOiuvue9rlxcXFxcXFwiKTtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6YCJ5oup5paH5Lu25aS5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IEpTT04uc3RyaW5naWZ5KGYuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0YXJnZXQgPSBmaW5kSXRlbShpZCkuZXh0cmE7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaWQsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHRhcmdldCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcXFxuICAgICAgICAgICAgICAgIH0sIGlkKSxcXFxcbiAgICAgICAgICAgICAgICBpbml0aWFsUGF0aDogQ29uZmlnLmhvbWVQYXRoLFxcXFxuICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHBhdHRlcm46IDFcXFxcbiAgICAgICAgICAgIH0pKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImlucHV0XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBkZXNjOiBcXFxcXFxcIuaUr+aMgWhpa2VyOi8vZmlsZXPot6/lvoQo6K+l5pON5L2c5LiN5Lya5Yid5aeL5YyW55uu5b2VKVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IENvbmZpZy5ob21lUGF0aCxcXFxcbiAgICAgICAgICAgICAgICBvbkNoYW5nZTogJC50b1N0cmluZygoaWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoaWQsIGlucHV0KTtcXFxcbiAgICAgICAgICAgICAgICB9LCBpZCksXFxcX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YWNoZSArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBpbnB1dC5yZXBsYWNlKFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm0oe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWvvOWFpeaPkOekulxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IFxcXFxcXFwi5bey5a2Y5ZyoW1xcXFxcXFwiICsgbm92ZWxOYW1lICsgXFxcXFxcXCJd5piv5ZCm6KaG55uWP1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCwgdHJ1ZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuWvvOWFpeaIkOWKn1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gJC5yZXF1aXJlKHJlcXVpcmVVcmwpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcXFxuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVNYXRjaCA9IFBBVEgubWF0Y2goL1xcXFxcXFxcLyhbXlxcXFxcXFxcL10qPykoXFxcXFxcXFwudHh0fFxcXFxcXFxcLmVwdWIpJC9pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3ZlbE5hbWUgPSBmaWxlTWF0Y2hbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoID0gQ29uZmlnLmV4dGVybmFsSW1wb3J0UGF0aCArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGhDYWNoZSA9IENvbmZpZy5jb250ZW50c0NhY2hlICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBQQVRIO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuW3suWtmOWcqFtcXFxcXFxcIiArIG5vdmVsTmFtZSArIFxcXFxcXFwiXeaYr+WQpuimhueblj9cXFxcXFxcIikuY29uZmlybSgocGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoLCB0cnVlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aENhY2hlKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXFxcXFwiLnR4dHwuZXB1YlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcXFxcXCJjb25maXJtXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JlOiBcXFxcXFxcInNlbGVjdFBhdGhDYWNoZTFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgbWVtb3J5UGF0aDogdHJ1ZVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KSxcXFxcbiAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICB9XFxcXG4gICAgfSk7XFxcXG4gICAgbGV0IG9wdGlvbnMgPSBbXFxcXFxcXCLpmIXor7tcXFxcXFxcIiwgXFxcXFxcXCLliIbkuqtcXFxcXFxcIiwgXFxcXFxcXCLliKDpmaR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aWxlLmRlbGV0ZUZpbGVzKHBhdGggKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYXRoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LCBwYXRoKTtcXFxcbiAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgIGNhc2UgXFxcXFxcXCLpmIXor7tcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gKHR5cGU9PT1cXFxcXFxcIi50eHRcXFxcXFxcIj9cXFxcXFxcImhpa2VyOi8vcGFnZS90eHRQYXJzZXIudmlld1xcXFxcXFwiOlxcXFxcXFwiaGlrZXI6Ly9wYWdlL2VwdWJQYXJzZXIudmlldyNhdXRvQ2FjaGUjXFxcXFxcXCIpK1xcXFxcXFwiP3J1bGU9XFxcXFxcXCIgKyBNWV9SVUxFLnRpdGxlO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgY2FzZSBcXFxcXFxcIuaJk+W8gOaWueW8j1xcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcIm9wZW5GaWxlOi8vZmlsZTovL1xcXFxcXFwiICsgcGF0aDtcXFxcbiAgICAgICAgICAgICAgICBicmVhaztcXFxc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AgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIumHjeaWsOino+aekOebruW9lVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgocGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFxcXFxcIi5qc29uXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOmZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6XFxcXFxcXCJsaW5lX2JsYW5rXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuKAnOKAnOKAneKAnTxzdHJvbmc+55uu5b2V6Kej5p6Q5aSx6LSlKOmHjeaWsOino+aekCk8L3N0cm9uZz5cXFxcXFxcIi5iaWcoKSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKHBhdGgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZShwYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcXFxcXCIuanNvblxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XSk7XFxcXG4gICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgIH1cXFxcblxcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIHNob3dMb2FkaW5nKFxcXFxcXFwi5q2j5Zyo6Kej5p6Q55uu5b2VXFxcXFxcXCIpO1xcXFxuICAgICAgICBsZXQgdHh0ID0gcmVxdWVzdChwYXRoLCB7XFxcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgLy9cXFxcXFxcImNvbnRlbnQtdHlwZVxcXFxcXFwiOiBcXFxcXFxcInRleHQvcGxhaW47IGNoYXJzdD1cXFxcXFxcIiArIGNoYXJzdFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgbGV0IHBhdHRlcm4gPSByZWdzLmdldFRvY1J1bGUodHh0KTtcXFxcbiAgICAgICAgaWYgKCFwYXR0ZXJuKSB7XFxcXG4gICAgICAgICAgICBoaWRlTG9hZGluZ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AgICAgICAgICAgIGNoYXB0ZXJOYW1lOiBcXFxcXFxcIuW6j+iogFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswXSxcXFxcbiAgICAgICAgICAgICAgICBlbmQ6IGludGVydmFsWzFdLFxcXFxuICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxcXG4gICAgICAgICAgICAgICAgY2hhcnN0OiBjaGFyc3RcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhcHRlck5hbWVzLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgIGxldCBuYW1lID0gY2hhcHRlck5hbWVzW2ldO1xcXFxuICAgICAgICBsZXQgaW50ZXJ2YWwgPSBpbnRlcnZhbHNbaSArIDFdO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9UWFRWaWV3ZXIudmlldyNhdXRvUGFnZSMjcmVhZFRoZW1lI1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBzdGFydDogaW50ZXJ2YWxbMF0sXFxcXG4gICAgICAgICAgICAgICAgZW5kOiBpbnRlcnZhbFsxXSxcXFxcbiAgICAgICAgICAgICAgICBjaGFwdGVyTmFtZTogbmFtZSxcXFxcbiAgICAgICAgICAgICAgICBwYXRoOiBwYXRoLFxcXFxuICAgICAgICAgICAgICAgIGNoYXJzdDogY2hhcnN0XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcbiAgICBzZXRSZXN1bHQobGF5b3V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XG4gICAgICAgICAgICAgICAgICAgIGlmIChyYW5rSXNSZXZlcnNlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByYW5rSXNSZXZlcnNlID0gXFxcXFxcXCJcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtJc1JldmVyc2UgPSBcXFxcXFxcIjFcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcXFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcXFxcXCIsIHJhbmtJc1JldmVyc2UpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcXFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXFxcXFwiYm9va3JhY2s6cmFua01ldGhvZFxcXFxcXFwiLCBuYW1lKTtcXFxcblxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfSwgbmFtZSlcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxuICAgIGxldCByYW5rTWV0aG9kTWFwID0ge1xcXFxuICAgICAgICBcXFxcXFxcIuezu+e7n1xcXFxcXFwiOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICBcXFxcXFxcIuWkp+Wwj1xcXFxcXFwiOiBcXFxcXFxcInNpemVcXFxcXFxcIixcXFxcbiAgICAgICAgXFxcXF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