Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥当前无Alist配置@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS4u+mhtVwiLFwicGF0aFwiOlwiaG9tZVwiLFwicnVsZVwiOlwianM6XFxudmFyIGQgPSBbXTtcXG5pZiAoZmlsZUV4aXN0KFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL2FsaXN0X2NhY2hlLmpzb25cXFwiKSkge1xcbiAgICBsZXQgYWxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pXFxuICAgIHZhciBsID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9hbGlzdF9jYWNoZS5qc29uXFxcIikpXFxuICAgIHZhciB0ZXN0bGlzdCA9IGFsaXN0Lm1hcChmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICByZXR1cm4gaXRlbS51cmxcXG4gICAgfSlcXG4gICAgbC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgaWYgKCF0ZXN0bGlzdC5pbmNsdWRlcyhpdGVtLnVybCkpIHtcXG4gICAgICAgICAgICBhbGlzdC5wdXNoKGl0ZW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AgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdG9hc3QoXFxcIueZu+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/op4jlr4bnoIHplJnor69cXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIlxcXCIsIFxcXCLovpPlhaXlr4bnoIFcXFwiKS5pbnB1dCgoYWxpc3QsIHNlbGVjdGVkLCBwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBhbGlzdFtzZWxlY3RlZF1bXFxcImJyb3dzZXItcGFzc3dvcmRcXFwiXVtwYXRoXSA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgYWxpc3Q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XG4gICAgICAgICAgICAgICAgcmV0dXJuIGkubmFtZVxcbiAgICAgICAgICAgIH0pLmluY2x1ZGVzKGlucHV0KSkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7Lnu4/mnInnm7jlkIznmoTnvZHnq5nkuoZcXFwiXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6ZO+5o6lIOekuuS+izpodHRwOi8vMTI3LjAuMC4xL1xcXCIpLmlucHV0KChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmICghaW5wdXQuaW5jbHVkZXMoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXCJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dFtpbnB1dC5sZW5ndGggLSAxXSAhPSBcXFwiL1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCArPSBcXFwiL1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHZhciBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoaW5wdXQgKyBcXFwiYXBpL3B1YmxpYy9zZXR0aW5nc1xcXCIpKS5kYXRhXFxuICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImxpc3RcXFwiLCBbXSlcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJicm93c2VyLXBhc3N3b3JkXFxcIjoge30sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaFxcXCI6IGNvbmZpZy5zZWFyY2hfaW5kZXggJiYgY29uZmlnLnNlYXJjaF9pbmRleCAhPSBcXFwibm9uZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgfVxcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiXFxufSwge1xcbiAgICB0aXRsZTogXFxcIuWIhuS6q1xcXCIsXFxuICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgdXJsOiAkKFtcXFwi5LuF5YiG5Lqr572R56uZXFxcIiwgXFxcIuWIhuS6q+e9keermeWKoOWvhueggVxcXCJdKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgdmFyIGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pXFxuICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuS7heWIhuS6q+e9keermVxcXCIpIHtcXG4gICAgICAgICAgICB2YXIgYWxpc3QgPSBsaXN0Lm1hcChmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGl0ZW0udXJsLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImJyb3dzZXItcGFzc3dvcmRcXFwiOiB7fVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB2YXIgdXJsID0gc2hhcmVQYXN0ZShKU09OLnN0cmlu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ueWQjeensFxcXCIsIFxcXCLkv67mlLnpk77mjqVcXFwiLCBcXFwi5L+u5pS56LSm5oi35a+G56CBXFxcIl0pLnNlbGVjdCgoYSwgaSkgPT4ge1xcbiAgICAgICAgICAgIHZhciBsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwibGlzdFxcXCIsIFtdKVxcbiAgICAgICAgICAgIHN3aXRjaCAoaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwi5Yig6ZmkXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7orqTliKDpmaTvvJ9cXFwiKS5jb25maXJtKChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5zcGxpY2UoaSwgMSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhckl0ZW0oXFxcInNlbGVjdGVkXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuS/ruaUueWQjeensFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldLm5hbWUpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lkI3np7DkuI3og73kuLrnqbpcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pLm1hcChmdW5jdGlvbihpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmluY2x1ZGVzKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5pyJ55u45ZCM55qE572R56uZ5LqGXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV0ubmFtZSA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuS/ruaUuemTvuaOpVxcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldLnVybCkuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlucHV0LmluY2x1ZGVzKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0W2lucHV0Lmxlbmd0aCAtIDFdICE9IFxcXCIvXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6ZO+5o6l5qC85byP6ZSZ6K+vXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV0udXJsID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwi5L+u5pS56LSm5oi35a+G56CBXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGxpc3RbaV1bXFxcInVzZXJcXFwiXSA/IGxpc3RbaV1bXFxcInVzZXJcXFwiXSA6IFxcXCJcXFwiLCBcXFwi6LSm5Y+3XFxcIikuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldW1xcXCJwYXNzd29yZFxcXCJdID8gbGlzdFtpXVtcXFwicGFzc3dvcmRcXFwiXSA6IFxcXCJcXFwiLCBcXFwi5a+G56CBXFxcIikuaW5wdXQoKHVzZXIsIGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXVtcXFwidXNlclxcXCJdID0gdXNlclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldW1xcXCJwYXNzd29yZFxcXCJdID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dCwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuaOkuW6j1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChpICsgMSArIFxcXCJcXFwiLCBcXFwi5ouN5Yiw56ys5Yeg5LiqXFxcIikuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjaGVja1JhdGUoaW5wdXQpIHvjgIDjgIBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlID0gL15bMC05XSsuP1swLTldKi87IC8v5Yik5pat5a2X56ym5Liy5piv5ZCm5Li65pWw5a2XLy/liKTmlq3mraPmlbTmlbAvWzHiiJI5XStbMOKIkjld4oiXXeKIly9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAg44CA44CAXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZS50ZXN0KGlucHV0KeOAgOOAgFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hlY2tSYXRlKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYSA9IHBhcnNlSW50KGlucHV0KSAtIDEgLy8g55uu5qCHXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhID4gbGlzdC5sZW5ndGggJiYgYSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5LiN6IO95aSn5LqO5YiX6KGo5pWw6YeP77yBXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wID0gbGlzdFthXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFthXSA9IGxpc3RbaV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV0gPSB0ZW1wXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLor7fovpPlhaXmraPmlbTmlbBcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgaXRlbSwgaSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCJcXG4gICAgfSlcXG59KVxcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS7o+eggVwiLFwicGF0aFwiOlwiYXBpXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMgPSB7XFxuICAgIGNvbG9yOiBmdW5jdGlvbih0ZXh0LCBjb2xvcikge1xcbiAgICAgICAgcmV0dXJuIGDigJjigJjigJnigJk8c3Ryb25nPjxmb250IGNvbG9yPVxcXCIke2NvbG9yfVxcXCI+JHt0ZXh0fTwvZnJvbnQ+PC9zdHJvbmc+YFxcbiAgICB9LFxcbiAgICBnZXRJY29uOiBmdW5jdGlvbihjb250ZW50KSB7XFxuICAgICAgICBpZiAoY29udGVudC5pc19kaXIpIHtcXG4gICAgICAgICAgICBpbWcgPSBcXFwiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMjc0LnBuZ1xcXCJcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgbGV0IGZpbGVOYW1lID0gY29udGVudC5uYW1lLnRvTG93ZXJDYXNlKClcXG4gICAgICAgICAgICBsZXQgaHptID0gJC5yZXF1aXJlKFxcXCJhcGlcXFwiKS5nZXRIem0oZmlsZU5hbWUpXFxuICAgICAgICAgICAgaWYgKGNvbnRlbnQudGh1bWIgJiYgY29udGVudC50eXBlICE9IDApIHtcXG4gICAgICAgICAgICAgICAgaW1nID0gY29udGVudC50aHVtYlxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5tb3ZpZS5pbmNsdWRlcyhoem0pKSB7XFxuICAgICAgICAgICAgICAgIGltZyA9IFxcXCJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS8zMC5wbmdcXFwiXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLmF1ZGlvLmluY2x1ZGVzKGh6bSkpIHtcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcImh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzQwLnBuZ1xcXCJcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQudGV4dC5pbmNsdWRlcyhoem0pKSB7XFxuICAgICAgICAgICAgICAgIGltZyA9IFxcXCJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS83OC5wbmdcXFwiXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLmltZy5pbmNsdWRlcyhoem0pKSB7XFxuICAgICAgICAgICAgICAgIGltZyA9IFxcXCJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS8zOC5wbmdcXFwiXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLnlhc3VvLmluY2x1ZGVzKGh6bSkpIHtcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcImh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzIwMS5wbmdcXFwiXFxuICAgICAgICAgICAgfSBlbHNlIGlmIC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AgcmV0dXJuIHNpemUudG9GaXhlZCgyKS5yZXBsYWNlKC8oXFxcXC4wMCkkLywgXFxcIlxcXCIpICsgdW5pdEZvcm1baV07XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFxcXCJFUlJPUjrmlbDlgLzov4flpKdcXFwiO1xcbiAgICB9LFxcbiAgICBnZXRIem06IGZ1bmN0aW9uKGZpbGVOYW1lKSB7XFxuICAgICAgICByZXR1cm4gZmlsZU5hbWUuc3Vic3RyKGZpbGVOYW1lLmxhc3RJbmRleE9mKFxcXCIuXFxcIikgKyAxKVxcbiAgICB9LFxcbiAgICBzb3J0czogZnVuY3Rpb24obGlzdCwgbWV0aG9kKSB7XFxuICAgICAgICBpZiAobWV0aG9kLmluY2x1ZGVzKFxcXCLlkI3np7BcXFwiKSkge1xcbiAgICAgICAgICAgIGxpc3Quc29ydChmdW5jdGlvbihhLCBiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBhLm5hbWUubG9jYWxlQ29tcGFyZShiLm5hbWUpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0gZWxzZSBpZiAobWV0aG9kLmluY2x1ZGVzKFxcXCLml7bpl7RcXFwiKSkge1xcbiAgICAgICAgICAgIGxpc3Quc29ydChmdW5jdGlvbihhLCBiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBhLm1vZGlmaWVkIC0gYi5tb2RpZmllZFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZC5pbmNsdWRlcyhcXFwi5aSn5bCPXFxcIikpIHtcXG4gICAgICAgICAgICBsaXN0LnNvcnQoZnVuY3Rpb24oYSwgYikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gYS5zaXplIC0gYi5zaXplXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChtZXRob2QuaW5jbHVkZXMoXFxcIuWPjVxcXCIpKSB7XFxuICAgICAgICAgICAgbGlzdC5yZXZlcnNlKCk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gbGlzdFxcbiAgICB9LFxcbiAgICBnZXRTdWJ0aXRsZXM6IGZ1bmN0aW9uKGxpc3QsIHVybCwgcGF0aCkge1xcbiAgICAgICAgY29uc3Qge1xcbiAgICAgICAgICAgIGdldEh6bVxcbiAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiYXBpXFxcIilcXG4gICAgICAgIGxldCBzID0gW11cXG4gICAgICAgIGxpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICBpZiAoJC5zdWJ0aXRsZS5pbmNsdWRlcyhnZXRIem0oaXRlbS5uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogZW5jb2RlVVJJKHVybCArIFxcXCJkXFxcIiArIChwYXRoID09IFxcXCIvXFxcIiA/IFxcXCJcXFwiIDogcGF0aCkgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUgKyBcXFwiP3NpZ249XFxcIiArIGl0ZW0uc2lnbilcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgcy51bnNoaWZ0KHtcXG4gICAgICAgICAgICBuYW1lOiBcXFwi5LiN6ZyA6KaB5a2X5bmVXFxcIlxcbiAgICAgICAgfSlcXG4gICAgICAgIHJldHVybiBzXFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLmkJzntKJcIixcInBhdGhcIjpcInNlYXJjaFwiLFwicnVsZVwiOlwianM6XFxudHJ5IHtcXG4gICAgdmFyIGQgPSBbXTtcXG4gICAgdmFyIHtcXG4gICAgICAgIGdldEljb24sXFxuICAgICAgICBnZXRGaWxlU2l6ZVxcbiAgIC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E15VmFyKFxcXCJrd1xcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgXFxcInBhZ2VcXFwiOiBNWV9QQUdFLFxcbiAgICAgICAgICAgICAgICBcXFwicGVyX3BhZ2VcXFwiOiAxMDBcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSkpXFxuICAgICAgICBpZiAobGlzdC5jb2RlID09IDIwMCAmJiBsaXN0LmRhdGEuY29udGVudCkge1xcbiAgICAgICAgICAgIGxpc3QuZGF0YS5jb250ZW50LmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBkZXNjID0gZ2V0RmlsZVNpemUoaXRlbS5zaXplKVxcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpdGVtLCB1LCBwYXRoLCBoZWFkZXJzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgc2lnbiA9IEpTT04ucGFyc2UocG9zdCh1ICsgXFxcImFwaS9mcy9nZXRcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXRoXFxcIjogaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEuc2lnblxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybCA9IGVuY29kZVVSSSh1ICsgXFxcImRcXFwiICsgaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUgKyBcXFwiP3NpZ249XFxcIiArIHNpZ24pXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCB0eXBlX2RpY3QgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgMDogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZG93bmxvYWQ6Ly9cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAyOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXCIjaXNWaWRlbz10cnVlI1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcIiNpc011c2ljPXRydWUjXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgNDogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZG93bmxvYWQ6Ly9cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICA1OiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXCIjLmpwZ1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbS5pc19kaXIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9ob21lP3BhZ2U9ZnlwYWdlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLnJlcXVpcmUoXFxcImFwaVxcXCIpLmdldEh6bShpdGVtLm5hbWUpID09IFxcXCJwZGZcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL2FsaXN0LW9yZy5naXRodWIuaW8vcGRmLmpzL3dlYi92aWV3ZXIuaHRtbD9maWxlPVxcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5vZmZpY2UuaW5jbHVkZXMoJC5yZXF1aXJlKFxcXCJhcGlcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcIuW+rui9r1xcXCIsIFxcXCLosLfmrYxcXFwiXSkuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLlvq7ova9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImh0dHBzOi8vdmlldy5vZmZpY2VhcHBzLmxpdmUuY29tL29wL3ZpZXcuYXNweD9zcmM9XFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL2RvY3MuZ29vZ2xlLmNvbS9ndmlldz8mZW1iZWRkZWQ9dHJ1ZSZ1cmw9XFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXZhbCh0eXBlX2RpY3RbaXRlbS50eXBlXSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgbm93LnVybCwgcGF0aCwgaGVhZGVycylcXG4gICAgICAgICAgICAgICAgdmFyIGxvbmdDbGljayA9IFtdXFxuICAgICAgICAgICAgICAgIGlmICghaXRlbS5pc19kaXIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljay5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS4i+i9vVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIHUsIHBhdGgsIGhlYWRlcnMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJkb3dubG9hZDovL1xcXCIgKyBlbmNvZGVVUkkodSArIFxcXCJkXFxcIiArIGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lICsgXFxcIj9zaWduPVxcXCIgKyBKU09OLnBhcnNlKHBvc3QodSArIFxcXCJhcGkvZnMvZ2V0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGF0aFxcXCI6IGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YS5zaWduKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIG5vdy51cmwsIHBhdGgsIGhlYWRlcnMpXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLnlKjlhbbku5bova/ku7bmiZPlvIBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCB1LCBwYXRoLCBoZWFkZXJzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzaWduID0gSlNPTi5wYXJzZShwb3N0KHUgKyBcXFwiYXBpL2ZzL2dldFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhdGhcXFwiOiBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEuc2lnblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEZpbGUoZW5jb2RlVVJJKHUgKyBcXFwiZFxcXCIgKyBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSArIFxcXCI/c2lnbj1cXFwiICsgc2lnbiksIFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXCIgKyBpdGVtLm5hbWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwib3BlbkZpbGU6Ly9cXFwiICsgXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvXFxcIiArIGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIG5vdy51cmwsIHBhdGgsIGhlYWRlcnMpXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChub3cudXNlciAmJiBub3cucGFzc3dvcmQpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljay5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu6K6k5Yig6Zmk77yfXFxcIikuY29uZmlybSgoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFwiYXBpL2ZzL3JlbW92ZVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyOiBpdGVtLnBhcmVudCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtpdGVtLm5hbWVdXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6YeN5ZG95ZCNXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGl0ZW0ubmFtZSkuaW5wdXQoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcImFwaS9mcy9yZW5hbWVcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aTjeS9nOaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aTjeS9nOWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogZ2V0SXRlbShcXFwic3R5bGVcXFwiLCBcXFwiYXZhdGFyXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGdldEljb24oaXRlbSksXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKFxcXCJzdHlsZVxcXCIsIFxcXCJhdmF0YXJcXFwiKSA9PSBcXFwiYXZhdGFyXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYOKAmOKAmOKAmeKAmTxzbWFsbD48Zm9udCBjb2xvcj0nI2FhYWFhYSc+JHtkZXNjfTwvZm9udD48L3NtYWxsPmAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0gZWxzZSBpZiAobGlzdC5jb2RlICE9IDIwMCkge1xcbiAgICAgICAgICAgIHRvYXN0KFxcXCLlh7rplJnkuoZcXFwiKVxcbiAgICAgICAgICAgIGxvZyhsaXN0Lm1lc3NhZ2UpXFxuICAgICAgICB9XFxuICAgIH1cXG59IGNhdGNoIChlKSB7XFxuICAgIHNldFJlc3VsdChbe1xcbiAgICAgICAgdGl0bGU6IFxcXCLorr7nva5cXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2NvbmZp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gICAgICAgICAgICAgcmV0dXJuIGkubmFtZVxcbiAgICAgICAgICAgIH0pLmluY2x1ZGVzKGlucHV0KSkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7Lnu4/mnInnm7jlkIznmoTnvZHnq5nkuoZcXFwiXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6ZO+5o6lIOekuuS+izpodHRwOi8vMTI3LjAuMC4xL1xcXCIpLmlucHV0KChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmICghaW5wdXQuaW5jbHVkZXMoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXCJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dFtpbnB1dC5sZW5ndGggLSAxXSAhPSBcXFwiL1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCArPSBcXFwiL1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHZhciBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoaW5wdXQgKyBcXFwiYXBpL3B1YmxpYy9zZXR0aW5nc1xcXCIpKS5kYXRhXFxuICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImxpc3RcXFwiLCBbXSlcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJicm93c2VyLXBhc3N3b3JkXFxcIjoge30sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaFxcXCI6IGNvbmZpZy5zZWFyY2hfaW5kZXggJiYgY29uZmlnLnNlYXJjaF9pbmRleCAhPSBcXFwibm9uZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgfVxcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiXFxufSwge1xcbiAgICB0aXRsZTogXFxcIuWIhuS6q1xcXCIsXFxuICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgdXJsOiAkKFtcXFwi5LuF5YiG5Lqr572R56uZXFxcIiwgXFxcIuWIhuS6q+e9keermeWKoOWvhueggVxcXCJdKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgdmFyIGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pXFxuICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuS7heWIhuS6q+e9keermVxcXCIpIHtcXG4gICAgICAgICAgICB2YXIgYWxpc3QgPSBsaXN0Lm1hcChmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGl0ZW0udXJsLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImJyb3dzZXItcGFzc3dvcmRcXFwiOiB7fVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB2YXIgdXJsID0gc2hhcmVQYXN0ZShKU09OLnN0cmluZ2lme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FxcXCIsIFxcXCLkv67mlLnpk77mjqVcXFwiLCBcXFwi5L+u5pS56LSm5oi35a+G56CBXFxcIl0pLnNlbGVjdCgoYSwgaSkgPT4ge1xcbiAgICAgICAgICAgIHZhciBsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwibGlzdFxcXCIsIFtdKVxcbiAgICAgICAgICAgIHN3aXRjaCAoaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwi5Yig6ZmkXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7orqTliKDpmaTvvJ9cXFwiKS5jb25maXJtKChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5zcGxpY2UoaSwgMSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhckl0ZW0oXFxcInNlbGVjdGVkXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuS/ruaUueWQjeensFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldLm5hbWUpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lkI3np7DkuI3og73kuLrnqbpcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pLm1hcChmdW5jdGlvbihpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmluY2x1ZGVzKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5pyJ55u45ZCM55qE572R56uZ5LqGXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV0ubmFtZSA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuS/ruaUuemTvuaOpVxcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldLnVybCkuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlucHV0LmluY2x1ZGVzKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0W2lucHV0Lmxlbmd0aCAtIDFdICE9IFxcXCIvXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6ZO+5o6l5qC85byP6ZSZ6K+vXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV0udXJsID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwi5L+u5pS56LSm5oi35a+G56CBXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGxpc3RbaV1bXFxcInVzZXJcXFwiXSA/IGxpc3RbaV1bXFxcInVzZXJcXFwiXSA6IFxcXCJcXFwiLCBcXFwi6LSm5Y+3XFxcIikuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldW1xcXCJwYXNzd29yZFxcXCJdID8gbGlzdFtpXVtcXFwicGFzc3dvcmRcXFwiXSA6IFxcXCJcXFwiLCBcXFwi5a+G56CBXFxcIikuaW5wdXQoKHVzZXIsIGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXVtcXFwidXNlclxcXCJdID0gdXNlclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldW1xcXCJwYXNzd29yZFxcXCJdID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dCwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuaOkuW6j1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChpICsgMSArIFxcXCJcXFwiLCBcXFwi5ouN5Yiw56ys5Yeg5LiqXFxcIikuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjaGVja1JhdGUoaW5wdXQpIHvjgIDjgIBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlID0gL15bMC05XSsuP1swLTldKi87IC8v5Yik5pat5a2X56ym5Liy5piv5ZCm5Li65pWw5a2XLy/liKTmlq3mraPmlbTmlbAvWzHiiJI5XStbMOKIkjld4oiXXeKIly9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAg44CA44CAXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZS50ZXN0KGlucHV0KeOAgOOAgFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hlY2tSYXRlKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYSA9IHBhcnNlSW50KGlucHV0KSAtIDEgLy8g55uu5qCHXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhID4gbGlzdC5sZW5ndGggJiYgYSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5LiN6IO95aSn5LqO5YiX6KGo5pWw6YeP77yBXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wID0gbGlzdFthXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFthXSA9IGxpc3RbaV1cXG4gICAgICAgICAgICAgICAgICAg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BlbHNlIHtcXFxcbiAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi55m76ZmG5aSx6LSlXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICBsb2cocmVzKVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLotKblj7flr4bnoIHplJnor69cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIHNldFJlc3VsdChkKVxcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIGlmIChNWV9QQUdFID09IDEpIHtcXFxcbiAgICAgICAgaWYgKHBhdGggPT0gXFxcXFxcXCIvXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi4pqZ77iP6K6+572uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICBhbGlzdC5mb3JFYWNoKChpdGVtLCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGkgPT0gc2VsZWN0ZWQgPyAkLnJlcXVpcmUoXFxcXFxcXCJhcGlcXFxcXFxcIikuY29sb3IoaXRlbS5uYW1lLCBcXFxcXFxcInJlZFxcXFxcXFwiKSA6IGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGkgPT0gc2VsZWN0ZWQgPyBcXFxcXFxcIng1Oi8vXFxcXFxcXCIgKyBub3cudXJsIDogJCgpLmxhenlSdWxlKChpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXFxcXFwic2VsZWN0ZWRcXFxcXFxcIiwgaSArIFxcXFxcXFwiXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgaSlcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYmxhbmtfYmxvY2tcXFxcXFxcIlxcXFxuICAgICAgICB9KVxcXFxuICAgICAgICBpZiAobm93LnNlYXJjaCkge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLwn5SOIOaQnOe0olxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL3NlYXJjaD9wYWdlPWZ5cGFnZSZ1PVxcXFxcXFwiICsgbm93LnVybCArIFxcXFxcXFwiJnBhdGg9XFxcXFxcXCIgKyBwYXRoLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgIG5vdzogbm93XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpZiAobm93LnVzZXIgJiYgbm93LnBhc3N3b3JkKSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuaWsOW7uuaWh+S7tuWkuVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCJcXFxcXFxcIikuaW5wdXQoKHBhdGgsIG5vdywgaGVhZGVycykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFxcXFxcImFwaS9mcy9ta2RpclxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogcGF0aCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaW5wdXRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVyc1xcXFxuICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liJvlu7rmiJDlip9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liJvlu7rlpLHotKVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCwgbm93LCBoZWFkZXJzKVxcXFxuICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuaWsOW7uuaWh+S7tlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCJcXFxcXFxcIikuaW5wdXQoKHBhdGgsIG5vdywgaGVhZGVycykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzW1xcXFxcXFwiRmlsZS1QYXRoXFxcXFxcXCJdID0gZW5jb2RlVVJJKHBhdGggKyBcXFxcXFxcIi9cXFxcXFxcIiArIGlucHV0KVxcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShyZXF1ZXN0KG5vdy51cmwgKyBcXFxcXFxcImFwaS9mcy9wdXRcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6IFxcXFxcXFwiUFVUXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yib5bu65oiQ5YqfXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yib5bu65aSx6LSlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sIHBhdGgsIG5vdywgaGVhZGVycylcXFxcbiAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLmt7vliqBhcmlhMuS7u+WKoVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCJcXFxcXFxcIiwgXFxcXFxcXCLlpJrmnaHnlKjlm57ovabpmpTlvIBcXFxcXFxcIikuaW5wdXQoKHBhdGgsIG5vdywgaGVhZGVycykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFxcXFxcImFwaS9mcy9hZGRfYXJpYTJcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogaW5wdXQuc3BsaXQoXFxcXFxcXCJcXFxcXFxcXG5cXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVyc1xcXFxuICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liJvlu7rmiJDlip9cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liJvlu7rlpLHotKVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCwgbm93LCBoZWFkZXJzKVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJsaW5lX2JsYW5rXFxcXFxcXCJcXFxcbiAgICAgICAgfSlcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJpZ19ibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJiaWdfYmxhbmtfYmxvY2tcXFxcXFxcIlxcXFxuICAgICAgICB9KVxcXFxuXFxcXG4gICAgICAgIC8vIOaOkuW6j1xcXFxuICAgICAgICBzb3JyLmZvckVhY2goaXRlbSA9PiB7XFxcXG4gICAgICAgICAgICBpZiAobnNvcnQgPT0gaXRlbSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGl0ZW0gKyBcXFxcXFxcIuKGk1xcXFxcXFwiXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKG5zb3J0LmluY2x1ZGVzKFxcXFxcXFwi5Y+NXFxcXFxcXCIpICYmIG5zb3J0LmluY2x1ZGVzKGl0ZW0pKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXFxcXFwi4oaRXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbSArIFxcXFxcXFwi4oaVXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaXRlbSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0SXRlbShcXFxcXFxcInNvcnRcXFxcXFxcIiwgXFxcXFxcXCLpu5jorqRcXFxcXFxcIikgPT0gaXRlbSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFxcXFxcInNvcnRcXFxcXFxcIiwgaXRlbSArIFxcXFxcXFwi5Y+NXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXFxcXFwic29ydFxcXFxcXFwiLCBpdGVtKVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSlcXFxcbiAgICAgICAgICAgIH0pXFxcXG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gICAgICAgICAgICAgIFxcXFxcXFwicGVyX3BhZ2VcXFxcXFxcIjogMzAsXFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJyZWZyZXNoXFxcXFxcXCI6IGZhbHNlXFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnNcXFxcbiAgICAgICAgfSkpXFxcXG4gICAgICAgIGlmIChsaXN0LmNvZGUgPT0gMjAwICYmIGxpc3QuZGF0YS5jb250ZW50KSB7XFxcXG4gICAgICAgICAgICBzb3J0cyhsaXN0LmRhdGEuY29udGVudCwgbnNvcnQpXFxcXG4gICAgICAgICAgICBsaXN0LmRhdGEuY29udGVudC5mb3JFYWNoKChpdGVtLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIHZhciBkZXNjID0gZm9ybWF0RGF0ZShpdGVtLm1vZGlmaWVkKSArIFxcXFxcXFwiIFxcXFxcXFwiICsgZ2V0RmlsZVNpemUoaXRlbS5zaXplKVxcXFxuICAgICAgICAgICAgICAgIHZhciBkb3duX3VybCA9IGVuY29kZVVSSShub3cudXJsICsgXFxcXFxcXCJkXFxcXFxcXCIgKyAocGF0aCA9PSBcXFxcXFxcIi9cXFxcXFxcIiA/IFxcXFxcXFwiXFxcXFxcXCIgOiBwYXRoKSArIFxcXFxcXFwiL1xcXFxcXFwiICsgaXRlbS5uYW1lICsgXFxcXFxcXCI/c2lnbj1cXFxcXFxcIiArIGl0ZW0uc2lnbilcXFxcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpdGVtLCB1cmwsIHBhdGgsIGxpc3QsIHUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdHlwZV9kaWN0ID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgMDogJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiZG93bmxvYWQ6Ly9cXFxcXFxcIiArIHVybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDI6ICQudG9TdHJpbmcoKHVybCwgbGlzdCwgdSwgcGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdWJ0aXRsZXMgPSAkLnJlcXVpcmUoXFxcXFxcXCJhcGlcXFxcXFxcIikuZ2V0U3VidGl0bGVzKGxpc3QsIHUsIHBhdGgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN1YnRpdGxlcy5sZW5ndGggPiAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuYW1lbGlzdCA9IHN1YnRpdGxlcy5tYXAoZnVuY3Rpb24oaXRlbSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0ZW0ubmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChuYW1lbGlzdCwgMSwgXFxcXFxcXCLor7fpgInmi6nlrZfluZVcXFxcXFxcIikuc2VsZWN0KChzdWJ0aXRsZXMsIG5hbWVsaXN0LCB1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybF0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6IHN1YnRpdGxlc1tuYW1lbGlzdC5pbmRleE9mKGlucHV0KV0udXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzdWJ0aXRsZXMsIG5hbWVsaXN0LCB1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXFxcXFwiI2lzVmlkZW89dHJ1ZSNcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCwgbGlzdCwgdSwgcGF0aCksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcXFxcXCIjaXNNdXNpYz10cnVlI1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgNDogJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiZG93bmxvYWQ6Ly9cXFxcXFxcIiArIHVybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDU6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFxcXFxcIiMuanBnXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbS5pc19kaXIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vcGFnZS9ob21lP3BhZ2U9ZnlwYWdlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLnJlcXVpcmUoXFxcXFxcXCJhcGlcXFxcXFxcIikuZ2V0SHptKGl0ZW0ubmFtZSkgPT0gXFxcXFxcXCJwZGZcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaHR0cHM6Ly9hbGlzdC1vcmcuZ2l0aHViLmlvL3BkZi5qcy93ZWIvdmlld2VyLmh0bWw/ZmlsZT1cXFxcXFxcIiArIHVybFxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQub2ZmaWNlLmluY2x1ZGVzKCQucmVxdWlyZShcXFxcXFxcImFwaVxcXFxcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXFxcXFxcIuW+rui9r1xcXFxcXFwiLCBcXFxcXFxcIuiwt+atjFxcXFxcXFwiXSkuc2VsZWN0KCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcXFxcXCLlvq7ova9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJodHRwczovL3ZpZXcub2ZmaWNlYXBwcy5saXZlLmNvbS9vcC92aWV3LmFzcHg/c3JjPVxcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vZ3ZpZXc/JmVtYmVkZGVkPXRydWUmdXJsPVxcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwodHlwZV9kaWN0W2l0ZW0udHlwZV0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLCBkb3duX3VybCwgcGF0aCwgbGlzdC5kYXRhLmNvbnRlbnQsIG5vdy51cmwpXFxcXG4gICAgICAgICAgICAgICAgdmFyIGxvbmdDbGljayA9IFtdXFxcXG4gICAgICAgICAgICAgICAgaWYgKCFpdGVtLmlzX2Rpcikge1xcXFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLkuIvovb1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCB1LCBwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiZG93bmxvYWQ6Ly9cXFxcXFxcIiArIHVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGRvd25fdXJsLCBwYXRoKVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLnlKjlhbbku5bova/ku7bmiZPlvIBcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCB1LCBwYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRGaWxlKHUsIFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9cXFxcXFxcIiArIGl0ZW0ubmFtZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJvcGVuRmlsZTovL1xcXFxcXFwiICsgXFxcXFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXFxcXFwiICsgaXRlbS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBkb3duX3VybCwgcGF0aClcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKG5vdy51c2VyICYmIG5vdy5wYXNzd29yZCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuehruiupOWIoOmZpO+8n1xcXFxcXFwiKS5jb25maXJtKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcXFxcXCJhcGkvZnMvcmVtb3ZlXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyOiBwYXRoLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbaXRlbS5uYW1lXVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6YeN5ZG95ZCNXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoaXRlbS5uYW1lKS5pbnB1dCgoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXFxcXFwiYXBpL2ZzL3JlbmFtZVxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IHBhdGggKyBcXFxcXFxcIi9cXFxcXFxcIiArIGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6YeN5ZG95ZCN5oiQ5YqfXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6YeN5ZG95ZCN5aSx6LSlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZDIucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBnZXRJdGVtKFxcXFxcXFwic3R5bGVcXFxcXFxcIiwgXFxcXFxcXCJhdmF0YXJcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogZ2V0SWNvbihpdGVtKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IGxvbmdDbGljayxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogKHBhdGggPT0gXFxcXFxcXCIvXFxcXFxcXCIgPyBcXFxcXFxcIi9cXFxcXFxcIiA6IHBhdGggKyBcXFxcXFxcIi9cXFxcXFxcIikgKyBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKFxcXFxcXFwic3R5bGVcXFxcXFxcIiwgXFxcXFxcXCJhdmF0YXJcXFxcXFxcIikgPT0gXFxcXFxcXCJhdmF0YXJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBg4oCY4oCY4oCZ4oCZPHNtYWxsPjxmb250IGNvbG9yPScjYWFhYWFhJz4ke2Rlc2N9PC9mb250Pjwvc21hbGw+YCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IChwYXRoID09IFxcXFxcXFwiL1xcXFxcXFwiID8gXFxcXFxcXCIvXFxcXFxcXCIgOiBwYXRoICsgXFxcXFxcXCIvXFxcXFxcXCIpICsgaXRlbS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfSBlbHNlIGlmIChsaXN0Lm1lc3NhZ2UgPT0gXFxcXFxcXCJwYXNzd29yZCBpcyBpbmNvcnJlY3Qgb3IgeW91IGhhdmUgbm8gcGVybWlzc2lvblxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICBkMi5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLmtY/op4jlr4bnoIHplJnor69cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiXFxcXFxcXCIsIFxcXFxcXFwi6L6T5YWl5a+G56CBXFxcXFxcXCIpLmlucHV0KChhbGlzdCwgc2VsZWN0ZWQsIHBhdGgpID0+IHtcXFxc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pLmlucHV0KChuYW1lKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKCFpbnB1dC5pbmNsdWRlcyhcXFxcXFxcImh0dHBcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/plJnor69cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dFtpbnB1dC5sZW5ndGggLSAxXSAhPSBcXFxcXFxcIi9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXQgKz0gXFxcXFxcXCIvXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0ICsgXFxcXFxcXCJhcGkvcHVibGljL3NldHRpbmdzXFxcXFxcXCIpKS5kYXRhXFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFxcXFxcImxpc3RcXFxcXFxcIiwgW10pXFxcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpbnB1dCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiYnJvd3Nlci1wYXNzd29yZFxcXFxcXFwiOiB7fSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwic2VhcmNoXFxcXFxcXCI6IGNvbmZpZy5zZWFyY2hfaW5kZXggJiYgY29uZmlnLnNlYXJjaF9pbmRleCAhPSBcXFxcXFxcIm5vbmVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXFxcXFwibGlzdFxcXFxcXFwiLCBsaXN0KVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSwgaW5wdXQpXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KSxcXFxcbiAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzJcXFxcXFxcIlxcXFxufSwge1xcXFxuICAgIHRpdGxlOiBcXFxcXFxcIuWIhuS6q1xcXFxcXFwiLFxcXFxuICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMlxcXFxcXFwiLFxcXFxuICAgIHVybDogJChbXFxcXFxcXCLku4XliIbkuqvnvZHnq5lcXFxcXFxcIiwgXFxcXFxcXCLliIbkuqvnvZHnq5nliqDlr4bnoIFcXFxcXFxcIl0pLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgIHZhciBsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFxcXFxcImxpc3RcXFxcXFxcIiwgW10pXFxcXG4gICAgICAgIGlmIChpbnB1dCA9PSBcXFxcXFxcIuS7heWIhuS6q+e9keermVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICB2YXIgYWxpc3QgPSBsaXN0Lm1hcChmdW5jdGlvbihpdGVtKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGl0ZW0udXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImJyb3dzZXItcGFzc3dvcmRcXFxcXFxcIjoge31cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgdmFyIHVybCA9IHNoYXJlUGFzdGUoS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XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldLm5hbWUpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5ZCN56ew5LiN6IO95Li656m6XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RvcmFnZTAuZ2V0SXRlbShcXFxcXFxcImxpc3RcXFxcXFxcIiwgW10pLm1hcChmdW5jdGlvbihpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpLm5hbWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5pbmNsdWRlcyhpbnB1dCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3sue7j+acieebuOWQjOeahOe9keermeS6hlxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV0ubmFtZSA9IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFxcXFxcImxpc3RcXFxcXFxcIiwgbGlzdClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcIuS/ruaUuemTvuaOpVxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldLnVybCkuaW5wdXQoKGxpc3QsIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaW5wdXQuaW5jbHVkZXMoXFxcXFxcXCJodHRwXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/plJnor69cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dFtpbnB1dC5sZW5ndGggLSAxXSAhPSBcXFxcXFxcIi9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6ZO+5o6l5qC85byP6ZSZ6K+vXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXS51cmwgPSBpbnB1dFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcXFxcXCJsaXN0XFxcXFxcXCIsIGxpc3QpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcXFxuICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCLkv67mlLnotKbmiLflr4bnoIFcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXVtcXFxcXFxcInVzZXJcXFxcXFxcIl0gPyBsaXN0W2ldW1xcXFxcXFwidXNlclxcXFxcXFwiXSA6IFxcXFxcXFwiXFxcXFxcXCIsIFxcXFxcXFwi6LSm5Y+3XFxcXFxcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldW1xcXFxcXFwicGFzc3dvcmRcXFxcXFxcIl0gPyBsaXN0W2ldW1xcXFxcXFwicGFzc3dvcmRcXFxcXFxcIl0gOiBcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIuWvhueggVxcXFxcXFwiKS5pbnB1dCgodXNlciwgbGlzdCwgaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV1bXFxcXFxcXCJ1c2VyXFxcXFxcXCJdID0gdXNlclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV1bXFxcXFxcXCJwYXNzd29yZFxcXFxcXFwiXSA9IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFxcXFxcImxpc3RcXFxcXFxcIiwgbGlzdClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dCwgbGlzdCwgaSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXFxcbiAgICAgICAgICAgICAgICBjYXNlIFxcXFxcXFwi5o6S5bqPXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGkgKyAxICsgXFxcXFxcXCJcXFxcXFxcIiwgXFxcXFxcXCLmi43liLDnrKzlh6DkuKpcXFxcXFxcIikuaW5wdXQoKGxpc3QsIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrUmF0ZShpbnB1dCkge+OAgOOAgFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZSA9IC9eWzAtOV0rLj9bMC05XSovOyAvL+WIpOaWreWtl+espuS4suaYr+WQpuS4uuaVsOWtly8v5Yik5pat5q2j5pW05pWwL1sx4oiSOV0rWzDiiJI5XeKIl13iiJcvXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAg44CA44CAXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlLnRlc3QoaW5wdXQp44CA44CAXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hlY2tSYXRlKGlucHV0KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhID0gcGFyc2VJbnQoaW5wdXQpIC0gMSAvLyDnm67moIdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYSA+IGxpc3QubGVuZ3RoICYmIGEgPT0gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuS4jeiDveWkp+S6juWIl+ihqOaVsOmHj++8gVxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wID0gbGlzdFthXVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2FdID0gbGlzdFtpXVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldID0gdGVtcFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXFxcXFwibGlzdFxcXFxcXFwiLCBsaXN0KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAg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c2lnbj1cXFxcXFxcIiArIGl0ZW0uc2lnbilcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgICAgICBzLnVuc2hpZnQoe1xcXFxuICAgICAgICAgICAgbmFtZTogXFxcXFxcXCLkuI3pnIDopoHlrZfluZVcXFxcXFxcIlxcXFxuICAgICAgICB9KVxcXFxuICAgICAgICByZXR1cm4gc1xcXFxuICAgIH1cXFxcbn1cXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLmkJzntKJcXFwiLFxcXCJwYXRoXFxcIjpcXFwic2VhcmNoXFxcIixcXFwicnVsZVxcXCI6XFxcImpzOlxcXFxudHJ5IHtcXFxcbiAgICB2YXIgZCA9IFtdO1xcXFxuICAgIHZhciB7XFxcXG4gICAgICAgIGdldEljb24sXFxcXG4gICAgICAgIGdldEZpbGVTaXplXFxcXG4gICAgfSA9ICQucmVxdWlyZShcXFxcXFxcImFwaVxcXFxcXFwiKVxcXFxuICAgIHZhciB1cmwgPSBnZXRQYXJhbShcXFxcXFxcInVcXFxcXFxcIilcXFxcbiAgICB2YXIgbm93ID0gTVlfUEFSQU1TLm5vd1xcXFxuICAgIHZhciBoZWFkZXJzID0gTVlfUEFSQU1TLmhlYWRlcnNcXFxcbiAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxcXG4gICAgICAgIGQudW5zaGlmdCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLmkJzntKJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJrd1xcXFxcXFwiLCBpbnB1dClcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIGNvb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G4gICAgICAgICAgICBsaXN0LmRhdGEuY29udGVudC5mb3JFYWNoKGl0ZW0gPT4ge1xcXFxuICAgICAgICAgICAgICAgIHZhciBkZXNjID0gZ2V0RmlsZVNpemUoaXRlbS5zaXplKVxcXFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSAkKCkubGF6eVJ1bGUoKGl0ZW0sIHUsIHBhdGgsIGhlYWRlcnMpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNpZ24gPSBKU09OLnBhcnNlKHBvc3QodSArIFxcXFxcXFwiYXBpL2ZzL2dldFxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicGF0aFxcXFxcXFwiOiBpdGVtLnBhcmVudCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaXRlbS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YS5zaWduXFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB1cmwgPSBlbmNvZGVVUkkodSArIFxcXFxcXFwiZFxcXFxcXFwiICsgaXRlbS5wYXJlbnQgKyBcXFxcXFxcIi9cXFxcXFxcIiArIGl0ZW0ubmFtZSArIFxcXFxcXFwiP3NpZ249XFxcXFxcXCIgKyBzaWduKVxcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCB0eXBlX2RpY3QgPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAwOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJkb3dubG9hZDovL1xcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgMjogJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXFxcXFwiI2lzVmlkZW89dHJ1ZSNcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFxcXFxcIiNpc011c2ljPXRydWUjXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICA0OiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJkb3dubG9hZDovL1xcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgNTogJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXFxcXFwiIy5qcGdcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpdGVtLmlzX2Rpcikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2hvbWU/cGFnZT1meXBhZ2VcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQucmVxdWlyZShcXFxcXFxcImFwaVxcXFxcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSA9PSBcXFxcXFxcInBkZlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJodHRwczovL2FsaXN0LW9yZy5naXRodWIuaW8vcGRmLmpzL3dlYi92aWV3ZXIuaHRtbD9maWxlPVxcXFxcXFwiICsgdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5vZmZpY2UuaW5jbHVkZXMoJC5yZXF1aXJlKFxcXFxcXFwiYXBpXFxcXFxcXCIpLmdldEh6bShpdGVtLm5hbWUpKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXFxcXFwi5b6u6L2vXFxcXFxcXCIsIFxcXFxcXFwi6LC35q2MXFxcXFxcXCJdKS5zZWxlY3QoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFxcXFxcIuW+rui9r1xcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImh0dHBzOi8vdmlldy5vZmZpY2VhcHBzLmxpdmUuY29tL29wL3ZpZXcuYXNweD9zcmM9XFxcXFxcXCIgKyB1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJodHRwczovL2RvY3MuZ29vZ2xlLmNvbS9ndmlldz8mZW1iZWRkZWQ9dHJ1ZSZ1cmw9XFxcXFxcXCIgKyB1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXZhbCh0eXBlX2RpY3RbaXRlbS50eXBlXSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0sIG5vdy51cmwsIHBhdGgsIGhlYWRlcnMpXFxcXG4gICAgICAgICAgICAgICAgdmFyIGxvbmdDbGljayA9IFtdXFxcXG4gICAgICAgICAgICAgICAgaWYgKCFpdGVtLmlzX2Rpcikge1xcXFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLkuIvovb1cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCB1LCBwYXRoLCBoZWFkZXJzKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiZG93bmxvYWQ6Ly9cXFxcXFxcIiArIGVuY29kZVVSSSh1ICsgXFxcXFxcXCJkXFxcXFxcXCIgKyBpdGVtLnBhcmVudCArIFxcXFxcXFwiL1xcXFxcXFwiICsgaXRlbS5uYW1lICsgXFxcXFxcXCI/c2lnbj1cXFxcXFxcIiArIEpTT04ucGFyc2UocG9zdCh1ICsgXFxcXFxcXCJhcGkvZnMvZ2V0XFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJwYXRoXFxcXFxcXCI6IGl0ZW0ucGFyZW50ICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpdGVtLm5hbWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YS5zaWduKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgbm93LnVybCwgcGF0aCwgaGVhZGVycylcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi55So5YW25LuW6L2v5Lu25omT5byAXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgdSwgcGF0aCwgaGVhZGVycykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzaWduID0gSlNPTi5wYXJzZShwb3N0KHUgKyBcXFxcXFxcImFwaS9mcy9nZXRcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhdGhcXFxcXFxcIjogaXRlbS5wYXJlbnQgKyBcXFxcXFxcIi9cXFxcXFxcIiArIGl0ZW0ubmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhLnNpZ25cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEZpbGUoZW5jb2RlVVJJKHUgKyBcXFxcXFxcImRcXFxcXFxcIiArIGl0ZW0ucGFyZW50ICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpdGVtLm5hbWUgKyBcXFxcXFxcIj9zaWduPVxcXFxcXFwiICsgc2lnbiksIFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9cXFxcXFxcIiArIGl0ZW0ubmFtZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJvcGVuRmlsZTovL1xcXFxcXFwiICsgXFxcXFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXFxcXFwiICsgaXRlbS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBub3cudXJsLCBwYXRoLCBoZWFkZXJzKVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAobm93LnVzZXIgJiYgbm93LnBhc3N3b3JkKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljay5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWIoOmZpFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwi56Gu6K6k5Yig6Zmk77yfXFxcXFxcXCIpLmNvbmZpcm0oKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFxcXFxcImFwaS9mcy9yZW1vdmVcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXI6IGl0ZW0ucGFyZW50LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbaXRlbS5uYW1lXVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6YeN5ZG95ZCNXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoaXRlbS5uYW1lKS5pbnB1dCgoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXFxcXFwiYXBpL2ZzL3JlbmFtZVxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGFyZW50ICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogaW5wdXRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXMgPT0gMjAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+aTjeS9nOaIkOWKn1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+aTjeS9nOWksei0pVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBnZXRJdGVtKFxcXFxcXFwic3R5bGVcXFxcXFxcIiwgXFxcXFxcXCJhdmF0YXJcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogZ2V0SWNvbihpdGVtKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IGxvbmdDbGljayxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGFyZW50ICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGl0ZW0ubmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0SXRlbShcXFxcXFxcInN0eWxlXFxcXFxcXCIsIFxcXFxcXFwiYXZhdGFyXFxcXFxcXCIpID09IFxcXFxcXFwiYXZhdGFyXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBg4oCY4oCY4oCZ4oCZPHNtYWxsPjxmb250IGNvbG9yPScjYWFhYWFhJz4ke2Rlc2N9PC9mb250Pjwvc21hbGw+YCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogbG9uZ0NsaWNrLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGFyZW50ICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpdGVtLm5hbWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9IGVsc2UgaWYgKGxpc3QuY29kZSAhPSAyMDApIHtcXFxcbiAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi5Ye66ZSZ5LqGXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICBsb2cobGlzdC5tZXNzYWdlKVxcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxufSBjYXRjaCAoZSkge1xcXFxuICAgIHNldFJlc3VsdChbe1xcXFxuICAgICAgICB0aXRsZTogXFxcXFxcXCLorr7nva5cXFxcXFxcIixcXFxcbiAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFxcXFxcIixcXFxcbiAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiXFxcXG4gICAgfV0pXFxcXG4gICAgbG9nKGUubWVzc2FnZSlcXFxcbiAgICB0b2FzdChcXFxcXFxcIueoi+W6j+WHuueOsOmUmeivr++8jOivt+mHjeivlVxcXFxcXFwiKVxcXFxufVxcXFxuc2V0UmVzdWx0KGQpO1xcXC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