Advertisement
xiaomianao666

邀您一起看:‘‘’’<strong><font color="red">晴园</front></strong>

Jan 23rd, 2023
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥‘‘’’<strong><font color="red">晴园</front></strong>@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS4u+mhtVwiLFwicGF0aFwiOlwiaG9tZVwiLFwicnVsZVwiOlwianM6XFxudmFyIGQgPSBbXTtcXG5pZiAoZmlsZUV4aXN0KFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL2FsaXN0X2NhY2hlLmpzb25cXFwiKSkge1xcbiAgICBsZXQgYWxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pXFxuICAgIHZhciBsID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9hbGlzdF9jYWNoZS5qc29uXFxcIikpXFxuICAgIHZhciB0ZXN0bGlzdCA9IGFsaXN0Lm1hcChmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICByZXR1cm4gaXRlbS51cmxcXG4gICAgfSlcXG4gICAgbC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgaWYgKCF0ZXN0bGlzdC5pbmNsdWRlcyhpdGVtLnVybC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dGlvblxcXCJdID0gcmVzLmRhdGEudG9rZW5cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdG9hc3QoXFxcIueZu+mZhuWksei0pVxcXCIpXFxuICAgICAgICAgICAgbG9nKHJlcylcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIui0puWPt+WvhueggemUmeivr1xcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICBpZiAocGF0aCA9PSBcXFwiL1xcXCIpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKame+4j+iuvue9rlxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBhbGlzdC5mb3JFYWNoKChpdGVtLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaSA9PSBzZWxlY3RlZCA/ICQucmVxdWlyZShcXFwiYXBpXFxcIikuY29sb3IoaXRlbS5uYW1lLCBcXFwicmVkXFxcIikgOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBpID09IHNlbGVjdGVkID8gXFxcIng1Oi8vXFxcIiArIG5vdy51cmwgOiAkKCkubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJzZWxlY3RlZFxcXCIsIGkgKyBcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSlcXG4gICAgICAgIGlmIChub3cuc2VhcmNoKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLwn5SOIOaQnOe0olxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9zZWFyY2g/cGFnZT1meXBhZ2UmdT1cXFwiICsgbm93LnVybCArIFxcXCImcGF0aD1cXFwiICsgcGF0aCxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICBub3c6IG5vd1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChub3cudXNlciAmJiBub3cucGFzc3dvcmQpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaWsOW7uuaWh+S7tuWkuVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiXFxcIikuaW5wdXQoKHBhdGgsIG5vdywgaGVhZGVycykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcImFwaS9mcy9ta2RpclxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IHBhdGggKyBcXFwiL1xcXCIgKyBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnNcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yib5bu65oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yib5bu65aSx6LSlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBwYXRoLCBub3csIGhlYWRlcnMpXFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaWsOW7uuaWh+S7tlxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiXFxcIikuaW5wdXQoKHBhdGgsIG5vdywgaGVhZGVycykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyc1tcXFwiRmlsZS1QYXRoXFxcIl0gPSBlbmNvZGVVUkkocGF0aCArIFxcXCIvXFxcIiArIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocmVxdWVzdChub3cudXJsICsgXFxcImFwaS9mcy9wdXRcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6IFxcXCJQVVRcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIm+W7uuaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIm+W7uuWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgcGF0aCwgbm93LCBoZWFkZXJzKVxcbiAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmt7vliqBhcmlhMuS7u+WKoVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiXFxcIiwgXFxcIuWkmuadoeeUqOWbnui9pumalOW8gFxcXCIpLmlucHV0KChwYXRoLCBub3csIGhlYWRlcnMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXCJhcGkvZnMvYWRkX2FyaWEyXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogcGF0aCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogaW5wdXQuc3BsaXQoXFxcIlxcXFxuXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzXFxuICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIm+W7uuaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIm+W7uuWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgcGF0aCwgbm93LCBoZWFkZXJzKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgIH0pXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSlcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICB9KVxcblxcbiAgICAgICAgLy8g5o6S5bqPXFxuICAgICAgICBzb3JyLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgaWYgKG5zb3J0ID09IGl0ZW0pIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXCLihpNcXFwiXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChuc29ydC5pbmNsdWRlcyhcXFwi5Y+NXFxcIikgJiYgbnNvcnQuaW5jbHVkZXMoaXRlbSkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXCLihpFcXFwiXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXCLihpVcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKFxcXCJzb3J0XFxcIiwgXFxcIum7mOiupFxcXCIpID09IGl0ZW0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJzb3J0XFxcIiwgaXRlbSArIFxcXCLlj41cXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJzb3J0XFxcIiwgaXRlbSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBsZXQgYmlkID0gcGF0aCArIFxcXCItbG9hZGluZy1cXFwiICsgTVlfUEFHRTtcXG4gICAgbGV0IGQyID0gW107XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuWKquWKm+WKoOi9veS4re+8jOivt+eojeWAmS4uLlxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogYmlkLFxcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9KVxcbiAgICBzZXRSZXN1bHQoZCk7XFxuXFxuICAgIHRyeSB7XFxuICAgICAgICAvLyDojrflj5bmlofku7bliJfooahcXG4gICAgICAgIHZhciBsaXN0ID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFwiYXBpL2ZzL2xpc3RcXFwiLCB7XFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGF0aFxcXCI6IHBhdGgsXFxuICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGFsaXN0W3NlbGVjdGVkXVtcXFwiYnJvd3Nlci1wYXNzd29yZFxcXCJdW3BhdGhdID8gYWxpc3Rbc2VsZWN0ZWRdW1xcXCJicm93c2VyLXBhc3N3b3JkXFxcIl1bcGF0aF0gOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcInBhZ2VcXFwiOiBNWV9QQUdFLFxcbiAgICAgICAgICAgICAgICBcXFwicGVyX3BhZ2VcXFwiOiAzMCxcXG4gICAgICAgICAgICAgICAgXFxcInJlZnJlc2hcXFwiOiBmYWxzZVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnNcXG4gICAgICAgIH0pKVxcbiAgICAgICAgaWYgKGxpc3QuY29kZSA9PSAyMDAgJiYgbGlzdC5kYXRhLmNvbnRlbnQpIHtcXG4gICAgICAgICAgICBzb3J0cyhsaXN0LmRhdGEuY29udGVudCwgbnNvcnQpXFxuICAgICAgICAgICAgbGlzdC5kYXRhLmNvbnRlbnQuZm9yRWFjaCgoaXRlbSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgdmFyIGRlc2MgPSBmb3JtYXREYXRlKGl0ZW0ubW9kaWZpZWQpICsgXFxcIiBcXFwiICsgZ2V0RmlsZVNpemUoaXRlbS5zaXplKVxcbiAgICAgICAgICAgICAgICB2YXIgZG93bl91cmwgPSBlbmNvZGVVUkkobm93LnVybCArIFxcXCJkXFxcIiArIChwYXRoID09IFxcXCIvXFxcIiA/IFxcXCJcXFwiIDogcGF0aCkgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUgKyBcXFwiP3NpZ249XFxcIiArIGl0ZW0uc2lnbilcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9ICQoKS5sYXp5UnVsZSgoaXRlbSwgdXJsLCBwYXRoLCBsaXN0LCB1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBjb25zdCB0eXBlX2RpY3QgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgMDogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZG93bmxvYWQ6Ly9cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAyOiAkLnRvU3RyaW5nKCh1cmwsIGxpc3QsIHUsIHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN1YnRpdGxlcyA9ICQucmVxdWlyZShcXFwiYXBpXFxcIikuZ2V0U3VidGl0bGVzKGxpc3QsIHUsIHBhdGgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdWJ0aXRsZXMubGVuZ3RoID4gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5hbWVsaXN0ID0gc3VidGl0bGVzLm1hcChmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKG5hbWVsaXN0LCAxLCBcXFwi6K+36YCJ5oup5a2X5bmVXFxcIikuc2VsZWN0KChzdWJ0aXRsZXMsIG5hbWVsaXN0LCB1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6IHN1YnRpdGxlc1tuYW1lbGlzdC5pbmRleE9mKGlucHV0KV0udXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHN1YnRpdGxlcywgbmFtZWxpc3QsIHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwsIGxpc3QsIHUsIHBhdGgpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcIiNpc011c2ljPXRydWUjXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgNDogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZG93bmxvYWQ6Ly9cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICA1OiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXCIjLmpwZ1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbS5pc19kaXIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9ob21lP3BhZ2U9ZnlwYWdlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLnJlcXVpcmUoXFxcImFwaVxcXCIpLmdldEh6bShpdGVtLm5hbWUpID09IFxcXCJwZGZcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL2FsaXN0LW9yZy5naXRodWIuaW8vcGRmLmpzL3dlYi92aWV3ZXIuaHRtbD9maWxlPVxcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5vZmZpY2UuaW5jbHVkZXMoJC5yZXF1aXJlKFxcXCJhcGlcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcIuW+rui9r1xcXCIsIFxcXCLosLfmrYxcXFwiXSkuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLlvq7ova9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImh0dHBzOi8vdmlldy5vZmZpY2VhcHBzLmxpdmUuY29tL29wL3ZpZXcuYXNweD9zcmM9XFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL2RvY3MuZ29vZ2xlLmNvbS9ndmlldz8mZW1iZWRkZWQ9dHJ1ZSZ1cmw9XFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXZhbCh0eXBlX2RpY3RbaXRlbS50eXBlXSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgZG93bl91cmwsIHBhdGgsIGxpc3QuZGF0YS5jb250ZW50LCBub3cudXJsKVxcbiAgICAgICAgICAgICAgICB2YXIgbG9uZ0NsaWNrID0gW11cXG4gICAgICAgICAgICAgICAgaWYgKCFpdGVtLmlzX2Rpcikge1xcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LiL6L29XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgdSwgcGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImRvd25sb2FkOi8vXFxcIiArIHVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBkb3duX3VybCwgcGF0aClcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIueUqOWFtuS7lui9r+S7tuaJk+W8gFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIHUsIHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRGaWxlKHUsIFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXCIgKyBpdGVtLm5hbWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwib3BlbkZpbGU6Ly9cXFwiICsgXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvXFxcIiArIGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGRvd25fdXJsLCBwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAobm93LnVzZXIgJiYgbm93LnBhc3N3b3JkKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruiupOWIoOmZpO+8n1xcXCIpLmNvbmZpcm0oKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcImFwaS9mcy9yZW1vdmVcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpcjogcGF0aCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtpdGVtLm5hbWVdXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6YeN5ZG95ZCNXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGl0ZW0ubmFtZSkuaW5wdXQoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcImFwaS9mcy9yZW5hbWVcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IHBhdGggKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6YeN5ZG95ZCN5oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6YeN5ZG95ZCN5aSx6LSlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogZ2V0SXRlbShcXFwic3R5bGVcXFwiLCBcXFwiYXZhdGFyXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGdldEljb24oaXRlbSksXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IChwYXRoID09IFxcXCIvXFxcIiA/IFxcXCIvXFxcIiA6IHBhdGggKyBcXFwiL1xcXCIpICsgaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgaWYgKGdldEl0ZW0oXFxcInN0eWxlXFxcIiwgXFxcImF2YXRhclxcXCIpID09IFxcXCJhdmF0YXJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYOKAmOKAmOKAmeKAmTxzbWFsbD48Zm9udCBjb2xvcj0nI2FhYWFhYSc+JHtkZXNjfTwvZm9udD48L3NtYWxsPmAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogKHBhdGggPT0gXFxcIi9cXFwiID8gXFxcIi9cXFwiIDogcGF0aCArIFxcXCIvXFxcIikgKyBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0gZWxzZSBpZiAobGlzdC5tZXNzYWdlID09IFxcXCJwYXNzd29yZCBpcyBpbmNvcnJlY3Qgb3IgeW91IGhhdmUgbm8gcGVybWlzc2lvblxcXCIpIHtcXG4gICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmtY/op4jlr4bnoIHplJnor69cXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIlxcXCIsIFxcXCLovpPlhaXlr4bnoIFcXFwiKS5pbnB1dCgoYWxpc3QsIHNlbGVjdGVkLCBwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBhbGlzdFtzZWxlY3RlZF1bXFxcImJyb3dzZXItcGFzc3dvcmRcXFwiXVtwYXRoXSA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYW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pc3RcXFwiLCBbXSkubWFwKGZ1bmN0aW9uKGkpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGkubmFtZVxcbiAgICAgICAgICAgIH0pLmluY2x1ZGVzKGlucHV0KSkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7Lnu4/mnInnm7jlkIznmoTnvZHnq5nkuoZcXFwiXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6ZO+5o6lIOekuuS+izpodHRwOi8vMTI3LjAuMC4xL1xcXCIpLmlucHV0KChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmICghaW5wdXQuaW5jbHVkZXMoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXCJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dFtpbnB1dC5sZW5ndGggLSAxXSAhPSBcXFwiL1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCArPSBcXFwiL1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChpbnB1dCArIFxcXCJhcGkvcHVibGljL3NldHRpbmdzXFxcIikpLmRhdGFcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImxpc3RcXFwiLCBbXSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiYnJvd3Nlci1wYXNzd29yZFxcXCI6IHt9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoXFxcIjogY29uZmlnLnNlYXJjaF9pbmRleCAmJiBjb25maWcuc2VhcmNoX2luZGV4ICE9IFxcXCJub25lXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIua3u+WKoOWksei0pe+8jOWcsOWdgOaXoOazleiuv+mXru+8gVxcXCIpXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpbnB1dClcXG4gICAgICAgIH1cXG4gICAgfSksXFxuICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbn0sIHtcXG4gICAgdGl0bGU6IFxcXCLliIbkuqtcXFwiLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgIHVybDogJChbXFxcIuS7heWIhuS6q+e9keermVxcXCIsIFxcXCLliIbkuqvnvZHnq5nliqDlr4bnoIFcXFwiXSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgIHZhciBsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwibGlzdFxcXCIsIFtdKVxcbiAgICAgICAgaWYgKGlucHV0ID09IFxcXCLku4XliIbkuqvnvZHnq5lcXFwiKSB7XFxuICAgICAgICAgICAgdmFyIGFsaXN0ID0gbGlzdC5tYXAoZnVuY3Rpb24oaXRlbSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBpdGVtLnVybCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJicm93c2VyLXBhc3N3b3JkXFxcIjoge31cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgdmFyIHVybCA9IHNoYXJlUGFzdGUoSlNPTi5zdHJpbmdpZnkoYWxpc3QpKVxcbiAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL0FsaXN0IFYz572R55uY5a+85YWl5Y+j5LukIOWFsVxcXCIgKyBhbGlzdC5sZW5ndGggKyBcXFwi5LiqQFxcXCIgKyB1cmwgKyBcXFwiQGltcG9ydD1qczpcXFwiICsgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2Nsb3VkaW1wb3J0P3J1bGU9QWxpc3QgVjNcXFwiKS5pbnB1dChpbnB1dClcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB2YXIgdXJsID0gc2hhcmVQYXN0ZShKU09OLnN0cmluZ2lmeShsaXN0KSlcXG4gICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9BbGlzdCBWM+e9keebmOWvvOWFpeWPo+S7pCDlhbFcXFwiICsgYWxpc3QubGVuZ3RoICsgXFxcIuS4qkBcXFwiICsgdXJsICsgXFxcIkBpbXBvcnQ9anM6XFxcIiArICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9jbG91ZGltcG9ydD9ydWxlPUFsaXN0IFYzXFxcIikuaW5wdXQoaW5wdXQpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgfSlcXG59KVxcbnZhciBsaXN0ID0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1dCgobGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5ZCN56ew5LiN6IO95Li656m6XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RvcmFnZTAuZ2V0SXRlbShcXFwibGlzdFxcXCIsIFtdKS5tYXAoZnVuY3Rpb24oaSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGkubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5pbmNsdWRlcyhpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sue7j+acieebuOWQjOeahOe9keermeS6hlxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldLm5hbWUgPSBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICBjYXNlIFxcXCLkv67mlLnpk77mjqVcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXS51cmwpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpbnB1dC5pbmNsdWRlcyhcXFwiaHR0cFxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/plJnor69cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dFtpbnB1dC5sZW5ndGggLSAxXSAhPSBcXFwiL1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldLnVybCA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuS/ruaUuei0puaIt+WvhueggVxcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldW1xcXCJ1c2VyXFxcIl0gPyBsaXN0W2ldW1xcXCJ1c2VyXFxcIl0gOiBcXFwiXFxcIiwgXFxcIui0puWPt1xcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXVtcXFwicGFzc3dvcmRcXFwiXSA/IGxpc3RbaV1bXFxcInBhc3N3b3JkXFxcIl0gOiBcXFwiXFxcIiwgXFxcIuWvhueggVxcXCIpLmlucHV0KCh1c2VyLCBsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV1bXFxcInVzZXJcXFwiXSA9IHVzZXJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXVtcXFwicGFzc3dvcmRcXFwiXSA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQsIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICBjYXNlIFxcXCLmjpLluo9cXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoaSArIDEgKyBcXFwiXFxcIiwgXFxcIuaLjeWIsOesrOWHoOS4qlxcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2tSYXRlKGlucHV0KSB744CA44CAXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZSA9IC9eWzAtOV0rLj9bMC05XSovOyAvL+WIpOaWreWtl+espuS4suaYr+WQpuS4uuaVsOWtly8v5Yik5pat5q2j5pW05pWwL1sx4oiSOV0rWzDiiJI5XeKIl13iiJcvXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIOOAgOOAgFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmUudGVzdChpbnB1dCnjgIDjgIBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoZWNrUmF0ZShpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGEgPSBwYXJzZUludChpbnB1dCkgLSAxIC8vIOebruagh1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYSA+IGxpc3QubGVuZ3RoICYmIGEgPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuS4jeiDveWkp+S6juWIl+ihqOaVsOmHj++8gVxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGVtcCA9IGxpc3RbYV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbYV0gPSBsaXN0W2ldXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldID0gdGVtcFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi6K+36L6T5YWl5q2j5pW05pWwXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIGl0ZW0sIGkpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiXFxuICAgIH0pXFxufSlcXG5zZXRSZXN1bHQoZCk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLku6PnoIFcIixcInBhdGhcIjpcImFwaVwiLFwicnVsZVwiOlwiJC5leHBvcnRzID0ge1xcbiAgICBjb2xvcjogZnVuY3Rpb24odGV4dCwgY29sb3IpIHtcXG4gICAgICAgIHJldHVybiBg4oCY4oCY4oCZ4oCZPHN0cm9uZz48Zm9udCBjb2xvcj1cXFwiJHtjb2xvcn1cXFwiPiR7dGV4dH08L2Zyb250Pjwvc3Ryb25nPmBcXG4gICAgfSxcXG4gICAgZ2V0SWNvbjogZnVuY3Rpb24oY29udGVudCkge1xcbiAgICAgICAgaWYgKGNvbnRlbnQuaXNfZGlyKSB7XFxuICAgICAgICAgICAgaW1nID0gXFxcImh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzI3NC5wbmdcXFwiXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGxldCBmaWxlTmFtZSA9IGNvbnRlbnQubmFtZS50b0xvd2VyQ2FzZSgpXFxuICAgICAgICAgICAgbGV0IGh6bSA9ICQucmVxdWlyZShcXFwiYXBpXFxcIikuZ2V0SHptKGZpbGVOYW1lKVxcbiAgICAgICAgICAgIGlmIChjb250ZW50LnRodW1iICYmIGNvbnRlbnQudHlwZSAhPSAwKSB7XFxuICAgICAgICAgICAgICAgIGltZyA9IGNvbnRlbnQudGh1bWJcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQubW92aWUuaW5jbHVkZXMoaHptKSkge1xcbiAgICAgICAgICAgICAgICBpbWcgPSBcXFwiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMzAucG5nXFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5hdWRpby5pbmNsdWRlcyhoem0pKSB7XFxuICAgICAgICAgICAgICAgIGltZyA9IFxcXCJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS80MC5wbmdcXFwiXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLnRleHQuaW5jbHVkZXMoaHptKSkge1xcbiAgICAgICAgICAgICAgICBpbWcgPSBcXFwiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvNzgucG5nXFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5pbWcuaW5jbHVkZXMoaHptKSkge1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FwiKSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgdmFyIGxpc3QgPSBKU09OLnBhcnNlKHBvc3QodXJsICsgXFxcImFwaS9mcy9zZWFyY2hcXFwiLCB7XFxuICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJlbnRcXFwiOiBnZXRQYXJhbShcXFwicGF0aFxcXCIpLFxcbiAgICAgICAgICAgICAgICBcXFwia2V5d29yZHNcXFwiOiBnZXRNeVZhcihcXFwia3dcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgIFxcXCJwYWdlXFxcIjogTVlfUEFHRSxcXG4gICAgICAgICAgICAgICAgXFxcInBlcl9wYWdlXFxcIjogMTAwXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pKVxcbiAgICAgICAgaWYgKGxpc3QuY29kZSA9PSAyMDAgJiYgbGlzdC5kYXRhLmNvbnRlbnQpIHtcXG4gICAgICAgICAgICBsaXN0LmRhdGEuY29udGVudC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgZGVzYyA9IGdldEZpbGVTaXplKGl0ZW0uc2l6ZSlcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9ICQoKS5sYXp5UnVsZSgoaXRlbSwgdSwgcGF0aCwgaGVhZGVycykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNpZ24gPSBKU09OLnBhcnNlKHBvc3QodSArIFxcXCJhcGkvZnMvZ2V0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGF0aFxcXCI6IGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhLnNpZ25cXG4gICAgICAgICAgICAgICAgICAgIHZhciB1cmwgPSBlbmNvZGVVUkkodSArIFxcXCJkXFxcIiArIGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lICsgXFxcIj9zaWduPVxcXCIgKyBzaWduKVxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdHlwZV9kaWN0ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIDA6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImRvd25sb2FkOi8vXFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgMjogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXCIjaXNNdXNpYz10cnVlI1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDQ6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImRvd25sb2FkOi8vXFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgNTogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFwiIy5qcGdcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0uaXNfZGlyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvaG9tZT9wYWdlPWZ5cGFnZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5yZXF1aXJlKFxcXCJhcGlcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSA9PSBcXFwicGRmXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaHR0cHM6Ly9hbGlzdC1vcmcuZ2l0aHViLmlvL3BkZi5qcy93ZWIvdmlld2VyLmh0bWw/ZmlsZT1cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQub2ZmaWNlLmluY2x1ZGVzKCQucmVxdWlyZShcXFwiYXBpXFxcIikuZ2V0SHptKGl0ZW0ubmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLlvq7ova9cXFwiLCBcXFwi6LC35q2MXFxcIl0pLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5b6u6L2vXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL3ZpZXcub2ZmaWNlYXBwcy5saXZlLmNvbS9vcC92aWV3LmFzcHg/c3JjPVxcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vZ3ZpZXc/JmVtYmVkZGVkPXRydWUmdXJsPVxcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwodHlwZV9kaWN0W2l0ZW0udHlwZV0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0sIG5vdy51cmwsIHBhdGgsIGhlYWRlcnMpXFxuICAgICAgICAgICAgICAgIHZhciBsb25nQ2xpY2sgPSBbXVxcbiAgICAgICAgICAgICAgICBpZiAoIWl0ZW0uaXNfZGlyKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkuIvovb1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCB1LCBwYXRoLCBoZWFkZXJzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZG93bmxvYWQ6Ly9cXFwiICsgZW5jb2RlVVJJKHUgKyBcXFwiZFxcXCIgKyBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSArIFxcXCI/c2lnbj1cXFwiICsgSlNPTi5wYXJzZShwb3N0KHUgKyBcXFwiYXBpL2ZzL2dldFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhdGhcXFwiOiBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEuc2lnbilcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBub3cudXJsLCBwYXRoLCBoZWFkZXJzKVxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi55So5YW25LuW6L2v5Lu25omT5byAXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgdSwgcGF0aCwgaGVhZGVycykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2lnbiA9IEpTT04ucGFyc2UocG9zdCh1ICsgXFxcImFwaS9mcy9nZXRcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXRoXFxcIjogaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhLnNpZ25cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRGaWxlKGVuY29kZVVSSSh1ICsgXFxcImRcXFwiICsgaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUgKyBcXFwiP3NpZ249XFxcIiArIHNpZ24pLCBcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9cXFwiICsgaXRlbS5uYW1lKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIm9wZW5GaWxlOi8vXFxcIiArIFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXCIgKyBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBub3cudXJsLCBwYXRoLCBoZWFkZXJzKVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAobm93LnVzZXIgJiYgbm93LnBhc3N3b3JkKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruiupOWIoOmZpO+8n1xcXCIpLmNvbmZpcm0oKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcImFwaS9mcy9yZW1vdmVcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpcjogaXRlbS5wYXJlbnQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbaXRlbS5uYW1lXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIumHjeWRveWQjVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChpdGVtLm5hbWUpLmlucHV0KChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXCJhcGkvZnMvcmVuYW1lXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXMgPT0gMjAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mk43kvZzmiJDlip9cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mk43kvZzlpLHotKVcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGdldEl0ZW0oXFxcInN0eWxlXFxcIiwgXFxcImF2YXRhclxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBnZXRJY29uKGl0ZW0pLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IGxvbmdDbGljayxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0SXRlbShcXFwic3R5bGVcXFwiLCBcXFwiYXZhdGFyXFxcIikgPT0gXFxcImF2YXRhclxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGDigJjigJjigJnigJk8c21hbGw+PGZvbnQgY29sb3I9JyNhYWFhYWEnPiR7ZGVzY308L2ZvbnQ+PC9zbWFsbD5gLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IGxvbmdDbGljayxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAg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gXFxcXFxcXCJwYXNzd29yZFxcXFxcXFwiOiBub3cucGFzc3dvcmQsXFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJvdHBfY29kZVxcXFxcXFwiOiBcXFxcXFxcIlxcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9KSlcXFxcbiAgICAgICAgaWYgKHJlcy5jb2RlID09IDIwMCkge1xcXFxuICAgICAgICAgICAgaGVhZGVyc1tcXFxcXFxcIkF1dGhvcml6YXRpb25cXFxcXFxcIl0gPSByZXMuZGF0YS50b2tlblxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgdG9hc3QoXFxcXFxcXCLnmbvpmYblpLHotKVcXFxcXFxcIilcXFxcbiAgICAgICAgICAgIGxvZyhyZXMpXFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIui0puWPt+WvhueggemUmeivr1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgc2V0UmVzdWx0KGQpXFxcXG4gICAgICAgIH1cXFxcbiAgICB9XFxcXG4gICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcXFxuICAgICAgICBpZiAocGF0aCA9PSBcXFxcXFxcIi9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLimpnvuI/orr7nva5cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIGFsaXN0LmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaSA9PSBzZWxlY3RlZCA/ICQucmVxdWlyZShcXFxcXFxcImFwaVxcXFxcXFwiKS5jb2xvcihpdGVtLm5hbWUsIFxcXFxcXFwicmVkXFxcXFxcXCIpIDogaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogaSA9PSBzZWxlY3RlZCA/IFxcXFxcXFwieDU6Ly9cXFxcXFxcIiArIG5vdy51cmwgOiAkKCkubGF6eVJ1bGUoKGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcXFxcXCJzZWxlY3RlZFxcXFxcXFwiLCBpICsgXFxcXFxcXCJcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBpKVxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIGlmIChub3cuc2VhcmNoKSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIvCflI4g5pCc57SiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2Uvc2VhcmNoP3BhZ2U9ZnlwYWdlJnU9XFxcXFxcXCIgKyBub3cudXJsICsgXFxcXFxcXCImcGF0aD1cXFxcXFxcIiArIHBhdGgsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICAgICAgICAgICAgICAgICAgbm93OiBub3dcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGlmIChub3cudXNlciAmJiBub3cucGFzc3dvcmQpIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5paw5bu65paH5Lu25aS5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIlxcXFxcXFwiKS5pbnB1dCgocGF0aCwgbm93LCBoZWFkZXJzKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXFxcXFwiYXBpL2ZzL21rZGlyXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBwYXRoICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpbnB1dFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXMgPT0gMjAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIm+W7uuaIkOWKn1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIm+W7uuWksei0pVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LCBwYXRoLCBub3csIGhlYWRlcnMpXFxcXG4gICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5paw5bu65paH5Lu2XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIlxcXFxcXFwiKS5pbnB1dCgocGF0aCwgbm93LCBoZWFkZXJzKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnNbXFxcXFxcXCJGaWxlLVBhdGhcXFxcXFxcIl0gPSBlbmNvZGVVUkkocGF0aCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaW5wdXQpXFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHJlcXVlc3Qobm93LnVybCArIFxcXFxcXFwiYXBpL2ZzL3B1dFxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogXFxcXFxcXCJQVVRcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liJvlu7rmiJDlip9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liJvlu7rlpLHotKVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCwgbm93LCBoZWFkZXJzKVxcXFxuICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIua3u+WKoGFyaWEy5Lu75YqhXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIuWkmuadoeeUqOWbnui9pumalOW8gFxcXFxcXFwiKS5pbnB1dCgocGF0aCwgbm93LCBoZWFkZXJzKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXFxcXFwiYXBpL2ZzL2FkZF9hcmlhMlxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogcGF0aCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBpbnB1dC5zcGxpdChcXFxcXFxcIlxcXFxcXFxcblxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXMgPT0gMjAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIm+W7uuaIkOWKn1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIm+W7uuWksei0pVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LCBwYXRoLCBub3csIGhlYWRlcnMpXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIlxcXFxuICAgICAgICB9KVxcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcXFxcXCJcXFxcbiAgICAgICAgfSlcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJpZ19ibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgIH0pXFxcXG5cXFxcbiAgICAgICAgLy8g5o6S5bqPXFxcXG4gICAgICAgIHNvcnIuZm9yRWFjaChpdGVtID0+IHtcXFxcbiAgICAgICAgICAgIGlmIChuc29ydCA9PSBpdGVtKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXFxcXFwi4oaTXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobnNvcnQuaW5jbHVkZXMoXFxcXFxcXCLlj41cXFxcXFxcIikgJiYgbnNvcnQuaW5jbHVkZXMoaXRlbSkpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBpdGVtICsgXFxcXFxcXCLihpFcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBpdGVtICsgXFxcXFxcXCLihpVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChpdGVtKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKFxcXFxcXFwic29ydFxcXFxcXFwiLCBcXFxcXFxcIum7mOiupFxcXFxcXFwiKSA9PSBpdGVtKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXFxcXFwic29ydFxcXFxcXFwiLCBpdGVtICsgXFxcXFxcXCLlj41cXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgfSB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5hbWUgKyBcXFxcXFxcIj9zaWduPVxcXFxcXFwiICsgaXRlbS5zaWduKVxcXFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSAkKCkubGF6eVJ1bGUoKGl0ZW0sIHVybCwgcGF0aCwgbGlzdCwgdSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCB0eXBlX2RpY3QgPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAwOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJkb3dubG9hZDovL1xcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgMjogJC50b1N0cmluZygodXJsLCBsaXN0LCB1LCBwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN1YnRpdGxlcyA9ICQucmVxdWlyZShcXFxcXFxcImFwaVxcXFxcXFwiKS5nZXRTdWJ0aXRsZXMobGlzdCwgdSwgcGF0aClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3VidGl0bGVzLmxlbmd0aCA+IDEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5hbWVsaXN0ID0gc3VidGl0bGVzLm1hcChmdW5jdGlvbihpdGVtKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXRlbS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKG5hbWVsaXN0LCAxLCBcXFxcXFxcIuivt+mAieaLqeWtl+W5lVxcXFxcXFwiKS5zZWxlY3QoKHN1YnRpdGxlcywgbmFtZWxpc3QsIHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogc3VidGl0bGVzW25hbWVsaXN0LmluZGV4T2YoaW5wdXQpXS51cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHN1YnRpdGxlcywgbmFtZWxpc3QsIHVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcXFxcXCIjaXNWaWRlbz10cnVlI1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsLCBsaXN0LCB1LCBwYXRoKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFxcXFxcIiNpc011c2ljPXRydWUjXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICA0OiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJkb3dubG9hZDovL1xcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgNTogJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXFxcXFwiIy5qcGdcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpdGVtLmlzX2Rpcikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2hvbWU/cGFnZT1meXBhZ2VcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQucmVxdWlyZShcXFxcXFxcImFwaVxcXFxcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSA9PSBcXFxcXFxcInBkZlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJodHRwczovL2FsaXN0LW9yZy5naXRodWIuaW8vcGRmLmpzL3dlYi92aWV3ZXIuaHRtbD9maWxlPVxcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5vZmZpY2UuaW5jbHVkZXMoJC5yZXF1aXJlKFxcXFxcXFwiYXBpXFxcXFxcXCIpLmdldEh6bShpdGVtLm5hbWUpKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXFxcXFwi5b6u6L2vXFxcXFxcXCIsIFxcXFxcXFwi6LC35q2MXFxcXFxcXCJdKS5zZWxlY3QoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFxcXFxcIuW+rui9r1xcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImh0dHBzOi8vdmlldy5vZmZpY2VhcHBzLmxpdmUuY29tL29wL3ZpZXcuYXNweD9zcmM9XFxcXFxcXCIgKyB1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJodHRwczovL2RvY3MuZ29vZ2xlLmNvbS9ndmlldz8mZW1iZWRkZWQ9dHJ1ZSZ1cmw9XFxcXFxcXCIgKyB1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXZhbCh0eXBlX2RpY3RbaXRlbS50eXBlXSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGRvd25fdXJsLCBwYXRoLCBsaXN0LmRhdGEuY29udGVudCwgbm93LnVybClcXFxcbiAgICAgICAgICAgICAgICB2YXIgbG9uZ0NsaWNrID0gW11cXFxcbiAgICAgICAgICAgICAgICBpZiAoIWl0ZW0uaXNfZGlyKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljay5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuS4i+i9vVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIHUsIHBhdGgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJkb3dubG9hZDovL1xcXFxcXFwiICsgdVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgZG93bl91cmwsIHBhdGgpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIueUqOWFtuS7lui9r+S7tuaJk+W8gFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIHUsIHBhdGgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEZpbGUodSwgXFxcXFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXFxcXFwiICsgaXRlbS5uYW1lKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcIm9wZW5GaWxlOi8vXFxcXFxcXCIgKyBcXFxcXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvXFxcXFxcXCIgKyBpdGVtLm5hbWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGRvd25fdXJsLCBwYXRoKVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAobm93LnVzZXIgJiYgbm93LnBhc3N3b3JkKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljay5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWIoOmZpFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwi56Gu6K6k5Yig6Zmk77yfXFxcXFxcXCIpLmNvbmZpcm0oKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFxcXFxcImFwaS9mcy9yZW1vdmVcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXI6IHBhdGgsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtpdGVtLm5hbWVdXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLph43lkb3lkI1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChpdGVtLm5hbWUpLmlucHV0KChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcXFxcXCJhcGkvZnMvcmVuYW1lXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogcGF0aCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/ph43lkb3lkI3miJDlip9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/ph43lkb3lkI3lpLHotKVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGdldEl0ZW0oXFxcXFxcXCJzdHlsZVxcXFxcXFwiLCBcXFxcXFxcImF2YXRhclxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBnZXRJY29uKGl0ZW0pLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiAocGF0aCA9PSBcXFxcXFxcIi9cXFxcXFxcIiA/IFxcXFxcXFwiL1xcXFxcXFwiIDogcGF0aCArIFxcXFxcXFwiL1xcXFxcXFwiKSArIGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLm5hbWVcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgaWYgKGdldEl0ZW0oXFxcXFxcXCJzdHlsZVxcXFxcXFwiLCBcXFxcXFxcImF2YXRhclxcXFxcXFwiKSA9PSBcXFxcXFxcImF2YXRhclxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGDigJjigJjigJnigJk8c21hbGw+PGZvbnQgY29sb3I9JyNhYWFhYWEnPiR7ZGVzY308L2ZvbnQ+PC9zbWFsbD5gLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBsb25nQ2xpY2ssXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogKHBhdGggPT0gXFxcXFxcXCIvXFxcXFxcXCIgPyBcXFxcXFxcIi9cXFxcXFxcIiA6IHBhdGggKyBcXFxcXFxcIi9cXFxcXFxcIikgKyBpdGVtLm5hbWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9IGVsc2UgaWYgKGxpc3QubWVzc2FnZSA9PSBcXFxcXFxcInBhc3N3b3JkIGlzIGluY29ycmVjdCBvciB5b3UgaGF2ZSBubyBwZXJtaXNzaW9uXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgIGQyLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpd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gICAgICAgfSkuaW5jbHVkZXMoaW5wdXQpKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3sue7j+acieebuOWQjOeahOe9keermeS6hlxcXFxcXFwiXFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIumTvuaOpSDnpLrkvos6aHR0cDovLzEyNy4wLjAuMS9cXFxcXFxcIikuaW5wdXQoKG5hbWUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoIWlucHV0LmluY2x1ZGVzKFxcXFxcXFwiaHR0cFxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0W2lucHV0Lmxlbmd0aCAtIDFdICE9IFxcXFxcXFwiL1xcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCArPSBcXFxcXFxcIi9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0ICsgXFxcXFxcXCJhcGkvcHVibGljL3NldHRpbmdzXFxcXFxcXCIpKS5kYXRhXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcXFxcXCJsaXN0XFxcXFxcXCIsIFtdKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuY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XFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuehruiupOWIoOmZpO+8n1xcXFxcXFwiKS5jb25maXJtKChsaXN0LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnNwbGljZShpLCAxKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFxcXFxcImxpc3RcXFxcXFxcIiwgbGlzdClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySXRlbShcXFxcXFxcInNlbGVjdGVkXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCLkv67mlLnlkI3np7BcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXS5uYW1lKS5pbnB1dCgobGlzdCwgaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WQjeensOS4jeiDveS4uuepulxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHN0b3JhZ2UwLmdldEl0ZW0oXFxcXFxcXCJsaXN0XFxcXFxcXCIsIFtdKS5tYXAoZnVuY3Rpb24oaSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuaW5jbHVkZXMoaW5wdXQpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/lt7Lnu4/mnInnm7jlkIznmoTnvZHnq5nkuoZcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldLm5hbWUgPSBpbnB1dFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcXFxcXCJsaXN0XFxcXFxcXCIsIGxpc3QpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcXFxuICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCLkv67mlLnpk77mjqVcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXS51cmwpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlucHV0LmluY2x1ZGVzKFxcXFxcXFwiaHR0cFxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6ZO+5o6l5qC85byP6ZSZ6K+vXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXRbaW5wdXQubGVuZ3RoIC0gMV0gIT0gXFxcXFxcXCIvXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV0udXJsID0gaW5wdXRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXFxcXFwibGlzdFxcXFxcXFwiLCBsaXN0KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXFxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICBjYXNlIFxcXFxcXFwi5L+u5pS56LSm5oi35a+G56CBXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGxpc3RbaV1bXFxcXFxcXCJ1c2VyXFxcXFxcXCJdID8gbGlzdFtpXVtcXFxcXFxcInVzZXJcXFxcXFxcIl0gOiBcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIui0puWPt1xcXFxcXFwiKS5pbnB1dCgobGlzdCwgaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXVtcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCJdID8gbGlzdFtpXVtcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCJdIDogXFxcXFxcXCJcXFxcXFxcIiwgXFxcXFxcXCLlr4bnoIFcXFxcXFxcIikuaW5wdXQoKHVzZXIsIGxpc3QsIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldW1xcXFxcXFwidXNlclxcXFxcXFwiXSA9IHVzZXJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldW1xcXFxcXFwicGFzc3dvcmRcXFxcXFxcIl0gPSBpbnB1dFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcXFxcXCJsaXN0XFxcXFxcXCIsIGxpc3QpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQsIGxpc3QsIGkpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcIuaOkuW6j1xcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChpICsgMSArIFxcXFxcXFwiXFxcXFxcXCIsIFxcXFxcXFwi5ouN5Yiw56ys5Yeg5LiqXFxcXFxcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjaGVja1JhdGUoaW5wdXQpIHvjgIDjgIBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmUgPSAvXlswLTldKy4/WzAtOV0qLzsgLy/liKTmlq3lrZfnrKbkuLLmmK/lkKbkuLrmlbDlrZcvL+WIpOaWreato+aVtOaVsC9bMeKIkjldK1sw4oiSOV3iiJdd4oiXL1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIOOAgOOAgFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZS50ZXN0KGlucHV0KeOAgOOAgFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoZWNrUmF0ZShpbnB1dCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYSA9IHBhcnNlSW50KGlucHV0KSAtIDEgLy8g55uu5qCHXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEgPiBsaXN0Lmxlbmd0aCAmJiBhID09IDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcXFxcXCLkuI3og73lpKfkuo7liJfooajmlbDph4/vvIFcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGVtcCA9IGxpc3RbYV1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFthXSA9IGxpc3RbaV1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXSA9IHRlbXBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFxcXFxcImxpc3RcXFxcXFxcIiwgbGlzdClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcXFxcXCLor7fovpPlhaXmraPmlbTmlbBcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSwgaXRlbSwgaSksXFxcXG4gICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiXFxcXG4gICAgfSlcXFxcbn0pXFxcXG5zZXRSZXN1bHQoZCk7XFxcIn0se1xcXCJjb2xfdHlwZVxcXCI6XFxcIm1vdmllXzNcXFwiLFxcXCJuYW1lXFxcIjpcXFwi5Luj56CBXFxcIixcXFwicGF0aFxcXCI6XFxcImFwaVxcXCIsXFxcInJ1bGVcXFwiOlxcXCIkLmV4cG9ydHMgPSB7XFxcXG4gICAgY29sb3I6IGZ1b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gICAgICAgICB9IGVsc2UgaWYgKCQudGV4dC5pbmNsdWRlcyhoem0pKSB7XFxcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcXFxcXCJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS83OC5wbmdcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLmltZy5pbmNsdWRlcyhoem0pKSB7XFxcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcXFxcXCJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS8zOC5wbmdcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLnlhc3VvLmluY2x1ZGVzKGh6bSkpIHtcXFxcbiAgICAgICAgICAgICAgICBpbWcgPSBcXFxcXFxcImh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzIwMS5wbmdcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLm9mZmljZS5pbmNsdWRlcyhoem0pKSB7XFxcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcXFxcXCJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS8xODUucG5nXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcXFxcXCJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS8yMzkucG5nXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICByZXR1cm4gaW1nXFxcXG4gICAgfSxcXFxcbiAgICBmb3JtYXREYXRlOiBmdW5jdGlvbih0aW1lKSB7XFxcXG4gICAgICAgIHJldHVybiB0aW1lLnNwbGl0KFxcXFxcXFwiVFxcXFxcXFwiKVswXSArIFxcXFxcXFwiIFxcXFxcXFwiICsgdG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xcXFwiYXBpL2ZzL3NlYXJjaFxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwicGFyZW50XFxcXFxcXCI6IGdldFBhcmFtKFxcXFxcXFwicGF0aFxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICBcXFxcXFxcImtleXdvcmRzXFxcXFxcXCI6IGdldE15VmFyKFxcXFxcXFwia3dcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJwYWdlXFxcXFxcXCI6IE1ZX1BBR0UsXFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJwZXJfcGFnZVxcXFxcXFwiOiAxMDBcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pKVxcXFxuICAgICAgICBpZiAobGlzdC5jb2RlID09IDIwMCAmJiBsaXN0LmRhdGEuY29udGVudCkge1xcXFxuICAgICAgICAgICAgbGlzdC5kYXRhLmNvbnRlbnQuZm9yRWFjaChpdGVtID0+IHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgZGVzYyA9IGdldEZpbGVTaXplKGl0ZW0uc2l6ZSlcXFxcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpdGVtLCB1LCBwYXRoLCBoZWFkZXJzKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBzaWduID0gSlNPTi5wYXJzZShwb3N0KHUgKyBcXFxcXFxcImFwaS9mcy9nZXRcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhdGhcXFxcXFxcIjogaXRlbS5wYXJlbnQgKyBcXFxcXFxcIi9cXFxcXFxcIiArIGl0ZW0ubmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEuc2lnblxcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gZW5jb2RlVVJJKHUgKyBcXFxcXFxcImRcXFxcXFxcIiArIGl0ZW0ucGFyZW50ICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpdGVtLm5hbWUgKyBcXFxcXFxcIj9zaWduPVxcXFxcXFwiICsgc2lnbilcXFxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdHlwZV9kaWN0ID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgMDogJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiZG93bmxvYWQ6Ly9cXFxcXFxcIiArIHVybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDI6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFxcXFxcIiNpc1ZpZGVvPXRydWUjXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcXFxcXCIjaXNNdXNpYz10cnVlI1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgNDogJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiZG93bmxvYWQ6Ly9cXFxcXFxcIiArIHVybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDU6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFxcXFxcIiMuanBnXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbS5pc19kaXIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vcGFnZS9ob21lP3BhZ2U9ZnlwYWdlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLnJlcXVpcmUoXFxcXFxcXCJhcGlcXFxcXFxcIikuZ2V0SHptKGl0ZW0ubmFtZSkgPT0gXFxcXFxcXCJwZGZcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaHR0cHM6Ly9hbGlzdC1vcmcuZ2l0aHViLmlvL3BkZi5qcy93ZWIvdmlld2VyLmh0bWw/ZmlsZT1cXFxcXFxcIiArIHVybFxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQub2ZmaWNlLmluY2x1ZGVzKCQucmVxdWlyZShcXFxcXFxcImFwaVxcXFxcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXFxcXFxcIuW+rui9r1xcXFxcXFwiLCBcXFxcXFxcIuiwt+atjFxcXFxcXFwiXSkuc2VsZWN0KCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcXFxcXCLlvq7ova9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJodHRwczovL3ZpZXcub2ZmaWNlYXBwcy5saXZlLmNvbS9vcC92aWV3LmFzcHg/c3JjPVxcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vZ3ZpZXc/JmVtYmVkZGVkPXRydWUmdXJsPVxcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwodHlwZV9kaWN0W2l0ZW0udHlwZV0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLCBub3cudXJsLCBwYXRoLCBoZWFkZXJzKVxcXFxuICAgICAgICAgICAgICAgIHZhciBsb25nQ2xpY2sgPSBbXVxcXFxuICAgICAgICAgICAgICAgIGlmICghaXRlbS5pc19kaXIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5LiL6L29XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgdSwgcGF0aCwgaGVhZGVycykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImRvd25sb2FkOi8vXFxcXFxcXCIgKyBlbmNvZGVVUkkodSArIFxcXFxcXFwiZFxcXFxcXFwiICsgaXRlbS5wYXJlbnQgKyBcXFxcXFxcIi9cXFxcXFxcIiArIGl0ZW0ubmFtZSArIFxcXFxcXFwiP3NpZ249XFxcXFxcXCIgKyBKU09OLnBhcnNlKHBvc3QodSArIFxcXFxcXFwiYXBpL2ZzL2dldFxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicGF0aFxcXFxcXFwiOiBpdGVtLnBhcmVudCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaXRlbS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEuc2lnbilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIG5vdy51cmwsIHBhdGgsIGhlYWRlcnMpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIueUqOWFtuS7lui9r+S7tuaJk+W8gFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIHUsIHBhdGgsIGhlYWRlcnMpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2lnbiA9IEpTT04ucGFyc2UocG9zdCh1ICsgXFxcXFxcXCJhcGkvZnMvZ2V0XFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJwYXRoXFxcXFxcXCI6IGl0ZW0ucGFyZW50ICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpdGVtLm5hbWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YS5zaWduXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRGaWxlKGVuY29kZVVSSSh1ICsgXFxcXFxcXCJkXFxcXFxcXCIgKyBpdGVtLnBhcmVudCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaXRlbS5uYW1lICsgXFxcXFxcXCI/c2lnbj1cXFxcXFxcIiArIHNpZ24pLCBcXFxcXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvXFxcXFxcXCIgKyBpdGVtLm5hbWUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwib3BlbkZpbGU6Ly9cXFxcXFxcIiArIFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9cXFxcXFxcIiArIGl0ZW0ubmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgbm93LnVybCwgcGF0aCwgaGVhZGVycylcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKG5vdy51c2VyICYmIG5vdy5wYXNzd29yZCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuehruiupOWIoOmZpO+8n1xcXFxcXFwiKS5jb25maXJtKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcXFxcXCJhcGkvZnMvcmVtb3ZlXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyOiBpdGVtLnBhcmVudCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW2l0ZW0ubmFtZV1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXMgPT0gMjAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIumHjeWRveWQjVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGl0ZW0ubmFtZSkuaW5wdXQoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFxcXFxcImFwaS9mcy9yZW5hbWVcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhcmVudCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/mk43kvZzmiJDlip9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/mk43kvZzlpLHotKVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogZ2V0SXRlbShcXFxcXFxcInN0eWxlXFxcXFxcXCIsIFxcXFxcXFwiYXZhdGFyXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGdldEljb24oaXRlbSksXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBsb25nQ2xpY2ssXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhcmVudCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpdGVtLm5hbWVcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgaWYgKGdldEl0ZW0oXFxcXFxcXCJzdHlsZVxcXFxcXFwiLCBcXFxcXFxcImF2YXRhclxcXFxcXFwiKSA9PSBcXFxcXFxcImF2YXRhclxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYOKAmOKAmOKAmeKAmTxzbWFsbD48Zm9udCBjb2xvcj0nI2FhYWFhYSc+JHtkZXNjfTwvZm9udD48L3NtYWxsPmAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IGxvbmdDbGljayxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhcmVudCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXRlbS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfS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2xvcj1cInJlZFwiPuaZtOWbrTwvZnJvbnQ+PC9zdHJvbmc+In0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement