Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@Alist V3@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoiQWxpc3QgVjMiLCJhdXRob3IiOiJKb2UiLCJ1cmwiOiJoaWtlcjovL2VtcHR5P3BhZ2U9ZnlwYWdlIiwidmVyc2lvbiI6MTMsImNvbF90eXBlIjoibW92aWVfMyIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidG9vbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOiQucmVxdWlyZShcImhvbWVcIikiLCJzZWFyY2hfdXJsIjoiIiwiZ3JvdXAiOiLlt6XlhbciLCJzZWFyY2hGaW5kIjoiIiwiZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsImRldGFpbF9maW5kX3J1bGUiOiIiLCJzZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsInNkZXRhaWxfZmluZF9ydWxlIjoiIiwidWEiOiJtb2JpbGUiLCJwcmVSdWxlIjoiJC5leHRlbmQoe1xuICAgIHRleHQ6IFtcImh0bVwiLCBcImh0bWxcIiwgXCJ4bWxcIiwgXCJqYXZhXCIsIFwicHJvcGVydGllc1wiLCBcInNxbFwiLCBcImpzXCIsIFwibWRcIiwgXCJqc29uXCIsIFwiY29uZlwiLCBcImluaVwiLCBcInZ1ZVwiLCBcInBocFwiLCBcInB5XCIsIFwiYmF0XCIsIFwiZ2l0aWdub3JlXCIsIFwieW1sXCIsIFwiZ29cIiwgXCJzaFwiLCBcImNcIiwgXCJjcHBcIiwgXCJoXCIsIFwiaHBwXCIsIFwidHN4XCIsIFwidHh0XCIsIFwiZXB1YlwiLCBcImF6dzNcIiwgXCJtb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AgICAgICAgICAgXFxcIm90cF9jb2RlXFxcIjogXFxcIlxcXCJcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSkpXFxuICAgICAgICBpZiAocmVzLmNvZGUgPT0gMjAwKSB7XFxuICAgICAgICAgICAgaGVhZGVyc1tcXFwiQXV0aG9yaXphdGlvblxcXCJdID0gcmVzLmRhdGEudG9rZW5cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdG9hc3QoXFxcIueZu+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/IFxcXCIvXFxcIiA6IHBhdGggKyBcXFwiL1xcXCIpICsgaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBcXFwicGxheWxpc3QgbWFpblxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSBlbHNlIGlmIChsaXN0Lm1lc3NhZ2UgPT0gXFxcInBhc3N3b3JkIGlzIGluY29ycmVjdCBvciB5b3UgaGF2ZSBubyBwZXJtaXNzaW9uXFxcIikge1xcbiAgICAgICAgICAgIGQyLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIua1j+iniOWvhueggemUmeivr1xcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiXFxcIiwgXFxcIui+k+WFpeWvhueggVxcXCIpLmlucHV0KChhbGlzdCwgc2VsZWN0ZWQsIHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGFsaXN0W3NlbGVjdGVkXVtcXFwiYnJvd3Nlci1wYXNzd29yZFxcXCJdW3BhdGhdID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBhbGlzdClcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgfSwgYWxpc3QsIHNlbGVjdGVkLCBwYXRoKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2UgaWYgKGxpc3QuY29kZSAhPSAyMDApIHtcXG4gICAgICAgICAgICB0b2FzdChcXFwi5Ye66ZSZ5LqGXFxcIilcXG4gICAgICAgICAgICBsb2cobGlzdC5tZXNzYWdlKVxcbiAgICAgICAgfVxcbiAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuWHuueOsOmUmeivr1xcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1xcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6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9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0W2lucHV0Lmxlbmd0aCAtIDFdICE9IFxcXCIvXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0ICs9IFxcXCIvXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChpbnB1dCArIFxcXCJhcGkvcHVibGljL3NldHRpbmdzXFxcIikpLmRhdGFcXG4gICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwibGlzdFxcXCIsIFtdKVxcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaW5wdXQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImJyb3dzZXItcGFzc3dvcmRcXFwiOiB7fSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoXFxcIjogY29uZmlnLnNlYXJjaF9pbmRleCAmJiBjb25maWcuc2VhcmNoX2luZGV4ICE9IFxcXCJub25lXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgaW5wdXQpXFxuICAgICAgICB9XFxuICAgIH0pLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG59LCB7XFxuICAgIHRpdGxlOiBcXFwi5YiG5LqrXFxcIixcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiLFxcbiAgICB1c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El0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySXRlbShcXFwic2VsZWN0ZWRcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwi5L+u5pS55ZCN56ewXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGxpc3RbaV0ubmFtZSkuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WQjeensOS4jeiDveS4uuepulxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHN0b3JhZ2UwLmdldEl0ZW0oXFxcImxpc3RcXFwiLCBbXSkubWFwKGZ1bmN0aW9uKGkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuaW5jbHVkZXMoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7Lnu4/mnInnm7jlkIznmoTnvZHnq5nkuoZcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXS5uYW1lID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwi5L+u5pS56ZO+5o6lXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGxpc3RbaV0udXJsKS5pbnB1dCgobGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaW5wdXQuaW5jbHVkZXMoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6ZO+5o6l5qC85byP6ZSZ6K+vXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXRbaW5wdXQubGVuZ3RoIC0gMV0gIT0gXFxcIi9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/plJnor69cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXS51cmwgPSBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICBjYXNlIFxcXCLkv67mlLnotKbmiLflr4bnoIFcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXVtcXFwidXNlclxcXCJdID8gbGlzdFtpXVtcXFwidXNlclxcXCJdIDogXFxcIlxcXCIsIFxcXCLotKblj7dcXFwiKS5pbnB1dCgobGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGxpc3RbaV1bXFxcInBhc3N3b3JkXFxcIl0gPyBsaXN0W2ldW1xcXCJwYXNzd29yZFxcXCJdIDogXFxcIlxcXCIsIFxcXCLlr4bnoIFcXFwiKS5pbnB1dCgodXNlciwgbGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldW1xcXCJ1c2VyXFxcIl0gPSB1c2VyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV1bXFxcInBhc3N3b3JkXFxcIl0gPSBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlucHV0LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgY2FzZSBcXFwi5o6S5bqPXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGkgKyAxICsgXFxcIlxcXCIsIFxcXCLmi43liLDnrKzlh6DkuKpcXFwiKS5pbnB1dCgobGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrUmF0ZShpbnB1dCkge+OAgOOAgFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmUgPSAvXlswLTldKy4/WzAtOV0qLzsgLy/liKTmlq3lrZfnrKbkuLLmmK/lkKbkuLrmlbDlrZcvL+WIpOaWreato+aVtOaVsC9bMeKIkjldK1sw4oiSOV3iiJdd4oiXL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICDjgIDjgIBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlLnRlc3QoaW5wdXQp44CA44CAXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGVja1JhdGUoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhID0gcGFyc2VJbnQoaW5wdXQpIC0gMSAvLyDnm67moIdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEgPiBsaXN0Lmxlbmd0aCAmJiBhID09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLkuI3og73lpKfkuo7liJfooajmlbDph4/vvIFcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRlbXAgPSBsaXN0W2FdXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2FdID0gbGlzdFtpXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXSA9IHRlbXBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuivt+i+k+WFpeato+aVtOaVsFxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICB9XFxuIC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AgIGlmIChtZXRob2QuaW5jbHVkZXMoXFxcIuWQjeensFxcXCIpKSB7XFxuICAgICAgICAgICAgbGlzdC5zb3J0KGZ1bmN0aW9uKGEsIGIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGEubmFtZS5sb2NhbGVDb21wYXJlKGIubmFtZSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSBlbHNlIGlmIChtZXRob2QuaW5jbHVkZXMoXFxcIuaXtumXtFxcXCIpKSB7XFxuICAgICAgICAgICAgbGlzdC5zb3J0KGZ1bmN0aW9uKGEsIGIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGEubW9kaWZpZWQgLSBiLm1vZGlmaWVkXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0gZWxzZSBpZiAobWV0aG9kLmluY2x1ZGVzKFxcXCLlpKflsI9cXFwiKSkge1xcbiAgICAgICAgICAgIGxpc3Quc29ydChmdW5jdGlvbihhLCBiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBhLnNpemUgLSBiLnNpemVcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKG1ldGhvZC5pbmNsdWRlcyhcXFwi5Y+NXFxcIikpIHtcXG4gICAgICAgICAgICBsaXN0LnJldmVyc2UoKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBsaXN0XFxuICAgIH0sXFxuICAgIGdldFN1YnRpdGxlczogZnVuY3Rpb24obGlzdCwgdXJsLCBwYXRoKSB7XFxuICAgICAgICBjb25zdCB7XFxuICAgICAgICAgICAgZ2V0SHptXFxuICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJhcGlcXFwiKVxcbiAgICAgICAgbGV0IHMgPSBbXVxcbiAgICAgICAgbGlzdC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIGlmICgkLnN1YnRpdGxlLmluY2x1ZGVzKGdldEh6bShpdGVtLm5hbWUpKSkge1xcbiAgICAgICAgICAgICAgICBzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBlbmNvZGVVUkkodXJsICsgXFxcImRcXFwiICsgKHBhdGggPT0gXFxcIi9cXFwiID8gXFxcIlxcXCIgOiBwYXRoKSArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSArIFxcXCI/c2lnbj1cXFwiICsgaXRlbS5zaWduKVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICBzLnVuc2hpZnQoe1xcbiAgICAgICAgICAgIG5hbWU6IFxcXCLkuI3pnIDopoHlrZfluZVcXFwiXFxuICAgICAgICB9KVxcbiAgICAgICAgcmV0dXJuIHNcXG4gICAgfVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaQnOe0olwiLFwicGF0aFwiOlwic2VhcmNoXCIsXCJydWxlXCI6XCJqczpcXG50cnkge1xcbiAgICB2YXIgZCA9IFtdO1xcbiAgICB2YXIge1xcbiAgICAgICAgZ2V0SWNvbixcXG4gICAgICAgIGdldEZpbGVTaXplXFxuICAgIH0gPSAkLnJlcXVpcmUoXFxcImFwaVxcXCIpXFxuICAgIHZhciB1cmwgPSBnZXRQYXJhbShcXFwidVxcXCIpXFxuICAgIHZhciBub3cgPSBNWV9QQVJBTVMubm93XFxuICAgIHZhciBoZWFkZXJzID0gTVlfUEFSQU1TLmhlYWRlcnNcXG4gICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgZC51bnNoaWZ0KHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuaQnOe0olxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImt3XFxcIiwgaW5wdXQpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKFxcXCJrd1xcXCIsIFxcXCJcXFwiKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgdmFyIHBhdGggPSBnZXRQYXJhbShcXFwicGF0aFxcXCIpXFxuICAgIGlmIChnZXRNeVZhcihcXFwia3dcXFwiLCBcXFwiXFxcIikgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgIHZhciBsaXN0ID0gSlNPTi5wYXJzZShwb3N0KHVybCArIFxcXCJhcGkvZnMvc2VhcmNoXFxcIiwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyZW50XFxcIjogZ2V0UGFyYW0oXFxcInBhdGhcXFwiKSxcXG4gICAgICAgICAgICAgICAgXFxcImtleXdvcmRzXFxcIjogZ2V0TXlWYXIoXFxcImt3XFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICBcXFwicGFnZVxcXCI6IE1ZX1BBR0UsXFxuICAgICAgICAgICAgICAgIFxcXCJwZXJfcGFnZVxcXCI6IDEwMFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KSlcXG4gICAgICAgIGlmIChsaXN0LmNvZGUgPT0gMjAwICYmIGxpc3QuZGF0YS5jb250ZW50KSB7XFxuICAgICAgICAgICAgbGlzdC5kYXRhLmNvbnRlbnQuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICAgICAgdmFyIGRlc2MgPSBnZXRGaWxlU2l6ZShpdGVtLnNpemUpXFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSAkKCkubGF6eVJ1bGUoKGl0ZW0sIHUsIHBhdGgsIGhlYWRlcnMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBzaWduID0gSlNPTi5wYXJzZShwb3N0KHUgKyBcXFwiYXBpL2ZzL2dldFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhdGhcXFwiOiBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YS5zaWduXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gZW5jb2RlVVJJKHUgKyBcXFwiZFxcXCIgKyBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSArIFxcXCI/c2lnbj1cXFwiICsgc2lnbilcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHR5cGVfZGljdCA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAwOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJkb3dubG9hZDovL1xcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDI6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgMzogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFwiI2lzTXVzaWM9dHJ1ZSNcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICA0OiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJkb3dubG9hZDovL1xcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDU6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcIiMuanBnXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGlmIChpdGVtLmlzX2Rpcikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL2hvbWU/cGFnZT1meXBhZ2VcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQucmVxdWlyZShcXFwiYXBpXFxcIikuZ2V0SHptKGl0ZW0ubmFtZSkgPT0gXFxcInBkZlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImh0dHBzOi8vYWxpc3Qtb3JnLmdpdGh1Yi5pby9wZGYuanMvd2ViL3ZpZXdlci5odG1sP2ZpbGU9XFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLm9mZmljZS5pbmNsdWRlcygkLnJlcXVpcmUoXFxcImFwaVxcXCIpLmdldEh6bShpdGVtLm5hbWUpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXFwi5b6u6L2vXFxcIiwgXFxcIuiwt+atjFxcXCJdKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuW+rui9r1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaHR0cHM6Ly92aWV3Lm9mZmljZWFwcHMubGl2ZS5jb20vb3Avdmlldy5hc3B4P3NyYz1cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImh0dHBzOi8vZG9jcy5nb29nbGUuY29tL2d2aWV3PyZlbWJlZGRlZD10cnVlJnVybD1cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBldmFsKHR5cGVfZGljdFtpdGVtLnR5cGVdKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLCBub3cudXJsLCBwYXRoLCBoZWFkZXJzKVxcbiAgICAgICAgICAgICAgICB2YXIgbG9uZ0NsaWNrID0gW11cXG4gICAgICAgICAgICAgICAgaWYgKCFpdGVtLmlzX2Rpcikge1xcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LiL6L29XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgdSwgcGF0aCwgaGVhZGVycykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImRvd25sb2FkOi8vXFxcIiArIGVuY29kZVVSSSh1ICsgXFxcImRcXFwiICsgaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUgKyBcXFwiP3NpZ249XFxcIiArIEpTT04ucGFyc2UocG9zdCh1ICsgXFxcImFwaS9mcy9nZXRcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXRoXFxcIjogaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhLnNpZ24pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgbm93LnVybCwgcGF0aCwgaGVhZGVycylcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIueUqOWFtuS7lui9r+S7tuaJk+W8gFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIHUsIHBhdGgsIGhlYWRlcnMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNpZ24gPSBKU09OLnBhcnNlKHBvc3QodSArIFxcXCJhcGkvZnMvZ2V0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGF0aFxcXCI6IGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YS5zaWduXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd25sb2FkRmlsZShlbmNvZGVVUkkodSArIFxcXCJkXFxcIiArIGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lICsgXFxcIj9zaWduPVxcXCIgKyBzaWduKSwgXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvXFxcIiArIGl0ZW0ubmFtZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJvcGVuRmlsZTovL1xcXCIgKyBcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9cXFwiICsgaXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgbm93LnVybCwgcGF0aCwgaGVhZGVycylcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKG5vdy51c2VyICYmIG5vdy5wYXNzd29yZCkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7orqTliKDpmaTvvJ9cXFwiKS5jb25maXJtKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXCJhcGkvZnMvcmVtb3ZlXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXI6IGl0ZW0ucGFyZW50LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW2l0ZW0ubmFtZV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXMgPT0gMjAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLph43lkb3lkI1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoaXRlbS5uYW1lKS5pbnB1dCgoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFwiYXBpL2ZzL3JlbmFtZVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5jb2RlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzID09IDIwMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pON5L2c5oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pON5L2c5aSx6LSlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBnZXRJdGVtKFxcXCJzdHlsZVxcXCIsIFxcXCJhdmF0YXJcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogZ2V0SWNvbihpdGVtKSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBsb25nQ2xpY2ssXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgaWYgKGdldEl0ZW0oXFxcInN0eWxlXFxcIiwgXFxcImF2YXRhclxcXCIpID09IFxcXCJhdmF0YXJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBg4oCY4oCY4oCZ4oCZPHNtYWxsPjxmb250IGNvbG9yPScjYWFhYWFhJz4ke2Rlc2N9PC9mb250Pjwvc21hbGw+YCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBsb25nQ2xpY2ssXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSBlbHNlIGlmIChsaXN0LmNvZGUgIT0gMjAwKSB7XFxuICAgICAgICAgICAgdG9hc3QoXFxcIuWHuumUmeS6hlxcXCIpXFxuICAgICAgICAgICAgbG9nKGxpc3QubWVzc2FnZSlcXG4gICAgICAgIH1cXG4gICAgfVxcbn0gY2F0Y2ggKGUpIHtcXG4gICAgc2V0UmVzdWx0KFt7XFxuICAgICAgICB0aXRsZTogXFxcIuiuvue9rlxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCJcXG4gICAgfV0pXFxuICAgIGxvZyhlLm1lc3NhZ2UpXFxuICAgIHRvYXN0KFxcXCLnqIvluo/lh7rnjrDplJnor6/vvIzor7fph43or5VcXFwiKVxcbn1cXG5zZXRSZXN1bHQoZCk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLkupHlj6Pku6RcIixcInBhdGhcIjpcImNsb3VkaW1wb3J0XCIsXCJydWxlXCI6XCIkLmV4cG9ydHMuaW5wdXQgPSBmdW5jdGlvbih1cmwpIHtcXG4gICAgdmFyIHVybCA9IHVybC5zcGxpdChcXFwiQFxcXCIpWzFdXFxuICAgIHZhciBjb250ZW50ID0gcGFyc2VQYXN0ZSh1cmwpXFxuICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9hbGlzdF9jYWNoZS5qc29uXFxcIiwgY29udGVudClcXG59XCJ9XSIsImljb24iOiJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvZ2gvYWxpc3Qtb3JnL2xvZ29AbWFpbi9sb2dvLnN2ZyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment