xiaomianao666

小程序:桃子影视🌞

Oct 1st, 2023
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@桃子影视🌞@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6ImpzOlxudmFyIGNocCA9IFtdO1xudHJ5IHtcbiAgICB2YXIgaHRtbCA9IGdldFJlc0NvZGUoKTtcbiAgICB2YXIgY29udHMgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICdib2R5JiYuc29ydC1pdGVtJyk7XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb250cy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIgbGlzdCA9IHBkZmEoY29udHNbaV0sICdib2R5JiZhJyk7XG4gICAgICAgIGNocC5wdXNoKGxpc3QubGVuZ3RoKTtcbiAgICB9ICAgICBcbn0gY2F0Y2ggKGUpIHt9XG5zZXRSZXN1bHQoJ+abtOaWsOiHszonICsgKE1hdGgubWF4LmFwcGx5KG51bGwsIGNocCkpKTsiLCJ0aXRsZSI6Iuahg+WtkOW9seinhvCfjJ4iLCJhdXRob3IiOiJSIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjaHR0cHM6Ly90YW96aTAwNy5jb20vaW5kZXgucGhwL3ZvZC9zaG93L2lkLzEvcGFnZS9meXBhZ2UuaHRtbCIsInZlcnNpb24iOjIwMjMwOTE4LCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6InZpZGVvIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG52YXIgZCA9IFtdO1xuYWRkTGlzdGVuZXIoXCJvbkNsb3NlXCIsICQudG9TdHJpbmcoKCkgPT4ge1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k7XFxuICAgICAgdGhpcy5vcGVuID0gaW5wdXQ7XFxuICAgICAgcmV0dXJuIHRoaXM7XFxuICAgIH0sXFxuICAgIHNldFRpdGxlKGssIGksIHQpIHtcXG4gICAgICByZXR1cm4gayA9PSBpID8gXFxcIuKAnOKAnOKAneKAnVxcXCIgKyB0LmZvbnRjb2xvcih0aGlzLuWIhuexu+minOiJsikgOiB0O1xcbiAgICB9LFxcbiAgICBhY3Rpb24ob2JqKSB7XFxuICAgICAgcmV0dXJuIFtcXG4gICAgICAgIHtcXG4gICAgICAgICAgdGl0bGU6IFxcXCLmuIXpmaTnirbmgIFcXFwiLFxcbiAgICAgICAgICBqczogJC50b1N0cmluZygob2JqKSA9PiB7XFxuICAgICAgICAgICAgbG9nKG9iaik7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihvYmouc3RhdGUpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIpO1xcbiAgICAgICAgICAgIG9iai5hbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBvYmouY2wuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICB9LCBvYmopLFxcbiAgICAgICAgfSxcXG4gICAgICBdO1xcbiAgICB9LFxcbiAgICBjaGVja1BhcmFtKCkge1xcbiAgICAgIHZhciBvYmogPSB7fTtcXG4gICAgICBpZiAodGhpcy5wYWdlID09IDAgJiYgdHlwZW9mIHBhZ2UgPT0gXFxcInVuZGVmaW5lZFxcXCIpIHtcXG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl6aG156CBXFxcIik7XFxuICAgICAgfSBlb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B1cmwgfTtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkob2JqKTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICAgIHJldHVybiDlrprkvY07XFxuICAgICAgICB9KTtcXG4gICAgICAgIC8vbG9nKOS4gOe6pylcXG4gICAgICAgIC8vbG9nKOS4gOe6py5sZW5ndGgpXFxuICAgICAgICBpZiAo5LiA57qnLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgIGNhdGVnb3JpZXMucHVzaCjkuIDnuqcuam9pbihcXFwiXFxcXG5cXFwiKSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICDkuIDnuqcuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaChpdGVtLmpvaW4oXFxcIixcXFwiKSk7XFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy9sb2coY2F0ZWdvcmllcylcXG4gICAgICB9KTtcXG4gICAgICBpZiAo5oqY5Y+g54q25oCBKSB7XFxuICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGZvbGQgPT09IFxcXCIxXFxcIiA/IOaKmOWPoCA6IOWxleW8gCxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoXFxuICAgICAgICAgICAgICAoZm9sZCwgdSwgYWxsKSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKE1ZX1JVTEUuZ3JvdXAsIGZvbGQgPT09IFxcXCIxXFxcIiA/IFxcXCIwXFxcIiA6IFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgICAgIC8qYWxsLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTsqL1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgZm9sZCxcXG4gICAgICAgICAgICAgIOeKtuaAgSxcXG4gICAgICAgICAgICAgIOWFqOa4hVxcbiAgICAgICAgICAgICksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgbG9uZ0NsaWNrOiB0aGlzLmFjdGlvbih7XFxuICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgIGFsbDog5YWo5riFLFxcbiAgICAgICAgICAgICAgICBjbDog5riF6ZmkLFxcbiAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgfVxcbiAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICBjYXRlZ29yaWVzLmZvckVhY2goKGNhdGVnb3J5LCBpbmRleCkgPT4ge1xcbiAgICAgICAgLy9sb2coY2F0ZWdvcmllcylcXG4gICAgICAgIGxldCBzdWJfY2F0ZWdvcmllcyA9IFtdO1xcbiAgICAgICAgLyppZiAo5bCP57G75a6a5L2NLmluY2x1ZGVzKFxcXCI7XFxcIikpIHtcXG4gICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0uc3BsaXQoXFxcIjtcXFwiKVswXSk7XFxuICAgICAgICAgIGlmIChzdWJfY2F0ZWdvcmllcy5sZW5ndGggPT0gMCkge1xcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gcGRmYShjYXRlZ29yeSwg5bCP57G75a6a5L2NLnNwbGl0KFxcXCI7XFxcIilbMV0pO1xcbiAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2UgeyovXFxuICAgICAgICAvL2xvZyhpbmRleClcXG4gICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gSlNPTi5wYXJzZShgWyR7Y2F0ZWdvcnl9XWApO1xcbiAgICAgICAgLy8gc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0pO1xcbiAgICAgICAgLy99XFxuICAgICAgICBpZiAoaW5kZXggPT09IDApIHtcXG4gICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuXFxuICAgICAgICAgICAgLy9sZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIF/lpKfnsbvmoIfpopgpO1xcbiAgICAgICAgICAgIGxldCB0aXRsZSA9IGl0ZW0udGl0bGU7XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcInVuZGVmaW5lZFxcXCIgJiYg5o6S6ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3UmVnRXhwKOaOkumZpCwgXFxcImdcXFwiKSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQganNvbj0nJ1xcbiAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICBcXG4gICAgICAgICAgICBsZXQgcGFyYW1zID0ge1xcbiAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICBjbGVhcnM6IOa4hemZpCxcXG4gICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICAvL2xldCB1cmwgPSBwZChpdGVtLCBf5aSn57G76ZO+5o6lKTtcXG4gICAgICAgICAgICBsZXQgdXJsID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgLyppZiAo5aSn57G75aSE55CGKSB7XFxuICAgICAgICAgICAgICB1cmwgPSDkuIDnuqfliIbnsbvlpITnkIYodXJsKTtcXG4gICAgICAgICAgICB9Ki9cXG4gICAgICAgICAgICAvL2xvZyh1cmwpXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnNldFRpdGxlKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxuICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5I25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdO1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcGFyYW1zLmFsbGNsZWFycy5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShuZXdfY2F0ZSkpO1xcbiAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkdF9cXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5zdGF0ZSwgcGFyYW1zLmpzb24pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgfSwgcGFyYW1zKSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChmb2xkID09PSBcXFwiMVxcXCIgfHwg5oqY5Y+g54q25oCBID09IGZhbHNlKSB7XFxuICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgIHZhciBleHRyYXBvcyA9IGZhbHNlO1xcbiAgICAgICAgICAgIC8qaWYgKGl0ZW0uaW5jbHVkZXMoJ3R5cGU9XFxcIkBleHRyYVxcXCInKSkge1xcbiAgICAgICAgICAgICAgZXh0cmFwb3MgPSB0cnVlO1xcbiAgICAgICAgICAgICAgLy9sb2coJ+mZhOWKoOWumuS9jScpXFxuICAgICAgICAgICAgfSovXFxuXFxuICAgICAgICAgICAgaWYgKGV4dHJhcG9zKSB7XFxuICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJhJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICB2YXIganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgdHlwZTogcGRmaChpdGVtLCBcXFwiYSYmc3RhdGVcXFwiKSxcXG4gICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwgXFxcImEmJnZhbHVlXFxcIiksXFxuICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAvL3ZhciB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKTtcXG4gICAgICAgICAgICAgIHZhciB0aXRsZSA9IGl0ZW0udGl0bGU7XFxuICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICB2YXIganNvbiA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgLypzd2l0Y2ggKHRydWUpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAQFxcXCIpOlxcbiAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBAXFxcIilbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAXFxcIik6XFxuICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgLy8ganNvbiA9IHBkKGl0ZW0sIOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICB9Ki9cXG4gICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgIC8qdmFyIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzFdKSxcXG4gICAgICAgICAgICAgICAgfTpwZChpdGVtLOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOuWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAJylbMV0pLFxcbiAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTsqL1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBsZXQgcGFyYW1zID0ge1xcbiAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxuICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICBqc29uOiBqc29uLFxcbiAgICAgICAgICAgICAgc3RhdGU6IOeKtuaAgSxcXG4gICAgICAgICAgICAgIGFsbGNsZWFyczog5YWo5riFLFxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnNldFRpdGxlKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxuICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHlcXFwiICsgXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaGVhZC5jYXRlXFxcIiwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpO1xcbiAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkdF9cXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5zdGF0ZSwgcGFyYW1zLmpzb24pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICB9LCBwYXJhbXMpLFxcbiAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgIH0pO1xcbiAgICB9XFxuICAgIH0sXFxuICB9O1xcbiAgb2JqLumihOiuvihvcHRpb25zKTtcXG4gIHJldHVybiBvYmo7XFxufVxcblxcbiAgLy8u54q25oCBK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AgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgIGlkID0gXFxcImxhc3RpZF9cXFwiICsgcGFnZTtcXG4gICAgICAgICAgY2xzID0gXFxcImxhc3RtYXJrXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5IyNcXFwiICsgdXJsLFxcbiAgICAgICAgICBjb250ZW50OiBjb250ZW50LFxcbiAgICAgICAgICBjb2xfdHlwZTogcnVsZS5jb2xfdHlwZSxcXG4gICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgaWQ6IGlkLFxcbiAgICAgICAgICAgIGNsczogY2xzLFxcbiAgICAgICAgICB9LFxcbiAgICAgICAgfSk7XFxuICAgICAgICBpZiAoaSA9PSBsaXN0Lmxlbmd0aCAtIDEgJiYgc2hvdykge1xcbiAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgIGlkOiBcXFwicGFnZWxpbmVcXFwiLFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHNtYWxsPuWKoOi9veS4rS4uLjwvc21hbGw+XFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiA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I0KTtcXG4gICAgIHZhciDnroDku4syID0gcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sIOahhuaetueugOS7izIpO1xcbiAgICAgdmFyIOaPj+i/sDEgPSBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwg5qGG5p625o+P6L+wMSk7XFxuICAgICB2YXIg5o+P6L+wMiA9IHBhcnNlRG9tRm9ySHRtbChsaXN0W2pdLCDmoYbmnrbmj4/ov7AyKTtcXG4gICAgIHZhciDlm77niYcgPSBwYXJzZURvbShsaXN0W2pdLCDmoYbmnrblm77niYcpICsgJ0BSZWZlcmVyPSc7XFxuICAgICB2YXIg6ZO+5o6lID0gcGFyc2VEb20obGlzdFtqXSwg5qGG5p626ZO+5o6lKSArIFxcXCIjaW1tZXJzaXZlVGhlbWUjXFxcIjtcXG4gICAgICBcXG4gICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgdGl0bGU6IOagh+mimCwgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgIGNvbnRlbnQ6IOeugOS7izEgKyAnXFxcXG4nICsg566A5LuLMixcXG4gICAgICAgICAgICAgICBkZXNjOiDmj4/ov7AxICsgJyAnICsg5o+P6L+wMixcXG4gICAgICAgICAgICAgICBpbWc6IOWbvueJhyxcXG4gICAgICAgICAgICAgICB1cmw6IOmTvuaOpSxcXG4gICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHRpdGxlOiDmoIfpopgsICAgICAgICAgICBcXG4gICAgICAgICAgICBpbWc6IOWbvueJhyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5LqM57qn5aSW6YOo5pCc57SiXCIsXCJwYXRoXCI6XCJ0b29sXCIsXCJydWxlXCI6XCIvL3ZhciB0aXRsZSA9IHBhcnNlRG9t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ICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKHJlcXVlc3QoaW5wdXQpLm1hdGNoKC9yIHBsYXllcl8uKj89KC4qPyk8LylbMV0pXFxuICAgICAgICAgICAgdmFyIHVybCA9IGh0bWwudXJsXFxuICAgICAgICAgICAgaWYgKGh0bWwuZW5jcnlwdCA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdW5lc2NhcGUodXJsKTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuZW5jcnlwdCA9PSAnMicpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdW5lc2NhcGUoYmFzZTY0RGVjb2RlKHVybCkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoL20zdTh8bXA0Ly50ZXN0KHVybCkpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVybFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidmlkZW86Ly9cXFwiICsgaW5wdXRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ2aWRlbzovL1xcXCIgKyBpbnB1dFxcbiAgICAgICAgfVxcbiAgICB9KSxcXG4gICAgdXBkYXRhOiBmdW5jdGlvbihydWxlKSB7XFxuICAgICAgICBzZXRMYXN0Q2hhcHRlclJ1bGUoJ2pzOicgKyAkLnRvU3RyaW5nKCh1cmwscnVsZSkgPT4ge1xcbiAgICAgICAgICAgIHZhciBodG1sPWZldGNoKHVybCk7XFxuICAgICAgICAgICAgc2V0UmVzdWx0KGV2YWwocnVsZSkpXFxuICAgICAgICB9LE1ZX1VSTCwgcnVsZSkpXFxuICAgIH0sXFxuICAgIGNsb3NlOiBmdW5jdGlvbihsaXN0LCBzb3J0cykge1xcbiAgICAgICAgYWRkTGlzdGVuZXIoJ29uQ2xvc2UnLCAkLnRvU3RyaW5nKChsaXN0LCBzb3J0cykgPT4ge1xcbiAgICAgICAgICAgIGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdlcl8nICsgeCArICdmb2xkJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2VyXycreCk7XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHNvcnRzOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcigncGxheWxpc3RfJyArIGkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBjbGVhck15VmFyKCdlcl9wbGF5bGlzdHMnKTtcXG4gICAgICAgIH0sIGxpc3QsIHNvcnRzKSlcXG4gICAgfSxcXG4gICAgZGF0YUNvbnZlcnQ6IGZ1bmN0aW9uKGRhdGEpIHtcXG4gICAgICAgIHZhciBuZXdjbHNsaXN0ID0gZGF0YS5tYXAoZnVuY3Rpb24ob2JqKSB7XFxuICAgICAgICAgICAgdmFyIG5ld09iaiA9IE9iamVjdC5hc3NpZ24oe30sIG9iaik7XFxuICAgICAgICAgICAgaWYgKG5ld09iai5oYXNPd25Qcm9wZXJ0eSgndHlwZScpKSB7XFxuICAgICAgICAgICAgICAgIG5ld09iai5jb2xfdHlwZSA9IG5ld09iai50eXBlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gbmV3T2JqO1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXR1cm4gbmV3Y2xzbGlzdDtcXG4gICAgfSxcXG4gICAgcHJlTG9hZDogZnVuY3Rpb24oZnVuYykge1xcbiAgICAgICAgbGV0IG15ZnVuYz1udWxsXFxuICAgICAgICBpZihmdW5jIT11bmRlZmluZWQmJmZ1bmMuY29uc3RydWN0b3I9PUZ1bmN0aW9uKXtcXG4gICAgICAgICAgICBteWZ1bmM9ZnVuY1xcbiAgICAgICAgfVxcbiAgICAgICAgJC5leHRlbmQoe1xcbiAgICAg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ycmF5ID8gZGVzYy5qb2luKCc8YnI+JykgOiBkZXNjO1xcbiAgICAgICAgaWYgKGRlc2MucmVwbGFjZSgvKDxicj58XFxcXHMrKS9nLCAnJykubGVuZ3RoID09IDApIHtcXG4gICAgICAgICAgICByZXR1cm5cXG4gICAgICAgIH1cXG4gICAgICAgIHZhciBpbmZvPXN0b3JhZ2UwLmdldE15VmFyKCdlcl9pbmZvJywne30nKVxcbiAgICAgICAgaWYoaW5mb1snZGVzYyddIT11bmRlZmluZWQpe1xcbiAgICAgICAgICBpbmZvWydkZXNjJ109aW5mb1snZGVzYyddKycg566A5LuLOicrZGVzYztcXG4gICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2VyX2luZm8nLGluZm8pO1xcbiAgICAgICAgfVxcbiAgICAgICAgXFxuICAgICAgICBjb25zdCBtYXJrID0gJ2Rlc2MnO1xcbiAgICAgICAgbnVtID0gdHlwZW9mKG51bSkgPT0gJ3VuZGVmaW5lZCcgPyA5MCA6IG51bVxcbiAgICAgICAgZGVzYyA9IGRlc2Muc3RhcnRzV2l0aCgn44CA44CAJykgPyBkZXNjIDogJ+OAgOOAgCcgKyBkZXNjO1xcbiAgICAgICAgZGVzYyA9IGRlc2MucmVwbGFjZSgvJy9nLCBcXFwiJiMzOTtcXFwiKVxcblxcbiAgICAgICAgZnVuY3Rpb24gc3Vic3RyKHN0ciwgbWF4TGVuZ3RoKSB7XFxuICAgICAgICAgICAgbGV0IGxlbiA9IDA7XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzdHIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgaWYgKHN0ci5jaGFyQ29kZUF0KGkpID4gMjU1KSB7XFxuICAgICAgICAgICAgICAgICAgICBsZW4gKz0gMjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxlbisrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChsZW4gPiBtYXhMZW5ndGgpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHIuc2xpY2UoMCwgaSkgKyAnLi4uJztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gc3RyO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHNkZXNjID0gc3Vic3RyKGRlc2MsIG51bSk7XFxuICAgICAgICB2YXIgbGF6eSA9ICQoYCNub0xvYWRpbmcjYCkubGF6eVJ1bGUoKGRjLCBzZGMsIG0pID0+IHtcXG4gICAgICAgICAgICB2YXIgc2hvdyA9IHN0b3JhZ2UwLmdldEl0ZW0obSwgJzAnKTtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSBmaW5kSXRlbSgnZGVzYycpLnRpdGxlO1xcbiAgICAgICAgICAgIHZhciByZSA9IC8oPFxcXFwvc21hbGw+PGJyPi4qPz4pLisvZztcXG4gICAgICAgICAgICB2YXIgZXhwID0gJ+WxleW8gDonO1xcbiAgICAgICAgICAgIHZhciByZXQgPSAn5pS26LW3Oic7XFxuICAgICAgICAgICAgaWYgKHNob3cgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ2Rlc2MnLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShyZXQsIGV4cClcXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZShyZSwgJyQxJyArIHNkYyArICc8L3NtYWxsPicpXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLyg8XFxcXC9zbWFsbD48YnI+PGZvbnQgY29sb3I9XFxcIikuKj8oXFxcIj4pLywgJyQxIzhBMkJFMiQyJykvL+aUtui1t+minOiJslxcblxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKG0sICcwJyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgnZGVzYycsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKGV4cCwgcmV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKHJlLCAnJDEnICsgZGMgKyAnPC9zbWFsbD4nKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oPFxcXFwvc21hbGw+PGJyPjxmb250IGNvbG9yPVxcXCIpLio/KFxcXCI+KS8sICckMSMwMDgwMDAkMicpLy/lsZXlvIDpopzoibJcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShtLCAnMScpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gYGhpa2VyOi8vZW1wdHlgXFxuICAgICAgICB9LCBkZXNjLCBzZGVzYywgbWFyaylcXG4gICAgICAgIHZhciBzYyA9IHN0b3JhZ2UwLmdldEl0ZW0obWFyaywgJzAnKSA9PSAnMCcgPyAn5bGV5byAOicgOiAn5pS26LW3Oic7XFxuICAgICAgICB2YXIgZGMgPSBzdG9yYWdlMC5nZXRJdGVtKG1hcmssICcwJykgPT0gJzAnID8gc2Rlc2MgOiBkZXNjO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAnJyArICc8Yj48Zm9udCBjb2xvcj1cXFwiIzA5OEFDMVxcXCI+4oi3ICDliafmg4XnroDku4tcXHQ8L2ZvbnQ+PC9iPicgKyBcXFwiPHNtYWxsPjxhIHN0eWxlPSd0ZXh0LWRlY29yYXRpb246IG5vbmU7JyBocmVmPSdcXFwiICsgbGF6eSArIFxcXCInPlxcXCIgKyBzYyArICc8L2E+PC9zbWFsbD48YnI+PGZvbnQgY29sb3I9XFxcIiM4QTJCRTJcXFwiPicgKyBgJHtkY31gICsgJzwvc21hbGw+JywvL+m7mOiupOminOiJslxcbiAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0JyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogJ2Rlc2MnLFxcbiAgICAgICAgICAgICAgICBsaW5lU3BhY2luZzogNixcXG4gICAgICAgICAgICAgICAgdGV4dFNpemU6IDE1LFxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogdHJ1ZSxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9LFxcblxcblxcbi8v5rW35oqlXFxuICAgIHN0ckNvbnZlcnQ6IGZ1bmN0aW9uKGFycikge1xcbiAgICAgICAgcmV0dXJuIGFyci5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgc3RyID0geDtcXG4gICAgICAgICAgICBpZiAoLyjlr7zmvJR85Li75ryUfOexu+WeiynvvJovLnRlc3Qoc3RyKSkge1xcbiAgICAgICAgICAgICAgICBzdHIgPSBzdHIuc3BsaXQoJy8nKS5tYXAoKHZhbCwgaW5kZXgpID0+IChpbmRleCA9PT0gMCA/ICcnIDogJycpICsgdmFsKS5zbGljZSgwLCA1KS5qb2luKCcgJykucmVwbGFjZSgvICQvLCAnJyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBzdHJcXG4gICAgICAgIH0pXFxuICAgIH0sXFxuICAgIHNldENvbnRlbnQ6IGZ1bmN0aW9uKG9iaikge1xcbiAgICAgICAgLy9sb2cob2JqKVxcbiAgICAgICAgdmFyIGNvbnRlbnRzID0gb2JqLm1haW47XFxuICAgICAgICB2YXIgc29ydE9yZGVyID0gb2JqLnNvcnQ7XFxuICAgICAgICB2YXIgaW1nID0gb2JqLmltZztcXG4gICAgICAgIHZhciB0ZXh0cyA9IGNvbnRlbnRzLm1hcCh4ID0+IHBkZmgoeCwgJ1RleHQnKSk7XFxuICAgICAgICBcXG4gICAgICAgIHZhciBhcnJheSA9IHRleHRzLnNvcnQoKGEsIGIpID0+IHtcXG4gICAgICAgICAgICBjb25zdCBpbmRleEEgPSBzb3J0T3JkZXIuaW5kZXhPZihhLnN1YnN0cigwLCAyKSk7XFxuICAgICAgICAgICAgY29uc3QgaW5kZXhCID0gc29ydE9yZGVyLmluZGV4T2YoYi5zdWJzdHIoMCwgMikpO1xcbiAgICAgICAgICAgIHJldHVybiBpbmRleEEgLSBpbmRleEI7XFxuICAgICAgICB9KVxcbiAgICAgICAgdmFyIHJlZ2V4ID0gbmV3IFJlZ0V4cCgnKCcgKyBzb3J0T3JkZXIuam9pbignfCcpICsgJyknKTtcXG4gICAgICAgIGFycmF5ID0gYXJyYXkuZmlsdGVyKGZ1bmN0aW9uKGl0ZW0pIHtcXG4gICAgICAgICAgICByZXR1cm4gcmVnZXgudGVzdChpdGVtKTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgLy9sb2coYXJyYXkpXFxuICAgICAgICBcXG4gICAgICAgIC8vYXJyYXkgPSBzb3J0T3JkZXIubGVuZ3RoPT0wP2FycmF5OnRoaXMuc3RyQ29udmVydChhcnJheSk7XFxuICAgICAgICBhcnJheSA9IHRoaXMuc3RyQ29udmVydChhcnJheSk7XFxuICAgICAgICBcXG4gICAgICAgIGlmKGFycmF5Lmxlbmd0aD42KXtcXG4gICAgICAgICAgICBhcnJheT1hcnJheS5zbGljZSgwLDYpO1xcbiAgICAgICAgfVxcbiAgICAgICAgXFxuICAgICAgICB2YXIgdGl0bGVzID0gW107XFxuICAgICAgICB2YXIgZGVzY3MgPSBbXTtcXG4gICAgICAgIFxcbiAgICAgICAgc3dpdGNoIChhcnJheS5sZW5ndGgpIHtcXG4gICAgICAgICAgICBjYXNlIDQ6XFxuICAgICAgICAgICAgY2FzZSA1OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAyKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgyKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSA2OlxcbiAgICAgICAgICAgICAgICB0aXRsZXMgPSBhcnJheS5zbGljZSgwLCAzKTtcXG4gICAgICAgICAgICAgICAgZGVzY3MgPSBhcnJheS5zbGljZSgzKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignZXJfaW5mbycse1xcbiAgICAgICAgICBkZXNjOmRlc2NzLmpvaW4oJ1xcXFxuJyksXFxuICAgICAgICAgIGltZzppbWcsXFxuICAgICAgICB9KVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAvL3RpdGxlOiB0aXRsZXNbMF0gKyAnXFxcXG4nICsgdGhpcy5zbWFsbCh0aXRsZXMuc2xpY2UoMSwgMykuam9pbignXFxcXG4nKSksXFxuICAgICB0aXRsZTogIHRoaXMuc21hbGwocGRmaChodG1sLCAnLnZpZGVvLWluZm8tYXV4JiZUZXh0JykgKyAnXFxcXG4nICsgcGRmaChodG1sLCAnLnZpZGVvLWluZm8taXRlbXM6Y29udGFpbnMo5pu05pawKSYmVGV4dCcpLCdyZWQnKSxcXG4gICAgICAgICAgIGRlc2M6IHRoaXMuc21hbGwocGRmaChodG1sLCAnLnZpZGVvLWluZm8taXRlbXM6Y29udGFpbnMo5a+85ryUKSYmVGV4dCcpICsgJ1xcXFxuJyArIHBkZmgoaHRtbCwgJy52aWRlby1pbmZvLWl0ZW1zOmNvbnRhaW5zKOS4u+a8lCkmJlRleHQnKSwnI0ZGN0YwMCcpLFxcbiAgICAgLy9kZXNjOiB0aGlzLnNtYWxsKHBkZmgoaHRtbCwgJy5kYXRhOmNvbnRhaW5zKOabtOaWsCkmJlRleHQnKSwnI0ZGN0YwMCcpLFxcbiAgICAgICAgICAgIHBpY191cmw6IGltZyArICdAUmVmZXJlcj0nLFxcbiAgICAgICAgICAgIHVybDogTVlfVVJMLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV92ZXJ0aWNhbF9waWNfYmx1cicsXFxuICAgICAgICB9KVxcbiAgICAgICAgaWYgKG9iai5kZXNjICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgIHRoaXMuc2V0RGVzYyhvYmouZGVzYyk7XFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIHNldEN1c3RvbTogZnVuY3Rpb24ob2JqLCBpbWcpIHtcXG4gICAgICAgIHZhciBhcnJheSA9IFtdO1xcbiAgICAgICAgaWYgKG9iai5jb25zdHJ1Y3RvciA9PSBBcnJheSkge1xcbiAgICAgICAgICAgIGFycmF5ID0gb2JqO1xcbiAgICAgICAgfVxcbiAgICAgICAgYXJyYXkgPSB0aGlzLnN0ckNvbnZlcnQoYXJyYXkpO1xcbiAgICAgICAgdmFyIHRpdGxlcyA9IFtdO1xcbiAgICAgICAgdmFyIGRlc2NzID0gW107XFxuICAgICAgICBzd2l0Y2ggKGFycmF5Lmxlbmd0aCkge1xcbiAgICAgICAgICAgIGNhc2UgNDpcXG4gICAgICAgICAgICBjYXNlIDU6XFxuICAgICAgICAgICAgICAgIHRpdGxlcyA9IGFycmF5LnNsaWNlKDAsIDIpO1xcbiAgICAgICAgICAgICAgICBkZXNjcyA9IGFycmF5LnNsaWNlKDIpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlIDY6XFxuICAgICAgICAgICAgICAgIHRpdGxlcyA9IGFycmF5LnNsaWNlKDAsIDMpO1xcbiAgICAgICAgICAgICAgICBkZXNjcyA9IGFycmF5LnNsaWNlKDMpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCdlcl9pbmZvJyx7XFxuICAgICAgICAgIGRlc2M6ZGVzY3Muam9pbignXFxcXG4nKSxcXG4gICAgICAgICAgaW1nOmltZyx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4gICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICB2YXIgY29sID0gcGxpc3Rbc2hzb3J0XS5jb2xfdHlwZTtcXG4gICAgICAgICAgICAgICAgICB2YXIgY2xzID0gcGxpc3Rbc2hzb3J0XS5jbHM7XFxuICAgICAgICAgICAgICAgICAgdmFyIHBpYz1wbGlzdFtzaHNvcnRdLnBpYztcXG4gICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGJ0bi5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGJ0bi50aXRsZS5yZXBsYWNlKGZvbGRzWzBdLCBmb2xkc1sxXSksXFxuICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICBwdXRNeVZhcih2YXJpKydmb2xkJywnMScpO1xcbiAgICAgICAgICAgICAgLy9yZXR1cm4gJ3RvYXN0Oi8v5bGV5byA5omN6IO95pON5L2cJztcXG4gICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBsaXN0ID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ2VyX3BsYXlsaXN0cycsICd7fScpO1xcbiAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICB2YXIgY29sID0gcGxpc3Rbc2hzb3J0XS5jb2xfdHlwZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBjbHMgPSBwbGlzdFtzaHNvcnRdLmNscztcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWM9cGxpc3Rbc2hzb3J0XS5waWM7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIodmFyaSwgaSk7XFxuXFxuICAgICAgICAgICAgICAgIHZhciB4bGlzdD1saXN0c1tpXTtcXG4gICAgICAgICAgICAgICAgaWYoJC5mdW5jIT11bmRlZmluZWQmJiQuZnVuYy5jb25zdHJ1Y3Rvcj09RnVuY3Rpb24pe1xcbiAgICAgICAgICAgICAgICAgICAgeGxpc3Q9JC5mdW5jKGkpO1xcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzaHNvcnQgKyAnX2xpc3QnLCB4bGlzdCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIHBsYXlzID0geGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogeC50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHgudXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2wsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljOnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogeC51cmwucmVwbGFjZSgvQGxhenlSdWxlW1xcXFxzXFxcXFNdKy9nLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogY2xzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKHNoc29ydCArICdfc29ydCcpID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgcGxheXMucmV2ZXJzZSgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciBwY2ZnPXN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLCd7fScpO1xcbiAgICAgICAgICAgICAgICBpZihwY2ZnWyfljZXmjqgnXSl7XFxuICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQrJ19wdXNoJyx7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTpwY2ZnWydvYmonXVsn5Y2V5o6oJ11bMF1cXG4gICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgIHBjZmdbJ+WNleaOqCddPWZhbHNlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmKHBjZmdbJ+mAieaOqCddKXtcXG4gICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2hzJyx7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTpwY2ZnWydvYmonXVsn6YCJ5o6oJ11bMF1cXG4gICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddPWZhbHNlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLHBjZmcpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfbGluZScsIHBsYXlzKTtcXG5cXG4gICAgICAgICAgICAgICAgdmFyIHRhYnggPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQgKyAnX3RhYicpO1xcbiAgICAgICAgICAgICAgICB0YWJ4LmZvckVhY2goKHgsIGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSB4LnRpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gaWkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHguZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnJlcGxhY2UoLyMoXFxcXHcrKT8vZywgbGluZWMpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUucmVwbGFjZSgvIyhcXFxcdyspPy9nLCAnIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmiJDlip/vvIEnO1xcbiAgICAgICAgICAgIH0sIHZhcmksIHNoc29ydCwgaSxjdXN0b20u57q/6Lev6YCJ5LitKVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIChnZXRNeVZhcih2YXJpLCAnMCcpID09IGkgPyB0YWJzW2ldLmZvbnRjb2xvcihjdXN0b20u57q/6Lev6YCJ5LitKSA6IHRhYnNbaV0uZm9udGNvbG9yKCcjJykpLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogc2hzb3J0ICsgJ190YWInLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHNoc29ydCArICdfdGFiXycgKyBpLFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6J2JsYW5rX2Jsb2NrJywgLy8nYmxhbmtfYmxvY2snLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBzaHNvcnQgKyAnX2xpbmUnLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH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G4gICAgICAgICAgICBcXG4gICAgICAgICAgdmFyIHRpdGxlcz1wb2JqWyfljZXmjqgnXTtcXG4gICAgICAgICAgdmFyIHBjZmc9c3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0KydfcHVzaGNmZycsJ3t9Jyk7XFxuICAgICAgICAgIHBjZmdbJ29iaiddPXBvYmo7XFxuICAgICAgICAgIHZhciDljZXmjqg9cGNmZ1sn5Y2V5o6oJ10/cGNmZ1sn5Y2V5o6oJ106ZmFsc2U7XFxuICAgICAgICAgIFxcbiAgICAgICAgICBpZijljZXmjqgpe1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaCcse1xcbiAgICAgICAgICAgICAgdGl0bGU6dGl0bGVzWzBdLFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgcGNmZ1sn5Y2V5o6oJ109ZmFsc2U7XFxuICAgICAgICAgICAgcGNmZ1sncGxheWxpc3QnXS5tYXAoKHgpPT57XFxuICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LmV4dHJhLmlkLHtcXG4gICAgICAgICAgICAgICAgIHVybDp4LnVybCxcXG4gICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaCcse1xcbiAgICAgICAgICAgICAgdGl0bGU6J+KAnOKAnOKAneKAnScrdGl0bGVzWzFdLFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQrJ19wdXNocycse1xcbiAgICAgICAgICAgICAgdGl0bGU6cG9ialsn6YCJ5o6oJ11bMF0sXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBwY2ZnWyfljZXmjqgnXT10cnVlO1xcbiAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddPWZhbHNlO1xcbiAgICAgICAgICAgIHZhciBwbGF5bGlzdD1maW5kSXRlbXNCeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgIHBjZmdbJ3BsYXlsaXN0J109cGxheWxpc3Q7XFxuICAgICAgICAgICAgZmluZEl0ZW1zQnlDbHMoc2hzb3J0KS5tYXAoeD0+e1xcbiAgICAgICAgICAgICAgdmFyIGRwdXNoPXtcXG4gICAgICAgICAgICAgICAgbmFtZTpnZXRQYWdlVGl0bGUoKSxcXG4gICAgICAgICAgICAgICAgdXJsOngudGl0bGUrJyQnK3guZXh0cmEuaWRcXG4gICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCx7XFxuICAgICAgICAgICAgICAgIHVybDokKCcnKS5sYXp5UnVsZSgoZHB1c2gpPT57XFxuICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeShkcHVzaCkpO1xcbiAgICAgICAgICAgICAgICB9LGRwdXNoKVxcbiAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICB9XFxuICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLHBjZmcpO1xcbiAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJyso5Y2V5o6oPyfljZXmjqjlvIDlkK8nOifljZXmjqjlhbPpl60nKTtcXG4gICAgICAgICAgfSxzaHNvcnQscG9iaix2YXJpKSxcXG4gICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgIGlkOnNoc29ydCsnX3B1c2gnLFxcbiAgICAgICAgICAgIGNsczpzaHNvcnQrJ19wdXNodGFiJyxcXG4gICAgICAgICAgfVxcbiAgICAgICAgfSx7XFxuICAgICAgICAgIHRpdGxlOnBvYmpbJ+mAieaOqCddWzBdLFxcbiAgICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgIHVybDokKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaHNvcnQscG9iaix2YXJpKT0+e1xcbiAgICAgICAgICBpZihnZXRNeVZhcih2YXJpKydmb2xkJywnMScpPT0nMCcpe1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lsZXlvIDmiY3og73mk43kvZwnO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIHZhciB0aXRsZXM9cG9ialsn6YCJ5o6oJ107XFxuICAgICAgICAgIHZhciBwY2ZnPXN0b3JhZ2UwLmdldE15VmFyKHNoc29ydCsnX3B1c2hjZmcnLCd7fScpO1xcbiAgICAgICAgICBwY2ZnWydvYmonXT1wb2JqO1xcbiAgICAgICAgICB2YXIg6YCJ5o6oPXBjZmdbJ+mAieaOqCddP3BjZmdbJ+mAieaOqCddOmZhbHNlO1xcbiAgICAgICAgICBpZijpgInmjqgpe1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaHMnLHtcXG4gICAgICAgICAgICAgIHRpdGxlOnRpdGxlc1swXSxcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddPWZhbHNlO1xcbiAgICAgICAgICAgIHBjZmdbJ3BsYXlsaXN0J10ubWFwKCh4KT0+e1xcbiAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeC5leHRyYS5pZCx7XFxuICAgICAgICAgICAgICAgICB0aXRsZTp4LnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgdXJsOngudXJsLFxcbiAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCsnX3B1c2h0bycsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5o6o6YCB5pys6aG1PT5UVkJveCcsXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihzaHNvcnQrJ19kdW9zZWxlY3QnKTtcXG4gICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaHMnLHtcXG4gICAgICAgICAgICAgIHRpdGxlOifigJzigJzigJ3igJ0nK3RpdGxlc1sxXSxcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHBjZmdbJ+mAieaOqCddPXRydWU7XFxuICAgICAgICAgICAgcGNmZ1sn5Y2V5o6oJ109ZmFsc2U7XFxuICAgICAgICAgICAgdmFyIHBsYXlsaXN0PWZpbmRJdGVtc0J5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgcGNmZ1sncGxheWxpc3QnXT1wbGF5bGlzdDtcXG4gICAgICAgICAgICBsZXQgSWRzPXBsYXlsaXN0Lm1hcChpdCA9PiBpdC5leHRyYS5pZCk7XFxuICAgICAgICAgICAgICAgIElkcy5mb3JFYWNoKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gZmluZEl0ZW0oeCkudGl0bGU7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHgsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQubXNtKHRpdGxlLCB4LHNoc29ydCksXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQrJ19wdXNoJyx7XFxuICAgICAgICAgICAgICB0aXRsZTpwb2JqWyfljZXmjqgnXVswXSxcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oc2hzb3J0KydfcHVzaHRvJywge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmjqjpgIHpgInkuK09PlRWQm94JyxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgICBzdG9yYWd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gKyBpdGVtLnVybC5yZXBsYWNlKC9AbGF6eVJ1bGVbXFxcXHNcXFxcU10rL2csJycpKS5qb2luKCcjJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuam9pbignJCQkJyk7XFxuICAgICAgICAgIH1jYXRjaHtcXG4gICAgICAgICAgdmFyIHBscz1zdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQrXFxcIl9saXN0XFxcIiwnW10nKS5tYXAoeCA9PiB4LnRpdGxlICsgXFxcIiRcXFwiICsgeC51cmwpLmpvaW4oXFxcIiNcXFwiKTtcXG4gICAgICAgICAgdmFyIHRhYnM9W3RhYnNbZ2V0TXlWYXIodmFyaSwnMCcpXV07XFxuICAgICAgICAgIH1cXG4gICAgICAgICAgLypsb2cocGxzKVxcbiAgICAgICAgICBsb2codGFicykqL1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIGlmKOmAieaOqCl7XFxuICAgICAgICAgIHZhciBwbHM9c3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0K1xcXCJfZHVvc2VsZWN0XFxcIiwnW10nKS5tYXAoeCA9PiB4LnRpdGxlICsgXFxcIiRcXFwiICsgeC51cmwpLmpvaW4oXFxcIiNcXFwiKTtcXG4gICAgICAgICAgaWYocGxzLmxlbmd0aD09MCl7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mAieaLqeS4uuepuic7XFxuICAgICAgICAgIH1cXG4gICAgICAgICAgdmFyIHRhYnM9Wyfmkq3mlL7liJfooagnXTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgICBcXG4gICAgICAgICAgdmFyIGluZm89c3RvcmFnZTAuZ2V0TXlWYXIoJ2VyX2luZm8nLCd7fScpO1xcbiAgICAgICAgICB2YXIgZGVzYyA9aW5mb1snZGVzYyddO1xcbiAgICAgICAgICB2YXIg5o6o6YCBID0ge1xcbiAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBnZXRQYWdlVGl0bGUoKSxcXG4gICAgICAgICAgICAgICAgIFxcXCJjb250ZW50XFxcIjogZGVzY3x8JycsXFxuICAgICAgICAgICAgICAgICBcXFwicGljXFxcIjogaW5mb1snaW1nJ10gfHwgJycsXFxuICAgICAgICAgICAgICAgICBcXFwiZnJvbVxcXCI6IHRhYnMuam9pbignJCQkJyksXFxuICAgICAgICAgICAgICAgICBcXFwidXJsXFxcIjogcGxzLFxcbiAgICAgICAgICAgfVxcbiAgICAgICAgICAvL2xvZyjmjqjpgIEpXFxuICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSjmjqjpgIEpKVxcbiAgICAgICAgICB9LHNoc29ydCx2YXJpKSxcXG4gICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgIGlkOnNoc29ydCsnX3B1c2h0bycsXFxuICAgICAgICAgICAgY2xzOnNoc29ydCsnX3B1c2h0YWInXFxuICAgICAgICAgIH1cXG4gICAgICAgIH0se1xcbiAgICAgICAgICBjb2xfdHlwZTonYmxhbmtfYmxvY2snLFxcbiAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgY2xzOnNoc29ydCsnX3B1c2h0YWInLFxcbiAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBzZXRMb25nY2xpY2s6ZnVuY3Rpb24oc2hzb3J0LGN1c3RvbSl7XFxuICAgICAgcmV0dXJuIFt7dGl0bGU6J+agt+W8j/CfjqgnLGpzOiAkLnRvU3RyaW5nKChzaHNvcnQpPT57XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYWxsX2NvbHMgPSBbJyddLmNvbmNhdChnZXRDb2xUeXBlcygpKTtcXG4gICAgICAgICAgICAgICAgICAgIGFsbF9jb2xzPWFsbF9jb2xzLmZpbHRlcih4PT5cXG4gICAgICAgICAgICAgICAgICAgICAgLyh0ZXh0X3xmbGV4KS4qLy50ZXN0KHgpJiZ4IT0ndGV4dF9pY29uJyk7XFxuICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKGFsbF9jb2xzKVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNscyA9IHN0b3JhZ2UwLmdldE15VmFyKCdlcl9wbGF5bGlzdHMnLCd7fScpXFxuICAgICAgICAgICAgICAgICAgICB8fCAnJztcXG4gICAgICAgICAgICAgICAgICAgIGlmKGNsc1tzaHNvcnRdIT0nJyl7XFxuICAgICAgICAgICAgICAgICAgICAgIGNvbD1jbHNbc2hzb3J0XS5jb2xfdHlwZTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGxldCDmjInpkq7moLflvI8gPSBhbGxfY29scy5tYXAoKGl0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0ID09PSBjb2wgPyAn8J+RiScgKyBpdDogaXQ7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0aXBzID0gJ+ivt+mAieaLqemAiembhuaMiemSruagt+W8jyc7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCjmjInpkq7moLflvI8sIDIsIHRpcHMpLnNlbGVjdCgoc2hzb3J0LGNscykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0LnJlcGxhY2UoL/CfkYkvZywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8qc3RvcmFnZTAuc2V0SXRlbSgn5oyJ6ZKu5qC35byPJywgaW5wdXQpOyovXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG9sZElkcyA9IChmaW5kSXRlbXNCeUNscyhzaHNvcnQpIHx8IFtdKS5tYXAoaXQ9Pml0LmV4dHJhLmlkKTsgLy/ogIHlhYPntKBpZHNcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbGRJZHMuZm9yRWFjaCh4PT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHgsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5YiH5o2i6YCJ6ZuG5oyJ6ZKu5qC35byP5Li6OicgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgIH0sc2hzb3J0LGNscyk7XFxuICAgICAgICAgICAgICAgIH0sc2hzb3J0LGN1c3RvbSl9XVxcbiAgICB9LFxcbiAgICBzZXRUYWJzOiBmdW5jdGlvbih0YWJzLCB2YXJpLCBzaHNvcnQscGFyc2UpIHtcXG4gICAgICAgIGxldCBjdXN0b209cGFyc2Uu6Ieq5a6a5LmJO1xcbiAgICAgICAgY3VzdG9tID10aGlzLmdldFByZXNldChjdXN0b20pO1xcbiAgICAgICAgc2hzb3J0ID0gc2hzb3J0ID8gc2hzb3J0IDogJ3Noc29ydCc7XFxuICAgICAgICB2YXIgdGl0bGUgPSAoZ2V0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JywgJzAnKSA9PSAnMScpID8gJzxiPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjogJytjdXN0b20u6YCG5bqP6aKc6ImyKydcXFwiPumAhuW6jzwvc3Bhbj48L2I+JyA6ICc8Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICcrY3VzdG9tLuato+W6j+minOiJsisnXFxcIj7mraPluo88L3NwYW4+PC9iPidcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHZhcmkgKyAnOicgKyB0aXRsZSxcXG4gICAgICAgICAgICBkZXNjOiAn5YWxJyArIFN0cmluZyh0YWJzLmxlbmd0aCkuZm9udGNvbG9yKCcjNDY4MkI0JykgKyAn5p2h57q/6LevJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHNoc29ydCx2YXJpLGN1c3RvbSkgPT4ge1xcbiAgICAgICAgICAgICAgbGV0IGNvbmYgPSBnZXRNeVZhcihzaHNvcnQgKyAnX3NvcnQnLCAnMCcpO1xcbiAgICAgICAgICAgICAgaWYoZ2V0TXlWYXIoJ2VyXycrdmFyaSsnZm9sZCcsJzEnKT09JzAnKXtcXG4gICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lsZXlvIDmiY3og73mk43kvZwnO1xcbiAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgY2xzbGlzdHMgPSBmaW5kSXRlbXNCeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgICAgICB2YXIgbmV3Y2xzbGlzdCA9ICQuZGF0YUNvbnZlcnQoY2xzbGlzdHMpO1xcbiAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgIHZhciB0aXRsZXM9W2Ake2N1c3RvbS7mraPluo/popzoibJ9XFxcIj7mraPluo9gLGAke2N1c3RvbS7pgIbluo/popzoibJ9XFxcIj7pgIbluo9gXTtcXG4gICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgICAgIG5ld2Nsc2xpc3QucmV2ZXJzZSgpO1xcbiAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoc2hzb3J0ICsgJ19saW5lJywgbmV3Y2xzbGlzdCk7XFxuXFxuICAgICAgICAgICAgICAgIHZhciBvYmogPSBmaW5kSXRlbShzaHNvcnQgKyAnX2F2YXRhcicpXFxuXFxuICAgICAgICAgICAgICAgIGlmIChjb25mID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX2F2YXRhcicsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogb2JqLnRpdGxlLnJlcGxhY2UodGl0bGVzWzFdLCB0aXRsZXNbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCArICdfc29ydCcsICcwJyk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCArICdfYXZhdGFyJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBvYmoudGl0bGUucmVwbGFjZSh0aXRsZXNbMF0sIHRpdGxlc1sxXSksXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JywgJzEnKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5YiH5o2i5o6S5bqP5oiQ5YqfJztcXG4gICAgICAgICAgICB9LCBzaHNvcnQsdmFyaSxjdXN0b20pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICBpbWc6IGN1c3RvbS7lm77moIcgLFxcbiAgICAgICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICAgIGlkOnNoc29ydCsnX2F2YXRhcicsXFxuICAgICAgICAgICAgICBsb25nQ2xpY2s6dGhpcy5zZXRMb25nY2xpY2soc2hzb3J0KSxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgdmFyIOaKmOWPoCA9ICfigJzigJzigJ3igJ08Yj4nICsgJ+KYtycuZm9udGNvbG9yKFxcXCIjRDNEM0QzXFxcIik7XFxuICAgICAgICB2YXIg5bGV5byAID0gJ+KAnOKAnOKAneKAnTxiPicgKyAn4piwJy5mb250Y29sb3IoXFxcIiNGRkE1MDBcXFwiKTtcXG4gICAgICAgIHZhciBmb2xk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sIGNzKTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShidG4uZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBidG4udGl0bGUucmVwbGFjZShmb2xkc1swXSwgZm9sZHNbMV0pLFxcbiAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYoZm9sZD09JzEnKXtcXG4gICAgICAgICAgICAgICAgICBwdXRNeVZhcihmb2xkbmFtZSwgICcwJyk7XFxuICAgICAgICAgICAgICAgIHZhciBwY2xzID0gZmluZEl0ZW1zQnlDbHMoc2hzb3J0KTtcXG4gICAgICAgICAgICAgICAgdmFyIGN4ID0gJC5kYXRhQ29udmVydChwY2xzKTtcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoc2hzb3J0ICsgJ19jbHMnLCBjeCk7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQpO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGJ0bi5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGJ0bi50aXRsZS5yZXBsYWNlKGZvbGRzWzFdLCBmb2xkc1swXSksXFxuICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nICsgKGZvbGQgPT09ICcxJyA/ICfmlLbotbcnIDogJ+WxleW8gCcpO1xcbiAgICAgICAgICAgIH0sIGZvbGRuYW1lLHNoc29ydCksXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IHNoc29ydCArICdfYnV0dG9uJyxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgdGhpcy5jcmVhdGVQTGlzdCh0YWJzLHZhcmksc2hzb3J0LGN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AgICAgICAgICAgaWYgKE9iamVjdC5rZXlzKHBsKS5sZW5ndGggPT0gMSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIHZhciBmb2xkID0gZ2V0TXlWYXIoZm9sZG5hbWUsICcxJyk7XFxuICAgICAgICAgICAgdmFyIG9iaiA9IGZpbmRJdGVtKHNoc29ydCArICdfYXZhdGFyJylcXG4gICAgICAgICAgICBpZiAoZm9sZCA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGJjbHMgPSBmaW5kSXRlbShzaHNvcnQgKyAnX2J1dHRvbicpO1xcbiAgICAgICAgICAgICAgICB2YXIgdGNscyA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCArICdfdGFiJyk7XFxuICAgICAgICAgICAgICAgIHZhciBsY2xzID0gZmluZEl0ZW0oc2hzb3J0ICsgJ19saW5lJyk7XFxuICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICB2YXIgcGNscyA9IGZpbmRJdGVtc0J5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgICAgIHZhciBjcyA9IFtiY2xzXS5jb25jYXQodGNscywgW2xjbHNdLCBwY2xzKTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGlmKHB1c2gpe1xcbiAgICAgICAgICAgICAgICAgIHZhciBwY2xzPWZpbmRJdGVtc0J5Q2xzKHNoc29ydCsnX3B1c2h0YWInKTtcXG4gICAgICAgICAgICAgICAgICBjcz1wY2xzLmNvbmNhdChjcyk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgdmFyIGN4ID0gJC5kYXRhQ29udmVydChjcyk7XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCArICdfY2xzJywgY3gpO1xcbiAgICAgICAgICAgICAgICBpZihwdXNoKXtcXG4gICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KydfcHVzaHRhYicpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oYmNscy5leHRyYS5pZCk7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhzaHNvcnQgKyAnX3RhYicpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHNoc29ydCArICdfbGluZScpO1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoc2hzb3J0KTtcXG5cXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShvYmouZXh0cmEuaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IG9iai5kZXNjLnJlcGxhY2UoJ+WxleW8gDxmb250IGNvbG9yPVxcXCIjRkZBNTAwXFxcIj7imLAnLCAn5oqY5Y+gPGZvbnQgY29sb3I9XFxcIiNEM0QzRDNcXFwiPuKYtycpLFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoZm9sZCA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGNzID0gc3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0ICsgJ19jbHMnKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHNoc29ydCArICdfYXZhdGFyJywgY3MpO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKG9iai5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogb2JqLmRlc2MucmVwbGFjZSgn5oqY5Y+gPGZvbnQgY29sb3I9XFxcIiNEM0QzRDNcXFwiPuKYtycsICflsZXlvIA8Zm9udCBjb2xvcj1cXFwiI0ZGQTUwMFxcXCI+4piwJyksXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHB1dE15VmFyKGZvbGRuYW1lLCBmb2xkID09PSAnMScgPyAnMCcgOiAnMScpO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nICsgKGZvbGQgPT09ICcxJyA/ICfmlLbotbcnIDogJ+WxleW8gCcpO1xcbiAgICAgICAgfSwgZm9sZG5hbWUsIHNoc29ydCwocGFyc2VbJ+aOqOmAgSddP3RydWU6ZmFsc2UpKTtcXG4gICAgICAgIHZhciBkZXNjID0gKGZvbGQgPT09ICcwJyA/IOaKmOWPoCA6IOWxleW8gCkgKyAnXFxcXHQnO1xcbiAgICAgICAgXFxuICAgICAgICBpZihleHAubGVuZ3RoPT0xKXtcXG4gICAgICAgICAgICB1cmw9J2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIGRlc2M9Jyc7XFxuICAgICAgICB9XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB2YXJpICsgJzpcXFxcdFxcXFx0JyArICflhbEnICsgU3RyaW5nKHRhYnMubGVuZ3RoKS5mb250Y29sb3IoJyM0NjgyQjQnKSArICfmnaHnur/ot68nLFxcbiAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogY3VzdG9tLuWbvuaghyxcXG4gICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogc2hzb3J0ICsgJ19hdmF0YXInLFxcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6dGhpcy5zZXRMb25nY2xpY2soc2hzb3J0KSxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgaWYodHlwZW9mKHBhcnNlWyfmjqjpgIEnXSkhPSd1bmRlZmluZWQnJiZwYXJzZVsn5o6o6YCBJ10pXFxuICAgICAgICB0aGlzLnB1c2hUYWIoJ2VyXycrdmFyaSxzaHNvcnQpO1xcbiAgICAgICAgXFxuICAgICAgICBpZiAoZm9sZCA9PSAnMCcpIHtcXG4gICAgICAgICAgICByZXR1cm5cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgdGl0bGUsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh2YXJpLCBzaHNvcnQsY3VzdG9tKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBjb25mID0gZ2V0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JywgJzAnKTtcXG4gICAgICAgICAgICAgICAgdmFyIGNsc2xpc3RzID0gZmluZEl0ZW1zQnlDbHMoc2hzb3J0KTtcXG4gICAgICAgICAgICAgICAgdmFyIG5ld2Nsc2xpc3QgPSAkLmRhdGFDb252ZXJ0KGNsc2xpc3RzKTtcXG4gICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKHNoc29ydCk7XFxuICAgICAgICAgICAgICAgIG5ld2Nsc2xpc3QucmV2ZXJzZSgpO1xcbiAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoc2hzb3J0ICsgJ19saW5lJywgbmV3Y2xzbGlzdCk7XFxuXFxuICAgICAgICAgICAgICAgIHZhciBvYmogPSBmaW5kSXRlbShzaHNvcnQgKyAnX2J1dHRvbicpXFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZXM9W2Ake2N1c3RvbS7mraPluo/popzoibJ9XFxcIj7mraPluo9gLGAke2N1c3RvbS7pgIbluo/popzoibJ9XFxcIj7pgIbluo9gXTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGlmIChjb25mID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShzaHNvcnQgKyAnX2J1dHRvbicsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogb2JqLnRpdGxlLnJlcGxhY2UodGl0bGVzWzFdLCB0aXRsZXNbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHNoc29ydCArICdfc29ydCcsICcwJyk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHNoc29ydCArICdfYnV0dG9uJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBvYmoudGl0bGUucmVwbGFjZSh0aXRsZXNbMF0sIHRpdGxlc1sxXSksXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoc2hzb3J0ICsgJ19zb3J0JywgJzEnKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvL3JlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouaOkuW6j+aIkOWKnydcXG4gICAgICAgICAgICB9LCB2YXJpLCBzaHNvcnQsY3VzdG9tKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBzaHNvcnQgKyAnX2J1dHRvbicsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIHRoaXMuY3JlYXRlUExpc3QodGFicyx2YXJpLHNoc29ydCxjdXN0b20pO1xcbiAgICB9LFxcbiAgICBzZXRMaXN0czogZnVuY3Rpb24obGlzdHMsIGluZGV4LCBzaHNvcnQscGFyc2UpIHtcXG5cXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKHNoc29ydCArICdfbGlzdCcsIGxpc3RzKTtcXG4gICAgICAgIFxcbiAgICAgICAgcGFyc2U9cGFyc2U/cGFyc2U6e307XFxuICAgICAgICB2YXIg5qC35byPPXBhcnNlLu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UHJvcGVydHkoc2hzb3J0KSl7XFxuICAgICAgICAgICAgIHBsaXN0W3Noc29ydF09e307XFxuICAgICAgICB9XFxuICAgICAgICBwbGlzdFtzaHNvcnRdWydjbHMnXT1zaHNvcnQ7XFxuICAgICAgICBwbGlzdFtzaHNvcnRdWydjb2xfdHlwZSddPeagt+W8jztcXG4gICAgICAgIHBsaXN0W3Noc29ydF1bJ3BpYyddPeWbvuaghztcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCdlcl9wbGF5bGlzdHMnLCBwbGlzdCk7XFxuICAgICAgICB9ICAgXFxuICAgICAgICBcXG4gICAgICAgIFxcbiAgICAgICAgZm9yICh2YXIgaiBpbiBsaXN0KSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGxpc3Rbal0udGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogbGlzdFtqXS51cmwsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiDmoLflvI8sXFxuICAgICAgICAgICAgICAgIHBpYzrlm77moIcsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogbGlzdFtqXS51cmwucmVwbGFjZSgvQGxhenlSdWxlW1xcXFxzXFxcXFNdKy9nLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IHNoc29ydCxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBnZXRUYWJzOiBmdW5jdGlvbihwYXJzZSkge1xcbiAgICAgICAgdmFyIHRhYnMgPSBbXTtcXG4gICAgICAgIHZhciBhcnRzID0gcGRmYShodG1sLCBwYXJzZS7nur/ot68pO1xcbiAgICAgICAgdmFyIOe6v+i3r+WQjSA9IHBhcnNlLue6v+i3r+WQjeensDtcXG4gICAgICAgIHZhciDmm7/mjaLlh73mlbAgPSAnJztcXG4gICAgICAgIGlmI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4gICAgICAgIHZhciB0ZW1wID0gW107XFxuICAgICAgICBmb3IgKHZhciBpIGluIGNvbnRzKSB7XFxuICAgICAgICAgICAgaWYgKHBhcnNlLumAiembhuWIl+ihqCAhPSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgbGlzdHMucHVzaChwZGZhKGNvbnRzW2ldLCBwYXJzZS7pgInpm4bliJfooagpLm1hcCh4ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoeCwg6YCJ6ZuG5ZCN56ewKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHBkKHgsIOmAiembhumTvuaOpSkgKyDop6PmnpAsXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBwZChjb250c1tpXSwg6YCJ6ZuG6ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgaWYgKCHpgInpm4bpk77mjqUuaW5jbHVkZXMoJ2hyZWYnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gcGRmaChjb250c1tpXSwg6YCJ6ZuG6ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB0ZW1wLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoY29udHNbaV0sIOmAiembhuWQjeensCksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCArIOino+aekCxcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBsZXQg5YCS5bqPID0gcGFyc2Uu5YCS5bqPID8gcGFyc2Uu5YCS5bqPIDogZmFsc2U7XFxuICAgICAgICB2YXIgcmVzdWx0cyA9IGxpc3RzLmxlbmd0aCA/IGxpc3RzID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PiB7XFxuICAgICAgICAgICAgdmFyIHRhYnMgPSBbJ+S4u+e6vyddO1xcbiAgICAgICAgICAgIGlmIChpdGVtLue6v+i3ryAhPSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgdGFicyA9IHRoaXMuZ2V0VGFicyhpdGVtKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcHV0TXlWYXIocGxheStpKydfdGFicycsdGFicyk7XFxuICAgICAgICAgICAgaWYoaXRlbS5BamF4KXtcXG4gICAgICAgICAgICAgICAgaWYgKG1vZGUgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRUYWJzKHRhYnMsIGl0ZW0u57G75Z6LLCBwbGF5ICsgaSxpdGVtKTtcXG4gICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFRhYnMyKHRhYnMsIGl0ZW0u57G75Z6LLCBwbGF5ICsgaSxpdGVtLHBlKTtcXG4gICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgIHB1dE15VmFyKCdlcl9odG1sJyxodG1sKTtcXG4gICAgICAgICAgICAgICAgIHB1dE15VmFyKCdlcl91cmwnLE1ZX1VSTCk7XFxuXFxuICAgICAgICAgICAgICAgIHZhciBsaXN0cz1mdW5jKGdldE15VmFyKCdlcl8nK2l0ZW0u57G75Z6LLCcwJyksTVlfVVJMKTtcXG4gICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICB2YXIgbGlzdHMgPSB0aGlzLmdldExpc3RzKGl0ZW0sIHBsYXkraSk7XFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAgaWYgKGxpc3RzLnNvbWUoeCA9PiB4Lmxlbmd0aCA+IDApKSB7XFxuICAgICAgICAgICAgICAgIGlmIChtb2RlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0VGFicyh0YWJzLCBpdGVtLuexu+WeiywgcGxheSArIGksaXRlbSk7XFxuICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRUYWJzMih0YWJzLCBpdGVtLuexu+WeiywgcGxheSArIGksaXRlbSxwZSk7XFxuICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKGdldE15VmFyKCdlcl8nICsgaXRlbS7nsbvlnosgKyAnZm9sZCcsICcxJykgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgIHRoaXMuc2V0TGlzdHMobGlzdHMsIGdldE15VmFyKCdlcl8nK2l0ZW0u57G75Z6LLCAnMCcpLCBwbGF5ICsgaSxpdGVtKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcbn1cXG5cXG5cXG5sZXQgTWV0aG9kcz17XFxuICAgIC8v5aSa6YCJ5qih5Z2XXFxuICAgIE11bHRpU2VsZWN0TW9kZTpmdW5jdGlvbihuYW1lLGlkLHNoc29ydCl7XFxuICAgICAgICByZXR1cm4gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZGF0YXRpdGxlLCBkYXRhdXJsLHNoc29ydCkgPT4ge1xcbiAgICAgICAgICAgIGZ1bmN0aW9uIHVuaXF1ZShhcnIpIHtcXG4gICAgICAgICAgICBjb25zdCByZXMgPSBuZXcgTWFwKClcXG4gICAgICAgICAgICByZXR1cm4gYXJyLmZpbHRlcigoYSkgPT4gIXJlcy5oYXMoYS51cmwpICYmIHJlcy5zZXQoYS51cmwsIDEpKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgZHVvc2VsZWN0ID0gc3RvcmFnZTAuZ2V0TXlWYXIoc2hzb3J0K1xcXCJfZHVvc2VsZWN0XFxcIikgPyBzdG9yYWdlMC5nZXRNeVZhcihzaHNvcnQrXFxcIl9kdW9zZWxlY3RcXFwiKSA6IFtdO1xcbiAgICAgICAgICAgIGlmIChkdW9zZWxlY3QuZmluZEluZGV4KHggPT4geC51cmwgPT09IGRhdGF1cmwpID09IC0xKSB7XFxuICAgICAgICAgICAgICAgIGR1b3NlbGVjdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBkYXRhdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGRhdGF1cmxcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgZHVvc2VsZWN0ID0gdW5pcXVlKGR1b3NlbGVjdClcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShkYXRhdXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogYOKAnOKAnOKAneKAnTxzcGFuIHN0eWxlPVxcXCJjb2xvcjojRkY1NzMzXFxcIj5gICsgZGF0YXRpdGxlLFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiByZW1vdmVCeVZhbHVlKGFyciwgdmFsKSB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcnJbaV1bJ3VybCddID09IHZhbCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVtb3ZlQnlWYWx1ZShkdW9zZWxlY3QsIGRhdGF1cmwpXFxuICAgICAgIC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