Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@AI聚集@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoiQUnogZrpm4YiLCJhdXRob3IiOiIiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IyNmeWNsYXNzIyNmeXBhZ2UiLCJ2ZXJzaW9uIjo1NCwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IummlumhtSbosYzosYYm6Iy25p2v54uQJuaQnOeJhybpnZLpuqYm55S15b2x54uXJuiMtuadr+iZjiblnJ/mi6jpvKAiLCJ0eXBlIjoidG9vbCIsImNsYXNzX3VybCI6ImhvbWUmaHR0cHM6Ly93d3cud2FuZG91LnByby8maHR0cHM6Ly9jdXBmb3guYXBwLyZodHRwOi8vc291cGlhbi5kZS8maHR0cHM6Ly93d3cucWltYWl0di5jb20vJmh0dHBzOi8vd3d3LmRpYW55aW5nZ291LmNvbS95aW5na3UvJmh0dHBzOi8vd3d3LjcyNTk5OC5jb20veWluZ2t1Jmh0dHBzOi8vd3d3LnRic2R5LmNvbS9tL2luZGV4Lmh0bWwiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbnZhciBteXVybCA9IE1ZX1VSTC5zcGxpdChcIiMjXCIpWzFdO1xuXG5sZXQgYW5jaG9ySWQgPSBteXVybDtcbmxldCBqcyA9ICQucmVxdWlyZShcImhpa2VyOi8vcGFnZS94NWFpXCIpKE1ZX1JVTEUudGl0bGUsIGFuY2hvcklkKTtcblxuZnVuY3Rpb24gbG9hZFVybChteXVybCwgbXlydWxlLCBtKSB7XG4gICAgc2V0UmVzdWx0KFt7XG4gICAgICAgIGNvbF90eXBlOiBcIng1X3dlYnZpZXdfc2luZ2xlXCIsXG4gICAgICAgIHVybDogbXl1cmwsXG4gICAgICAgIGRlc2M6IFwiZmxvYXQmJnRvcFwiLCAgICAgICAgXG4gICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICBmbG9hdFZpZGVvOiB0cnVlLFxuICAgICAgICAgICAgY2FuQmFjazogdHJ1ZSxcbiAgICAgICAgICAgIHVybEludGVyY2VwdG9yOiAkLnRvU3RyaW5nKChNWV9SVUxFLG1vYmFuKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKGlucHV0LnN0YXJ0c1dpdGgoJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5vcGVuKEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiAn5LqR55uY5rGH5b2xJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdXJsICsgJz8/ZnlwYWdlJ1xuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dClcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LnN0YXJ0c1dpdGgoJ2h0dHBzOi8vd3d3LnFpbWFpdHYuY29tL2luZGV4LnBocD9zJykpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChpbnB1dClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IHBkZmEoaHRtbCwgXCJib2R5JiZpZnJhbWVcIik7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhcnIubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVybCA9IHBkZmgoYXJyWzBdLCAnaWZyYW1lJiZzcmMnKVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCwgTVlfUlVMRSxtb2JhbikgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB1PSdoaWtlcjovL2VtcHR5P3U9JyArIHVybDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1PW1vYmFuPT0nMCc/dTp1KycjaW1tZXJzaXZlVGhlbWUjJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEub3BlbihKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6IE1ZX1JVTEUudGl0bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5b2x54mH6K+m5oOFJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JvdXA6IE1ZX1JVTEUuZ3JvdXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZVJ1bGU6IE1ZX1JVTEUucHJlUnVsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZXM6IE1ZX1JVTEUucGFnZXMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluZFJ1bGU6IE1ZX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCwgTVlfUlVMRSxtb2JhbilcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIWlucHV0LnN0YXJ0c1dpdGgoXCJodHRwczovL2N1cGZveC5hcHAvXCIpICYmICFpbnB1dC5zdGFydHNXaXRoKFwiaHR0cHM6Ly81MXNvdWp1LmNvbS9cIikgJiZcbiAgICAgICAgICAgICAgICAgICAgIWlucHV0LnN0YXJ0c1dpdGgoXCJodHRwczovL3d3dy5kaWFueWluZ2dvdS5jb20vXCIpICYmICFpbnB1dC5zdGFydHNXaXRoKFwiaHR0cHM6Ly93d3cud2FuZG91LnByby9cIikgJiYgIWlucHV0LnN0YXJ0c1dpdGgoXCJodHRwOi8vc291cGlhbi54eXovXCIpICYmICFpbnB1dC5zdGFydHNXaXRoKFwiaHR0cHM6Ly93d3cucWltYWl0di5jb20vXCIpICYmICFcbiAgICAgICAgICAgICAgICAgICAgaW5wdXQuc3RhcnRzV2l0aChcImh0dHBzOi8vd3d3LjcyNTk5OC5jb20vXCIpICYmICFpbnB1dC5pbmNsdWRlcyhcInNlYXJjaFwiKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsLCBNWV9SVUxFLG1vYmFuKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdT0naGlrZXI6Ly9lbXB0eT91PScgKyB1cmw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdT1tb2Jhbj09JzAnP3U6dSsnI2ltbWVyc2l2ZVRoZW1lIyc7XG4gICAgICAgICAgICAgICAgICAgICAgICBmYmEub3BlbihKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZTogTVlfUlVMRS50aXRsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+W9seeJh+ivpuaDhScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3JvdXA6IE1ZX1JVTEUuZ3JvdXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlUnVsZTogTVlfUlVMRS5wcmVSdWxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VzOiBNWV9SVUxFLnBhZ2VzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5kUnVsZTogTVlfUlVMRS5kZXRhaWxfZmluZF9ydWxlXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgIH0sIGlucHV0LCBNWV9SVUxFLG1vYmFuKVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sIE1ZX1JVTEUsZ2V0SXRlbSgnYWknLCcwJykpLFxuICAgICAgICAgICAganM6IGpzLFxuICAgICAgICB9XG4gICAgfV0pO1xufVxuXG5pZiAobXl1cmwgPT0gJ2hvbWUnKSB7XG4gICAgcmVmcmVzaFg1RGVzYygnMCcpXG4gICAgJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvcHJvJylcbn0gZWxzZSB7XG4gICAgbG9hZFVybChteXVybCwgTVlfUlVMRSk7XG59Iiwic2VhcmNoX3VybCI6Imhpa2VyOi8vZW1wdHkjIyoqIiwiZ3JvdXAiOiLikaJBSSIsInNlYXJjaEZpbmQiOiJqczpcbnZhciBkID0gW107XG5sZXQga2V5ID0gTVlfVVJMLnNwbGl0KFwiIyNcIilbMV07XG5kLnB1c2goe1xuICAgIHRpdGxlOiBcIueCueaIkeW8gOWni+iBmuWQiOaQnOe0olwiICsga2V5LFxuICAgIHVybDogXCJoaWtlcjovL3BhZ2Uvc291cFwiLFxuICAgIGV4dHJhOiB7XG4gICAgICAgIHBhZ2VUaXRsZTogXCLmkJzntKJcIiArIGtleSxcbiAgICAgICAga2V5OiBrZXlcbiAgICB9XG59KTtcblxuc2V0UmVzdWx0KGQpOyIsImRldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJkZXRhaWxfZmluZF9ydWxlIjoianM6XG5sb2coTVlfVVJMKVxuXG5ldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL3AnKSkucnVsZSkiLCJzZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsInNkZXRhaWxfZmluZF9ydW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ldHVybiAndmlkZW86Ly8nICsgaW5wdXRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICd2aWRlbzovLycgKyBpbnB1dFxcbiAgICAgICAgfVxcbiAgICB9KVxcblxcbiAgICB0cnkge1xcbiAgICAgICAgTVlfVVJMID0gJ2hpa2VyOi8vZW1wdHkjIycgKyB1cmxcXG4gICAgICAgIHJlcXVpcmUoY29uZmlnLuiHquWKqOWMuemFjSk7XFxuICAgICAgICDoh6rliqjkuoznuqcobGF6eSk7XFxuICAgICAgICBwdXRNeVZhcignYm0nLCAnMScpXFxuICAgIH0gY2F0Y2gge1xcbiAgICAgICAgcHV0TXlWYXIoJ2JtJywgJzAnKVxcbiAgICB9XFxufVxcblxcblxcbmxvZygn5qih5p2/OicgKyBnZXRNeVZhcignYm0nLCAnMCcpKVxcblxcbmlmIChnZXRNeVZhcignYm0nLCAnMCcpID09ICcwJykge1xcblxcbiAgICB2YXIgZCA9IFtdO1xcbiAgICBNWV9VUkwgPSB1cmxcXG5cXG4gICAgZnVuY3Rpb24gZ2V0VGl0bGUoaHRtbCwgcykge1xcbiAgICAgICAgdmFyIHRpdGxlID0gJyc7XFxuICAgICAgICB2YXIgdGl0bGVzID0gcGRmYShodG1sLCBzKTtcXG4gICAgICAgIC8vbG9nKHRpdGxlcyk7XFxuICAgICAgICBpZiAodGl0bGVzLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIHRpdGxlXFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKGxldCB4IG9mIHRpdGxlcykge1xcbiAgICAgICAgICAgIGlmICh4LmluY2x1ZGVzKCc8Zm9udCcpKSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlID0gcGRmaCh4LCAnaDEtLWZvbnQmJlRleHQnKTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHguaW5jbHVkZXMoJzxzcGFuJykpIHtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSBwZGZoKHgsICdoMS0tc3BhbiYmVGV4dCcpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlID0gcGRmaCh4LCAnVGV4dCcpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodGl0bGUgIT0gJycpIHtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHRpdGxlXFxuICAgIH1cXG5cXG4gICAgdmFyIGh0bWwgPSBmZXRjaFBDKHVybClcXG4gICAgdmFyIHRpdGxlID0gZ2V0VGl0bGUoaHRtbCwgJ2JvZHkmJmgxJyk7XFxuICAgIGlmICh0aXRsZSA9PSAnJykge1xcbiAgICAgICAgdGl0bGUgPSBnZXRUaXRsZShodG1sLCBcXFwiYm9keSYmaDNbY2xhc3MqPSd0aXRsZSddXFxcIik7XFxuICAgIH1cXG4gICAgaWYgKHRpdGxlID09ICcnKSB7XFxuICAgICAgICB0aXRsZSA9IGdldFRpdGxlKGh0bWwsIFxcXCJoZWFkJiZ0aXRsZVxcXCIpO1xcbiAgICB9XFxuXFxuICAgIGlmIChkdGl0bGUgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgIHNldFBhZ2VUaXRsZShkdGl0bGUpXFxuICAgIH0gZWxzZSBpZiAoZnJvbSA9PSAnaG9tZScgfHxnZXRQYWdlVGl0bGUoKS5pbmNsdWRlcygn6K+m5oOFJykpIHtcXG4gICAgICAgIGlmICh0aXRsZSAhPSAnJykge1xcbiAgICAgICAgICAgIGlmICh0aXRsZS5pbmNsdWRlcygnLScpKSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUuc3BsaXQoJy0nKVswXS50cmltKClcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc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mjpLpmaRcXG4gICAgICAgIGxldCByZWcgPSAvXFxcXC586auY5riF55u05pKtfOWGmeecn+aOqOiNkHzlvbHpmaJ85b2x6KeGfOiTneWFieeUteW9sXzpq5jmuIXnlLXlvbF856ys5LiA5a2jfOesrOS6jOWto3znrKzkuInlraN856ys5Zub5a2jfOesrOS6lOWtoy87XFxuICAgICAgICBpZiAodGl0ICE9IFxcXCJcXFwiICYmICF0aXQuaW5jbHVkZXMoaXQpIHx8IHJlZy50ZXN0KGl0KSkge1xcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBpdC5tYXRjaCgv5Y6f55S7fOWkh+eUqHzok53lhYl86LaF5riFfOmrmOa4hXzmraPniYd86Z+p54mIfDRLfDRrfDEwODBQfDcyMFB8VEN8SER8QkR85Lit5a2XLylcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBub3RDaGFwdGVyKGl0KSB7XFxuICAgICAgICBpZiAoaXQgPT0gbnVsbCB8fCBpdC50ZXh0ID09IG51bGwpIHtcXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBpdC50ZXh0Lm1hdGNoKC9bMC05XVxcXFwuWzAtOV3liIYvKTtcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBpc0NoYXB0ZXIoaXQsIHByZSwgbmV4dCkge1xcbiAgICAgICAgaWYgKG5vdENoYXB0ZXIoaXQpKSB7XFxuICAgICAgICAgICAgLy/kvJjlhYjmjpLpmaRcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9XFxuICAgICAgICAvL+WIpOaWreaYr+S4jeaYr+eUteW9sVxcbiAgICAgICAgaWYgKGlzTW92aWUoaXQpKSB7XFxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gaXNDaGFwdGVyMChpdCwgcHJlKSB8fCBpc0NoYXB0ZXIwKGl0LCBuZXh0KTtcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBnZXRDaGFwdGVyTnVtKGl0KSB7XFxuICAgICAgICBpZiAoaXQgPT0gbnVsbCB8fCBpdC50ZXh0ID09IG51bGwpIHtcXG4gICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICB9XFxuICAgICAgICBpdCA9IGl0LnRleHQgfHwgXFxcIlxcXCI7XFxuICAgICAgICBpZiAoaXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICB9XFxuICAgICAgICBpdCA9IGNsZWFyVGV4dChpdCk7XFxuICAgICAgICBsZXQgcmVnID0gL15bMC05XSokLztcXG4gICAgICAgIGlmICghcmVnLnRlc3QoaXQpKSB7XFxuICAgICAgICAgICAgcmV0dXJuIC0xO1xcbiAgICAgICAgfVxcbiAgICAgICAgaXQgPSBwYXJzZUludChpdCk7XFxuICAgICAgICBpZiAoaXNOYU4oaXQpKSB7XFxuICAgICAgICAgICAgcmV0dXJuIC0xO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGl0ID4gMTkwMCAmJiBpdCA8IDIxMDApIHtcXG4gICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gaXQ7XFxuICAgIH1cXG5cXG4gICAgZnVuY3Rpb24gaXNDaGFwdGVyMChpdCwgYnJvdGhlcikge1xcbiAgICAgICAgLyppZiAoZGVidWcpIHtcXG4gICAgICAgICAgICBsb2coe1xcbiAgICAgICAgICAgICAgICBpdDogaXQsXFxuICAgICAgICAgICAgICAgIGJyb3RoZXI6IGJyb3RoZXJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0qL1xcbiAgICAgICAgaXQgPSBnZXRDaGFwdGVyTnVtKGl0KTtcXG4gICAgICAgIC8vaWYgKGRlYnVnKSBsb2coaXQpO1xcbiAgICAgICAgaWYgKGl0IDwgMCkge1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pICsgXFxcIiNpZ25vcmVJbWc9dHJ1ZSNcXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXkgPSBmeV9icmlkZ2VfYXBwLmdldEhlYWRlclVybCh1cmxzW2tdLnJlcGxhY2UoLy4qP3VybD0vLCBcXFwiXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD9wdXNodXJsPScgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogZG9jdW1lbnQudGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IHBsYXlcXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSwgdGZwdXNoKTtcXG5cXG4gICAgZnVuY3Rpb24gX193ZWIobW9kZSkge1xcbiAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHRmcHVzaCkgPT4ge1xcbiAgICAgICAgICAgIGxldCB1cmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgICAgICBsZXQgcmVnID0gL1xcXFwuaHRtbHxcXFxcLmNzc3xcXFxcLmpzLztcXG4gICAgICAgICAgICBmb3IgKGxldCBrIGluIHVybHMpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCFyZWcudGVzdCh1cmxzW2tdKSAmJiB1cmxzW2tdLm1hdGNoKC9cXFxcLm1wNHxcXFxcLm0zdTgvKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5sb2codXJsc1trXSk7XFxuICAgICAgICAgICAgICAgICAgICAvL3JldHVybiBmeV9icmlkZ2VfYXBwLmdldEhlYWRlclVybCh1cmxzW2tdLnJlcGxhY2UoLy4qP3VybD0vLCBcXFwiXFxcIikpICsgXFxcIiNpZ25vcmVJbWc9dHJ1ZSNcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRmcHVzaCA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnlfYnJpZGdlX2FwcC5nZXRIZWFkZXJVcmwodXJsc1trXS5yZXBsYWNlKC8uKj91cmw9LywgXFxcIlxcXCIpKSArIFxcXCIjaWdub3JlSW1nPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXkgPSBmeV9icmlkZ2VfYXBwLmdldEhlYWRlclVybCh1cmxzW2tdLnJlcGxhY2UoLy4qP3VybD0vLCBcXFwiXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/cHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBkb2N1bWVudC50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IHBsYXlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCBtb2RlKTtcXG4gICAgfVxcblxcbiAgICAkLmV4dGVuZCh7XFxuICAgICAgICBsd2ViOiBfX3dlYlxcbiAgICB9KVxcblxcbiAgICBsZXQgd2ViID0gZ2V0SXRlbSgnd2ViJywgJzAnKTtcXG4gICAgdmFyIHB1c2h0eXBlID0gWyfliJfooagnLCAn5Y2V6ZuGJ11cXG4gICAgdmFyIHBhcnNldHlwZSA9IFsnV2Vi5ZeF5o6iOjAnLCAn6KeG6aKR5ZeF5o6iOjEnLCAnZG3nm5LlrZA6MiddXFxuICAgIGxvZygn5o6o6YCB57G75Z6LOicgKyBwdXNodHlwZVtwYXJzZUludCh0ZnB1c2gpXSlcXG4gICAgbG9nKCfll4XmjqLnsbvlnos6JyArIHBhcnNldHlwZVtwYXJzZUludCh3ZWIpXS5zcGxpdCgnOicpWzBdKVxcblxcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcbiAgICAgICAgbGV0IHQgPSBpdC50ZXh0O1xcbiAgICAgICAgaWYgKCFpdC5ocmVmIHx8IGl0LmhyZWYgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBwcmUgPSBpID09IDAgPyBudWxsIDogYXJyW2kgLSAxXTtcXG4gICAgICAgIGxldCBuZXh0ID0gaSA9PSAoYXJyLmxlbmd0aCAtIDEpID8gbnVsbCA6IGFycltpICsgMV07XFxuICAgICAgICBpZiAoaXNDaGFwdGVyKGl0LCBwcmUsIG5leHQpKSB7XFxuICAgICAgICAgICAgaWYgKHRmcHVzaCA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgLyp2YXIgdXJseCA9IFxcXCJ3ZWJSdWxlOi8vXFxcIiArIGl0LmhyZWYgKyBcXFwiQFxcXCIgKyBfd2ViO1xcbiAgICAgICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAganNMb2FkaW5nSW5qZWN0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWYsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5cycsXFxuICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5tNGEnLCAnLm1wMycsICcuZmx2JywgJy5hdmknLCAnLjNncCcsICcubXBlZycsICcud212JywgJy5tb3YnLCAnLnJtdmInLCAnLmdpZicsICcuanBlZycsICcucG5nJywgJy5pY28nLCAnLnN2ZyddXFxuICAgICAgICAgICAgICAgIH07Ki9cXG4gICAgICAgICAgICAgICAgdmFyIHVybHggPSAnaGlrZXI6Ly9wYWdlL3B1c2g/JnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGdldFBhZ2VUaXRsZSgpLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IGl0LnRleHQgKyAnJCcgKyBpdC5ocmVmLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImNvbnRlbnRcXFwiOiBNWV9VUkwudGl0bGUsXFxuICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgdmFyIGV4dHJheCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmLFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmICh3ZWIgPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdXJseCA9IFxcXCJ3ZWJSdWxlOi8vXFxcIiArIGl0LmhyZWYgKyBcXFwiQFxcXCIgKyBfd2ViO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGV4dHJheCA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqc0xvYWRpbmdJbmplY3Q6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWYsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLm00YScsICcubXAzJywgJy5mbHYnLCAnLmF2aScsICcuM2dwJywgJy5tcGVnJywgJy53bXYnLCAnLm1vdicsICcucm12YicsICcuZ2lmJywgJy5qcGVnJywgJy5wbmcnLCAnLmljbycsICcuc3ZnJ11cXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2ViID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybHggPSBcXFwidmlkZW86Ly9cXFwiICsgaXQuaHJlZjtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBleHRyYXggPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWYsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3ZWIgPT0gJzInKSB7XFxuICAgICAgICAgICAgICAgICAgICBsYXp5ID0gJCgnJykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9sYXp5VG9YNT9ydWxlPWRt55uS5a2QJykudmlkZW9YNSgpO1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHZhciB1cmx4ID0gaXQuaHJlZiArIGxhenlcXG4gICAgICAgICAgICAgICAgICAgIHZhciBleHRyYXggPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWYsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdCxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmx4LFxcbiAgICAgICAgICAgICAgICBwaDogdCArIFxcXCIkXFxcIiArIGl0LmhyZWYsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJheFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGlmIChkLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAvL+WMuemFjeWksei0pVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ4NV93ZWJ2aWV3X3NpbmdsZVxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcImZsb2F0JiYxMDAlXFxcIixcXG4gICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBmbG9hdFZpZGVvOiB0cnVlLFxcbiAgICAgICAgICAgICAgICBjYW5CYWNrOiB0cnVlLFxcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbXFxcIi5naWZcXFwiLCBcXFwiL2FkL1xcXCIsIFxcXCJnb29nbGVcXFwiLCBcXFwiL3NoL3RvL1xcXCIsIFxcXCIuR0lGXFxcIl1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIHRvYXN0KFxcXCJBSeWMuemFjeWksei0pe+8jOW3suS9v+eUqFg15Yqg6L29XFxcIik7XFxuICAgICAgICBsb2coXFxcIuW9k+WJjemhtemdouWcsOWdgDogXFxcIiArIHVybClcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIC8v5Li657q/6Lev5Yqg5YiG5Ymy57q/XFxuICAgICAgICBsZXQgZDIgPSBbXTtcXG4gICAgICAgIGxldCBtdGFiID0gW107XFxuXFxuICAgICAgICBkID0gdW5pcXVlKGQpXFxuICAgICAgICAvL2xvZyhCaXRUUylcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGQyLnB1c2goZFtpXSk7XFxuICAgICAgICAgICAgbXRhYi5wdXNoKGRbaV0ucGgpO1xcbiAgICAgICAgICAgIGlmIChpIDwgZC5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGRbaV07XFxuICAgICAgICAgICAgICAgIGxldCB0MSA9IHBhcnNlSW50KGNsZWFyVGV4dChpdC50aXRsZSkpO1xcbiAgICAgICAgICAgICAgICBsZXQgbmV4dCA9IGRbaSArIDFdO1xcbiAgICAgICAgICAgICAgICBsZXQgdDIgPSBwYXJzZUludChjbGVhclRleHQobmV4dC50aXRsZSkpO1xcbiAgICAgICAgICAgICAgICBpZiAodDIgLSB0MSA+IDEgfHwgdDEgLSB0MiA+IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIG10YWIucHVzaCgnIycpO1xcbiAgICAgICAgICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGxldCBwbGF5bCA9IG10YWIuam9pbignIycpLnJlcGx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ICfljZXmjqjwn5S0JyksXFxuICAgICAgICAgICAgdXJsOiBgaGlrZXI6Ly9lbXB0eUBsYXp5UnVsZT0uanM6Z2V0SXRlbSgnd2VicHVzaCcsJzAnKT09JzEnP3NldEl0ZW0oJ3dlYnB1c2gnLCcwJyk6c2V0SXRlbSgnd2VicHVzaCcsJzEnKTtyZWZyZXNoUGFnZSgpOyd0b2FzdDovL+WIh+aNouaIkOWKn++8gSdgLFxcblxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgZDIuc3BsaWNlKDIsIDAsIHtcXG4gICAgICAgICAgICB0aXRsZTogcGFyc2V0eXBlW3BhcnNlSW50KHdlYildLnNwbGl0KCc6JylbMF0sXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGluZikgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0SXRlbSgnd2VicHVzaCcsICcwJykgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5Y2V5o6o5qih5byP5byA5ZCv5peg5rOV5L+u5pS5J1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCBhbGxfY29scyA9IGluZlxcbiAgICAgICAgICAgICAgICBsZXQgY29sID0gc3RvcmFnZTAuZ2V0SXRlbSgn5ZeF5o6iJywgJ1dlYuWXheaOoicpO1xcbiAgICAgICAgICAgICAgICBsZXQg5ZeF5o6iID0gYWxsX2NvbHMubWFwKChpdCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0LnNwbGl0KCc6JylbMF0gPT09IGNvbCA/ICfinqHvuI8nICsgaXQgOiBpdDtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGxldCB0aXBzID0gJ+ivt+mAieaLqeWXheaOouaooeW8jyc7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKOWXheaOoiwgMSwgdGlwcykuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQucmVwbGFjZSgv4p6h77iPL2csICcnKTtcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ+WXheaOoicsIGlucHV0LnNwbGl0KCc6JylbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGUgPSBpbnB1dC5zcGxpdCgnOicpWzFdXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCd3ZWInLCBtb2RlKVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IG9sZElkcyA9IChmaW5kSXRlbXNCeUNscygncGxheXMnKSkubWFwKGl0ID0+IGl0LmV4dHJhLmlkKTtcXG4gICAgICAgICAgICAgICAgICAgIG9sZElkcy5mb3JFYWNoKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtb2RlID09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHgsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcIndlYlJ1bGU6Ly9cXFwiICsgeCArIFxcXCJAXFxcIiArICQubHdlYignMCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc0xvYWRpbmdJbmplY3Q6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLm00YScsICcubXAzJywgJy5mbHYnLCAnLmF2aScsICcuM2dwJywgJy5tcGVnJywgJy53bXYnLCAnLm1vdicsICcucm12YicsICcuZ2lmJywgJy5qcGVnJywgJy5wbmcnLCAnLmljbycsICcuc3ZnJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtb2RlID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHgsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcInZpZGVvOi8vXFxcIiArIHgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlzJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtb2RlID09ICcyJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHgsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogeCArICQoJycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvbGF6eVRvWDU/cnVsZT1kbeebkuWtkCcpLnZpZGVvWDUoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogeCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5cycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCdwYXJzZScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogc3RvcmFnZTAuZ2V0SXRlbSgn5ZeF5o6iJywgJ1dlYuWXheaOoicpLFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5YiH5ZeF5o6i5pa55byP5Li6OicgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBwYXJzZXR5cGUpLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiAncGFyc2UnLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgZDIudW5zaGlmdCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c21hbGw+4pqh77iPJyArIGR1cmwgKyAnPC9zbWFsbD4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgdXJsOiBkdXJsLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBpZiAoZ2V0SXRlbSgnYWknLCAnMCcpID09ICcxJykge1xcblxcbiAgICAgICAgICAgIGQyLnVuc2hpZnQoe1xcbiAgICAgICAgIC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wMS8wMS8xMDEuanBnJ11cXG5cXG5cXG5pZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgIFsn6LGM6LGGJywgJ+iMtuadr+eLkCcsICfmkJzniYcnLCAn6Z2S6bqmJywgJ+Wcn+aLqOm8oCddLm1hcCgoeCwgaSkgPT4ge1xcbiAgICAgICAgdmFyIGl4ID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ2luZGV4JywgMCk7XFxuICAgICAgICB2YXIgdGl0bGUgPSBpeCA9PSBpID8gYOKAnOKAnOKAneKAnTxmb250IGNvbG9yPSR7Z2V0UmFuZ2VDb2xvcnMoKX0+YCArIHggKyAnPC9mb250PicgOiB4O1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uXzUnLFxcbiAgICAgICAgICAgIGltZzogaW1nc1tpXSxcXG4gICAgICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCdpbmRleCcsIGkpXFxuICAgICAgICAgICAgICAgIC8vY2xlYXJNeVZhcignc291JylcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcigncGFnZScpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouaIkOWKnydcXG4gICAgICAgICAgICB9LCBpKSxcXG4gICAgICAgIH0pXFxuICAgIH0pXFxuXFxuICAgIHZhciB3ZWIgPSBnZXRJdGVtKCd3ZWInLCAnMCcpXFxuICAgIC8vbG9nKHdlYilcXG4gICAgdmFyIHRpdGxlID0gJydcXG4gICAgc3dpdGNoICh3ZWIpIHtcXG4gICAgICAgIGNhc2UgJzAnOlxcbiAgICAgICAgICAgIHRpdGxlID0gJ1dlYuWXheaOoidcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgIHRpdGxlID0gJ+inhumikeWXheaOoidcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgIHRpdGxlID0gJ2Rt55uS5a2QJ1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICB9XFxuICAgIHNldEl0ZW0oJ+WXheaOoicsIHRpdGxlKVxcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfmjqjpgIEnLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL3NldHRpbmdcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6IFxcXCLpppbpobXliqDovb06XFxcIiArIGdldEl0ZW0oJ2hvbWUnLCAn5YWzJyksXFxuICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBpZiAoZ2V0SXRlbSgnaG9tZScsICflhbMnKSA9PSAn5YWzJykge1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKCdob21lJywgJ+W8gCcpXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbSgnaG9tZScsICflhbMnKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIlxcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIHZhciB3ZWIgPSBnZXRJdGVtKCd3ZWInLCAnMCcpXFxuICAgICAgICAgICAgc3dpdGNoICh3ZWIpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCd3ZWInLCAnMScpXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCd3ZWInLCAnMicpXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCd3ZWInLCAnMCcpXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogJ3BhcnNldCdcXG4gICAgICAgIH1cXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6ICfmqKHmnb86JyArIChnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gJ+WFs+mXrScgOiAn5byA5ZCvJyksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgIHVybDogJCgnJykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIGlmIChnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oJ2FpJywgJzEnKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oJ2FpJywgJzAnKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogJ2FpbWInXFxuICAgICAgICB9XFxuICAgIH0pO1xcbn1cXG5cXG5cXG5cXG5pZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuaQnOe0olxcXCIsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5YWz6ZSu6K+N77yM5bC96YeP5bCR5a2X5LiN6KaB5aSa5a2XXFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKFxcXCJzb3VcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwic291XFxcIiwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdwYWdlJylcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiZHVybFxcXCIpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGFkZExpc3RlbmVyKFxcXCJvbkNsb3NlXFxcIiwgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICBjbGVhck15VmFy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JykgPT0gJ+W8gCcpIHtcXG4gICAgdmFyIGh0bWwgPSByZXF1ZXN0KCdodHRwOi8vc291cGlhbi5kZS8nLCB7fSlcXG5cXG5cXG4gICAgZnVuY3Rpb24gc2V0TGlzdHMoaXRlbSkge1xcbiAgICAgICAgdmFyIHRpdGxlID0gaXRlbS5zcGxpdCgnLScpWzBdXFxuICAgICAgICB2YXIgdCA9IGl0ZW0uc3BsaXQoJy0nKVsxXVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzEwLnBuZydcXG4gICAgICAgIH0pXFxuXFxuICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgYGJvZHkmJi5saXN0LWhlYWRlcjptYXRjaGVzKCR7dH0pKyomJmFgKVxcblxcbiAgICAgICAgbGlzdC5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgdmFyIG5hbWUgPSBwZGZoKHgsICcucG9zdGVyLWl0ZW0tdGl0bGUmJlRleHQnKVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IHBkZmgoeCwgJ2ltZyYmc3JjJyksXFxuICAgICAgICAgICAgICAgIHVybDogJCgnJykubGF6eVJ1bGUoKG4pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJzb3VcXFwiLCBuKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBuYW1lKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9XFxuXFxuICAgIFsn54Ot6Zeo55S15b2xLeeUteW9sScsICfng63pl6jnlLXop4bliact55S16KeG5YmnJywgJ+eDremXqOe7vOiJui3nu7zoibonLCAn54Ot6Zeo5Yqo5ryrLeWKqOa8qyddLm1hcCh4ID0+IHtcXG4gICAgICAgIHNldExpc3RzKHgpXFxuICAgIH0pXFxuXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiMS7osYzosYZcIixcInBhdGhcIjpcIndhbmRvdVwiLFwicnVsZVwiOlwianM6XFxubGV0IGR1cmwgPSBnZXRNeVZhcihcXFwiZHVybFxcXCIsIFxcXCJcXFwiKTtcXG5pZiAoZHVybCAhPSAnJykge1xcblxcbiAgICBkdXJsID0gJ2h0dHBzOi8vd3d3LndhbmRvdS5wcm8nICsgZHVybC5yZXBsYWNlKCcuaHRtbCcsICcnKVxcbiAgICBsZXQgdXJsID0gZHVybDtcXG4gICAgbGV0IGlkID0gdXJsO1xcbiAgICBsZXQgaHRtbCA9IGZldGNoKHVybCk7XFxuICAgIHZhciBydWxlID0gTVlfUlVMRS50aXRsZVxcbiAgICB2YXIgbmFtZT1wZGZoKGh0bWwsICcubW92aWUtY29udGVudCYmcCYmVGV4dCcpO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICBpbWc6IHBkZmgoaHRtbCwgJy5tb3ZpZS1pbWcmJmltZyYmc3JjJyksXFxuICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJyxcXG4gICAgICAgIGRlc2M6IHBkZmgoaHRtbCwgJy5ib3R0b20mJnAmJlRleHQnKSxcXG4gICAgICAgIHVybDogJ2hpa2VyOi8vcGFnZS94NT91PScgKyBiYXNlNjRFbmNvZGUodXJsKSxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IHVybCxcXG4gICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pXFxuICAgIC8vc2V0UmVzdWx0KGQpO1xcblxcbiAgICBsZXQgdGV4dCA9IHBkZmgoaHRtbCwgXFxcImJvZHkmJiNfX05FWFRfREFUQV9fJiZIdG1sXFxcIik7XFxuICAgIC8vbG9nKHRleHQpO1xcbiAgICBsZXQgZXJqaSA9IEpTT04ucGFyc2UodGV4dCk7XFxuICAgIC8vbG9nKGVyamkpO1xcbiAgICBsZXQgbGlzdCA9IGVyamkucHJvcHMucGFnZVByb3BzLmRhdGEucGxheURhdGE7XFxuXFxuICAgIGlmIChsaXN0ICYmIGxpc3QubGVuZ3RoID4gMCkge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBNWV9VUkwgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICBsZXQge1xcbiAgICAgICAgICAgICAgICB3cmFwXFxuICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3Rvb2w/cnVsZT1cXFwiICsgcnVsZSk7XFxuICAgICAgICAgICAgbGlzdCA9IGxpc3QubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBpdC5kYXRhX3VybDtcXG4gICAgICAgICAgICAgICAgdSA9IFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZ1PVxcXCIgKyBiYXNlNjRFbmNvZGUodSk7XFxuICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC5zaXRlX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6aXQuc2l0ZV9pY29uLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZyb206ICdob21lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6bmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3ZWI6aXQuc2l0ZV9uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAvL2FkZEl0ZW1BZnRlcihpZCwgbGlzdCk7XFxuICAgICAgICAgICAgICAgIGQgPSBkLmNvbmNhdChsaXN0KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgc2V0UmVzdWx0KGQpXFxufVxcblxcbmxldCByID0gXFxcIlxcXCI7XFxuaWYgKHMgIT0gXFxcIlxcXCIpIHtcXG5cXG4gICAganNvbiA9IFxcXCJodHRwczovL2FwaS54aWFtbS5jYy9tb3ZpZS9nZXRzZWFyY2hsaXN0L2tleXdvcmRzL1xcXCIgKyBzICsgXFxcIi9wYWdlLzEvcm93cy8xNi5qc29uXFxcIjtcXG4gICAgZGF0YSA9IEpTT04ucGFyc2UoZmV0Y2goanNvbikpLmRhdGE7XFxuICAgIGxldCB7XFxuICAgICAgICB3cmFwXFxuICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS90b29sXFxcIik7XFxuICAgIGZvciAobGV0IGl0IG9mIGRhdGEpIHtcXG4gICAgICAgIGxldCBuYW1lID0gaXQubW92aWVfbmFtZTtcXG4gICAgICAgIC8vbG9nKG5hbWUpXFxuICAgICAgICBsZXQgaW1nID0gaXQubW92aWVfaW1nX3VybDtcXG4gICAgICAgIGxldCB1cmwgPSBcXFwiaHR0cHM6Ly93d3cud2FuZG91LnByb1xcXCIgKyBpdC5tb3ZpZV91cmwucmVwbGFjZShcXFwiLmh0bWxcXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAvL2xvZyh1cmwpXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB3cmFwKG5hbWUsIHMpLFxcbiAgICAgICAgICAgIHVybDogJCh1cmwpLmxhenlSdWxlKChydWxlLCBpZCwgcyxuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBjbHMgPSBmaW5kSXRlbXNCeUNscyhpZCk7XFxuICAgICAgICAgICAgICAgIGlmICghIWNscykge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKGlkKVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaCh1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaHRtbClcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0ID0gcGRmaChodG1sLCBcXFwiYm9keSYmI19fTkVYVF9EQVRBX18mJkh0bWxcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKHRleHQpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGVyamkgPSBKU09OLnBhcnNlKHRleHQpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coZXJqaSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IGVyamkucHJvcHMucGFnZVByb3BzLmRhdGEucGxheURhdGE7XFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdCAmJiBsaXN0Lmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNWV9VUkwgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyYXBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3Rvb2w/cnVsZT1cXFwiICsgcnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0Lm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IGl0LmRhdGFfdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZ1PVxcXCIgKyBiYXNlNjRFbmNvZGUodSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gZ2V0SXRlbSgnYWknLCAnMCcpID09ICcwJyA/IHUgOiB1ICsgJyNpbW1lcnNpdmVUaGVtZSMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC5zaXRlX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6aXQuc2l0ZV9pY29uLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb206ICdob21lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdlYjppdC5zaXRlX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCBsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgfSwgTVlfUlVMRS50aXRsZSwgdXJsLCBzLG5hbWUpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibW92aWVfMV9sZWZ0X3BpY1xcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuixjOixhjwvZm9udD5cXFwiLFxcbiAgICAgICAgICAgIHBpY191cmw6IGltZyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogdXJsLFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgc2V0UmVzdWx0KGQpXFxufSBlbHNlIHtcXG5cXG59XFxuXFxuXFxuaWYgKGdldEl0ZW0oJ2hvbWUnLCAn5YWzJykgPT0gJ+W8gCcpIHtcXG4gICAgdmFyIGh0bWwgPSBmZXRjaCgnaHR0cHM6Ly93d3cud2FuZG91LnByby8nKVxcbiAgICBsZXQganNvbiA9IEpTT04ucGFyc2UocGRmaChodG1sLCBcXFwiYm9keSYmI19fTkVYVF9EQVRBX18mJkh0bWxcXFwiKSk7XFxuXFxuXFxuXFxuICAgIGZ1bmN0aW9uIHNldExpc3RzKGl0ZW0pIHtcXG4gICAgICAgIHZhciB0aXRsZSA9IGl0ZW0uc3BsaXQoJyMnKVswXVxcbiAgICAgICAgdmFyIGtleSA9IGl0ZW0uc3BsaXQoJyMnKVsxXVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzEwLnBuZydcXG4gICAgICAgIH0pXFxuXFxuICAgICAgICB2YXIgbGlzdCA9IGpzb24ucHJvcHMucGFnZVByb3BzLmZhbGxiYWNrW2tleV0uZGF0YVxcblxcbiAgICAgICAgbGlzdC5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgdmFyIG5hbWUgPSB4LmhvdF9uYW1lXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogeC5ob3RfaW1nX3VybCxcXG4gICAgICAgICAgICAgICAgZGVzYzogeC5ob3RfcmF0ZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobiwgdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZHVybCcsIHUpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUsIHguaG90X3VybClcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBbJ+eDremXqOeUteW9sSNpbmRleC1nZXRNb3ZpZUxpc3QtbW92aWUnLCAn54Ot6Zeo5Ymn6ZuGI2luZGV4LWdldFR2TGlzdC10di0yOCddLm1hcCh4ID0+IHtcXG4gICAgICAgIHNldExpc3RzKHgpXFxuICAgIH0pXFxuXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiMi7ojLbmna/ni5BcIixcInBhdGhcIjpcImN1cGZveFwiLFwicnVsZVwiOlwianM6XFxuXFxuZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS94dG9vbHMnKSkucnVsZSlcXG5cXG5pZiAocyAhPSBcXFwiXFxcIikge1xcbiAgICBsZXQge1xcbiAgICAgICAgd3JhcDEsXFxuICAgICAgICByZWh0bWxcXG4gICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3Rvb2xcXFwiKTtcXG4gICAgdmFyIGpzb24gPSBzZWFyY2gocywgc3RvcmFnZTAuZ2V0TXlWYXIoJ3BhZ2UnLCBNWV9QQUdFKSlcXG4gICAgaWYgKEpTT04uc3RyaW5naWZ5KGpzb24pICE9IFxcXCJ7fVxcXCIpIHtcXG4gICAgICAgIHZhciBsaXN0ID0ganNvbi5yZXNvdXJjZXM7XFxuICAgICAgICBsaXN0Lm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgLy9sb2coaXQud2Vic2l0ZSsnLScrcmVodG1sKGl0LnRleHQpKVxcbiAgICAgICAgICAgIHZhciB1PVxcXCJoaWtlcjovL3BhZ2UvcD91PVxcXCIgKyBiYXNlNjRFbmNvZGUoaXQudXJsKVxcbiAgICAgICAgICAgIHU9Z2V0SXRlbSgnYWknLCcwJyk9PScwJz91OnUrJyNpbW1lcnNpdmVUaGVtZSMnXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHdyYXAxKGl0LndlYnNpdGUrJy0nK3JlaHRtbChpdC50ZXh0KSwgcyksXFxuICAgICAgICAgICAgICAgIHVybDogdSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICBpbWc6aXQuaWNvbixcXG4gICAgICAgICAgICAgICAgZGVzYzogaXQud2Vic2l0ZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IHJlaHRtbChpdC50ZXh0KSxcXG4gICAgICAgICAgICAgICAgICAgIHdlYjppdC53ZWJzaXRlLFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIFxcbiAgICBzZXRSZXN1bHQoZClcXG59IGVsc2Uge1xcbiAgICBcXG59XFxuXFxuaWYoZ2V0SXRlbSgnaG9tZScsJ+WFsycpPT0n5byAJyl7XFxuXFxudmFyIGh0bWwgPSBmZXRjaFBDKCdodHRwczovL2N1cGZveC5hcHAvJywge30pXFxuXFxuXFxuZnVuY3Rpb24gc2V0TGlzdHMoaXRlbSkge1xcbiAgICB2YXIgdGl0bGUgPSBpdGVtLnNwbGl0KCctJylbMF1cXG4gICAgdmFyIHQgPSBpdGVtLnNwbGl0KCctJylbMV1cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgIGltZzogJ2h0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzEwLnBuZydcXG4gICAgfSlcXG5cXG4gICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsIGBib2R5JiYjJHt0fSYmLm1vdmllLWxpc3QtaXRlbWApXFxuXFxuICAgIGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgdmFyIG5hbWUgPSBwZGZoKHgsICcubW92aWUtdGl0bGUmJlRleHQnKVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICBpbWc6IHBkZmgoeCwgJ2ltZyYmc3JjJyksXFxuICAgICAgICAgICAgZGVzYzpwZGZoKHgsJy5tb3ZpZS1yYXRpbmcmJlRleHQnKSxcXG4gICAgICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKChuKSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJzb3VcXFwiLCBuKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBuYW1lKVxcbiAgICAgICAgfSlcXG4gICAgfSlcXG59XFxuXFxuWyfng63mkq3mlrDliactdHYnLCAn54Ot6Zeo55S15b2xLW1vdmllJywgJ+eDreaSreWKqOa8qy1hbmltZScsICfng63mkq3nu7zoibotc2hvdycsICfng63mkq3nuqrlvZXniYctZG9jdW1lbnRhcnknXS5tYXAoeCA9PiB7XFxuICAgIHNldEx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IG5hbWUgPSBwZGZoKHgsICcubW92aWUtdGl0bGUmJlRleHQnKVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IHBkZmgoeCwgJ2ltZyYmc3JjJyksXFxuICAgICAgICAgICAgICAgIGRlc2M6IHBkZmgoeCwgJy5tb3ZpZS1yYXRpbmcmJlRleHQnKSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgWyfng63mkq3nlLXlvbEtMScsICfng63mkq3nlLXop4bliactMicsICfng63mkq3liqjmvKstMycsICfng63mkq3nu7zoibotNSddLm1hcCh4ID0+IHtcXG4gICAgICAgIHNldExpc3RzKHgpXFxuICAgIH0pXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Ye95pWwMlwiLFwicGF0aFwiOlwienRvb2xzXCIsXCJydWxlXCI6XCJqczpcXG4vL3VybOino+aekFxcbmZ1bmN0aW9uIHVybFBhcnNlKHUpIHtcXG4gICAgdmFyIGRpY3QgPSB7fVxcbiAgICBkaWN0LlNvdXJjZSA9IHU7XFxuICAgIGxldCBwYXJhbXMgPSAodXJsKSA9PiB7XFxuICAgICAgICBsZXQgcXVlcnlQYXJhbXMgPSB7fTtcXG4gICAgICAgIGxldCByZWcgPSAvKFtePz0mXSspPShbXj89Jl0rKS9nO1xcbiAgICAgICAgdXJsLnJlcGxhY2UocmVnLC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gICAgICBmYmEucGFyc2VMYXp5UnVsZUFzeW5jKCQkJCgpLmxhenlSdWxlKChydWxlLCB1cmwsIGFuY2hvcklkLCBtb2JhbikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGdldFZhcihcXFwiaHRtbDBcXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpdXJsID0gJyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyVmFyKFxcXCJodG1sMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZygndXJsOicgKyB1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwuc3RhcnRzV2l0aCgnaHR0cHM6Ly9jdXBmb3guYXBwL3BhZ2U/dXJsPScpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYmFzZXVybCA9IHVybC5yZXBsYWNlKC8uK3VybD0oLio/KSYuKy9nbSwgJyQxJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl1cmwgPSBiYXNlNjREZWNvZGUoYmFzZXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcignaWZyYW1lJywgaXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnaXVybDonICsgaXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXVybC5sZW5ndGggPiAwID8gXFxcIjFcXFwiIDogXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgcnVsZSwgbG9jYXRpb24uaHJlZiwgYW5jaG9ySWQsIG1vYmFuKSwgJCQkLnRvU3RyaW5nKChydWxlLG1vYmFuKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9mYmEubG9nKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZyhydWxlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFwiMFxcXCIgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmNoZWNrYyA9IHdpbmRvdy5jaGVja2MgKyAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKmlmICh3aW5kb3cuY2hlY2tjID4gMTIwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmiafooYzotoXov4czMOenku+8jOaXoOazleino+aekFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQod2luZG93LmNoZWNrMCwgMjUwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy99XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVybCA9IGZiYS5nZXRWYXIoJ2lmcmFtZScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKCdtb2JhbicrbW9iYW4pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG1vYmFuPT0nMScpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsPXVybCsnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZTogcnVsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5b2x54mH6K+m5oOFJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZVJ1bGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZXM6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9wYWdlL3A/cnVsZT0nICsgcnVsZSArICcmdT0nICsgdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluZFJ1bGU6IFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmNoZWNrdXJsID0gbG9jYXRpb24uaHJlZjtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2t1MCgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3aW5kb3cuY2hlY2t1cmwgIT0gbG9jYXRpb24uaHJlZikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaGFzaOWPkeeUn+S6huWPmOWMllxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jaGVja2MgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVjazAoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAyMDAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChjaGVja3UwLCAyNTApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrdTAoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LHJ1bGUsbW9iYW4pKTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dCh3aW5kb3cuY2hlY2swLCAyNTApO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHdpbmRvdy5jaGVja2MgPSAwO1xcbiAgICAgICAgICAgIHdpbmRvdy5jaGVjazAgPSBjaGVjazA7XFxuICAgICAgICAgICAgY2hlY2swKCk7XFxuICAgICAgICB9XFxuICAgIH0sIHJ1bGUsIGFuY2hvcklkLCBnZXRJdGVtKCdhaScsJzAnKSk7XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiNS7ojLbmna/omY5cIixcInBhdGhcIjpcImFpb2JiXCIsXCJydWxlXCI6XCJqczpcXG5sZXQgZHVybCA9IGdldE15VmFyKFxcXCJkdXJsXFxcIiwgXFxcIlxcXCIpO1xcbmlmIChkdXJsICE9ICcnKSB7XFxuICAgIE1ZX1VSTCA9IGR1cmxcXG4gICAgbG9nKGR1cmwpXFxuXFxuICAgIGxldCB1cmwgPSBkdXJsO1xcbiAgICBsZXQgaWQgPSB1cmw7XFxuICAgIHRyeSB7XFxuICAgICAgICB2YXIgaHRtbCA9IGZldGNoKHVybCk7XFxuICAgIH0gY2F0Y2gge1xcbiAgICAgICAgdmFyIGh0bWwgPSAnJ1xcbiAgICB9XFxuICAgIHZhciBydWxlID0gTVlfUlVMRS50aXRsZVxcbiAgICBpZiAoaHRtbCA9PSB1bmRlZmluZWQgfHwgaHRtbCA9PSAnJykge1xcbiAgICAgICAgdG9hc3QoJ+aXoOaVsOaNricpXFxuICAgICAgICBjbGVhck15VmFyKFxcXCJzb3VcXFwiKTtcXG4gICAgICAgIGNsZWFyTXlWYXIoXFxcImR1cmxcXFwiKTtcXG4gICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgfSBlbHNlIHtcXG5cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHBkZmgoaHRtbCwgJ2g0JiZUZXh0JyksXFxuICAgICAgICAgICAgaW1nOiBwZChodG1sLCAnaW1nJiZzcmMnKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJyxcXG4gICAgICAgICAgICBkZXNjOiBwZGZoKGh0bWwsICdib2R5JiYucHViVGltZSYmVGV4dCcpLFxcbiAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiB1cmwsXFxuICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcblxcblxcbiAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsICcubW92aWVaeSYmYScpXFxuICAgICAgICBpZiAobGlzdCAmJiBsaXN0Lmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBNWV9VUkwgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgICAgIG1lcmdlXFxuICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS90b29sP3J1bGU9XFxcIiArIHJ1bGUpO1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwZGZoKGl0LCAnYSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHQgPSBwZGZoKGl0LCAndWwmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaGlrZXI6Ly9wYWdlL3A/cnVsZT1cXFwiICsgcnVsZSArIFxcXCImdT1cXFwiICsgYmFzZTY0RW5jb2RlKHUpO1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IGdldEl0ZW0oJ2FpJywgJzAnKSA9PSAnMCcgPyB1IDogdSArICcjaW1tZXJzaXZlVGhlbWUjJ1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogbWVyZ2UodCwgJ+ivpuaDhScsIDEpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vd3d3LjcyNTk5OC5jb20vc3RhdGljL3NlYXJjaC9pbWFnZXMvb25MaW5lLnBuZycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbTogJ2hvbWUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGQgPSBkLmNvbmNhdChsaXN0KVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+aXoOi1hOa6kCcsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIHNldFJlc3VsdChkKVxcbiAgICB9XFxuXFxufVxcbnMgPSBnZXRNeVZhcihcXFwic291XFxcIiwgXFxcIlxcXCIpO1xcblxcbmxldCByID0gXFxcIlxcXCI7XFxuaWYgKHMgIT0gXFxcIlxcXCIpIHtcXG5cXG4gICAgdmFyIHVybCA9IHBvc3QoYGh0dHBzOi8vd3d3LjcyNTk5OC5jb20va2V5d29yZHMuaHRtbGAsIHtcXG4gICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICBrZXl3b3JkczogcyxcXG4gICAgICAgICAgICB0eXBlOiAnbW92aWUnXFxuICAgICAgICB9LFxcbiAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgfSlcXG4gICAgdmFyIGpzb24gPSBKU09OLnBhcnNlKHVybClcXG4gICAgdmFyIHR1cmwgPSBqc29uLnVybC5yZXBsYWNlKC8tXFxcXGQrLmh0bWwkLywgJy0nICsgTVlfUEFHRSArICcuaHRtbCcpXFxuICAgIE1ZX1VSTCA9IHR1cmxcXG4gICAgdmFyIGh0bWwgPSBmZXRjaCh0dXJsKVxcblxcbiAgICB2YXIgbGlzdCA9IHBkZmEoaHR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AgIGlmICghIWNscykge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKHVybClcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpZCA9IHVybDtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gZmV0Y2godXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCAnLm1vdmllWnkmJmEnKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QgJiYgbGlzdC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVlfVVJMID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXJnZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbD9ydWxlPVxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGxpc3QubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgJ2EmJmhyZWYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJ3VsJiZUZXh0Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnU9XFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG1lcmdlKHQsICfor6bmg4UnLCAxKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL3d3dy43MjU5OTguY29tL3N0YXRpYy9zZWFyY2gvaW1hZ2VzL29uTGluZS5wbmcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb206ICdob21lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoaWQsIGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfml6DotYTmupAnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICB9LCBNWV9SVUxFLnRpdGxlLCB1cmwsIHMpLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiB1cmwsXFxuICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9XFxuXFxuICAgIHNldFJlc3VsdChkKVxcbn0gZWxzZSB7XFxuXFxufVxcblxcbmlmIChnZXRJdGVtKCdob21lJywgJ+WFsycpID09ICflvIAnKSB7XFxuICAgIGZ1bmN0aW9uIHNldExpc3RzKGl0ZW0pIHtcXG4gICAgICAgIE1ZX1VSTCA9ICdodHRwczovL3d3dy43MjU5OTguY29tLyc7XFxuICAgICAgICB2YXIgdGl0bGUgPSBpdGVtLnNwbGl0KCcjJylbMF1cXG4gICAgICAgIHZhciBrZXkgPSBpdGVtLnNwbGl0KCcjJylbMV1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS8xMC5wbmcnXFxuICAgICAgICB9KVxcblxcbiAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChgaHR0cHM6Ly93d3cuNzI1OTk4LmNvbS95aW5na3UtbGlzdC8ke2tleX0tMC0wLTAtMC0wLTAuaHRtbGApXFxuICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgJ2JvZHkmJi5lYWNoJylcXG5cXG4gICAgICAgIGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgIHZhciBuYW1lID0gcGRmaCh4LCAnYSYmdGl0bGUnKVxcbiAgICAgICAgICAgIGxldCBpbWcgPSBwZCh4LCAnaW1nJiZzcmMnKTtcXG4gICAgICAgICAgICBpZiAoaW1nID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGltZyA9IFxcXCJodHRwczovL3d3dy43MjU5OTguY29tL3N0YXRpYy9zZWFyY2gvaW1hZ2VzL3ByZWxvYWRJbWcucG5nXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHVybCA9IHBkKHgsICdhJiZocmVmJyk7XFxuICAgICAgICAgICAgbGV0IHNjb3JlID0gcGRmaCh4LCAnLm5vU2NvcmUmJlRleHQnKTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIGRlc2M6IHNjb3JlLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKChuLCB1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwic291XFxcIiwgbilcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdkdXJsJywgdSlcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgI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XFxuICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IHVybCxcXG4gICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pXFxuXFxuICAgIGxldCBodG1sID0gZmV0Y2goYGh0dHBzOi8vd3d3LmRpYW55aW5nZ291LmNvbS9TcGlkZXJNb3ZpZS96eS8ke25hbWV9YCwge1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICd4LXJlcXVlc3RlZC13aXRoJzogJ1hNTEh0dHBSZXF1ZXN0J1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG4gICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsICcubW92aWVaeSYmYScpXFxuICAgIGlmIChsaXN0ICYmIGxpc3QubGVuZ3RoID4gMCkge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBNWV9VUkwgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICBsZXQge1xcbiAgICAgICAgICAgICAgICB3cmFwMVxcbiAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS90b29sP3J1bGU9XFxcIiArIHJ1bGUpO1xcbiAgICAgICAgICAgIFxcbiAgICAgICAgICAgIGxpc3QgPSBsaXN0Lm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgJ2EmJmhyZWYnKTtcXG4gICAgICAgICAgICAgICAgbGV0IHQgPSBwZGZoKGl0LCAnbGksMCYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICBsZXQgd2ViPXBkZmgoaXQsICdsaSwxJiZUZXh0Jyk7XFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiaGlrZXI6Ly9wYWdlL3A/cnVsZT1cXFwiICsgcnVsZSArIFxcXCImdT1cXFwiICsgYmFzZTY0RW5jb2RlKHUpO1xcbiAgICAgICAgICAgICAgICB1ID0gZ2V0SXRlbSgnYWknLCAnMCcpID09ICcwJyA/IHUgOiB1ICsgJyNpbW1lcnNpdmVUaGVtZSMnXFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogd3JhcDEod2ViKyctJyt0LCBzKSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vd3d3LjcyNTk5OC5jb20vc3RhdGljL3NlYXJjaC9pbWFnZXMvb25MaW5lLnBuZycsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOnQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgd2ViOndlYixcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGQgPSBkLmNvbmNhdChsaXN0KVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIHNldFJlc3VsdChkKVxcbn1cXG5zID0gZ2V0TXlWYXIoXFxcInNvdVxcXCIsIFxcXCJcXFwiKTtcXG5sZXQgciA9IFxcXCJcXFwiO1xcbmlmIChzICE9IFxcXCJcXFwiKSB7XFxuICAgIHZhciBwYWdlID0gTVlfUEFHRTtcXG4gICAgdmFyIHVybCA9IGBodHRwczovL3d3dy5kaWFueWluZ2dvdS5jb20vc28vJHtzfS9wYWdlXyR7cGFnZX0uaHRtbGA7XFxuICAgIC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zLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBjbHMgPSBmaW5kSXRlbXNCeUNscyh1cmwpO1xcbiAgICAgICAgICAgICAgICBpZiAoISFjbHMpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyh1cmwpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSB1cmw7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKGBodHRwczovL3d3dy5kaWFueWluZ2dvdS5jb20vU3BpZGVyTW92aWUvenkvJHtuYW1lfWAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICd4LXJlcXVlc3RlZC13aXRoJzogJ1hNTEh0dHBSZXF1ZXN0J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsICcubW92aWVaeSYmYScpXFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdCAmJiBsaXN0Lmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNWV9VUkwgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyYXAxXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS90b29sP3J1bGU9XFxcIiArIHJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwZGZoKGl0LCAnYSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHQgPSBwZGZoKGl0LCAnbGksMCYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHdlYj1wZGZoKGl0LCAnbGksMSYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZ1PVxcXCIgKyBiYXNlNjRFbmNvZGUodSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gZ2V0SXRlbSgnYWknLCAnMCcpID09ICcwJyA/IHUgOiB1ICsgJyNpbW1lcnNpdmVUaGVtZSMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB3cmFwMSh3ZWIrJy0nK3QsIHMpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vd3d3LjcyNTk5OC5jb20vc3RhdGljL3NlYXJjaC9pbWFnZXMvb25MaW5lLnBuZycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOnQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdlYjp3ZWIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCBsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgfSwgTVlfUlVMRS50aXRsZSwgdXJsLCBzLCBuYW1lKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogdXJsLFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBzZXRSZXN1bHQoZClcXG59IGVsc2Uge1xcblxcbn1cXG5cXG5pZiAoZ2V0SXRlbSgnaG9tZScsICflhbMnKSA9PSAn5byAJykge1xcbiAgICBmdW5jdGlvbiBzZXRMaXN0cyhpdGVtKSB7XFxuICAgICAgICBNWV9VUkwgPSAnaHR0cHM6Ly93d3cuZGlhbnlpbmdnb3UuY29tLyc7XFxuICAgICAgICB2YXIgdGl0bGUgPSBpdGVtLnNwbGl0KCcjJylbMF1cXG4gICAgICAgIHZhciBrZXkgPSBpdGVtLnNwbGl0KCcj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KHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBzY29yZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobiwgdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZHVybCcsIHUpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUsIHVybClcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBob21lKCkge1xcbiAgICAgICAgWyfnlLXlvbEjbW92aWUnLCAn55S16KeG5YmnI3R2JywgJ+e6quW9leeJhyNkb2MnLCAn5Yqo5ryrI2NvbWljJ10ubWFwKHggPT4ge1xcblxcbiAgICAgICAgICAgIHNldExpc3RzKHgpXFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIFxcbiAgICB2YXIgcGFnZT1NWV9QQUdFO1xcbiAgICBsZXQgdHJ1ZV91cmwgPSBnZXRNeVZhcihNWV9SVUxFLnVybCwgTVlfVVJMKTtcXG4gICAgaWYocGFnZT4xKXtcXG4gICAgICAgIC8vbG9nKHRydWVfdXJsKVxcbiAgICAgICAgdHJ1ZV91cmw9dHJ1ZV91cmwrYC9wYWdlXyR7cGFnZX0uaHRtbGBcXG4gICAgICAgIC8vbG9nKHRydWVfdXJsKVxcbiAgICB9XFxuICAgIHZhciBodG1sID1mZXRjaCh0cnVlX3VybCkucmVwbGFjZSgnJScsJycpO1xcbiAgICAvL2xvZyhodG1sKVxcbiAgICBcXG4gICAgXFxuICAgIGNvbnN0IOWIhuexu+minOi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ykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB3cmFwMSh3ZWIgKyAnLScgKyB0LCBzKSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3ZWI6IHdlYixcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGQgPSBkLmNvbmNhdChsaXN0KVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIHNldFJlc3VsdChkKVxcbn1cXG5zID0gZ2V0TXlWYXIoXFxcInNvdVxcXCIsIFxcXCJcXFwiKTtcXG5sZXQgciA9IFxcXCJcXFwiO1xcbmlmIChzICE9IFxcXCJcXFwiKSB7XFxuICAgIHZhciBwYWdlID0gTVlfUEFHRTtcXG4gICAgTVlfVVJMID0gYGh0dHBzOi8vd3d3LnRic2R5LmNvbS9zZWFyY2guaHRtbD9rZXl3b3JkPSR7c30mcGFnZWQ9JHtwYWdlfSZjYXRlZ29yeT1gO1xcbiAgICAvL2xvZyhNWV9VUkwpXFxuICAgIGxldCBodG1sID0gZmV0Y2goTVlf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An6K+E5YiGOicgKyBzY29yZSArICdcXFxcbuS4u+a8lDonICsgZGVzYyxcXG4gICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocnVsZSwgdXJsLCBzLCBuYW1lKSA9PiB7XFxuXFxuICAgICAgICAgICAgICAgIHZhciBjbHMgPSBmaW5kSXRlbXNCeUNscyh1cmwpO1xcbiAgICAgICAgICAgICAgICBpZiAoISFjbHMpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyh1cmwpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSB1cmw7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBQQ19VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsICdib2R5JiYudmlkZW9fZG93bmxvYWRfbGlua19pdGVtJylcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0ICYmIGxpc3QubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ZX1VSTCA9IHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyYXAxXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS90b29sP3J1bGU9XFxcIiArIHJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwZGZoKGl0LCAnYSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHQgPSBwZGZoKGl0LCAnLnZpZGVvX2Rvd25sb2FkX2xpbmtfbmFtZV90ZXh0JiZUZXh0Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgd2ViID0gcGRmaChpdCwgJy5yZXNvdXJjZV93ZWJzaXRlX25hbWUmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbWcgPSBwZChpdCwgJy52aWRlb19sYWJlbHMmJmltZyYmc3JjJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnU9XFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHdyYXAxKHdlYiArICctJyArIHQsIHMpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2ViOiB3ZWIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCBsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgfSwgTVlfUlVMRS50aXRsZSwgdXJsLCBzLCBuYW1lKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogdXJsLFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBzZXRSZXN1bHQoZClcXG59IGVsc2Uge1xcblxcbn1cXG5cXG5pZiAoZ2V0SXRlbSgnaG9tZScsICflhbMnKSA9PSAn5byAJykge1xcbiAgICBsZXQgaHRtbCA9IGZldGNoKCdodHRwczovL3d3dy50YnNkeS5jb20vJywge1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogUENfVUFcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIGZ1bmN0aW9uIHNldExpc3RzKGl0ZW0pIHtcXG4gICAgICAgIE1ZX1VSTCA9ICdodHRwczovL3d3dy50YnNkeS5jb20vJztcXG4gICAgICAgIHZhciB0aXRsZSA9IGl0ZW0ubmFtZTtcXG4gICAgICAgIHZhciBrZXkgPSBpdGVtLnNlbGVjdDtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICBpbWc6IGl0ZW0uaW1nLFxcbiAgICAgICAgfSlcXG5cXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCBgYm9keSYmLmNvbnRhaW5lcl9tYWluX2hvdF8ke2tleX0mJi5ob3RfcmVzb3VyY2Vfb25lYClcXG5cXG4gICAgICAgIGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgIHZhciBuYW1lID0gcGRmaCh4LCAnLnJlc291cmNlX25hbWUmJlRleHQnKVxcbiAgICAgICAgICAgIGxldCBpbWcgPSBwZCh4LCAnLnJlc291cmNlX3Bvc3RlcnMmJnNyYycpO1xcbiAgICAgICAgICAgIGlmIChpbWcgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCB1cmwgPSBwZCh4LCAnYSYmaHJlZicpO1xcblxcbiAgICAgICAgICAgIGxldCBzY29yZSA9IHBkZmgoeCwgJy51cGRhdGVfdGlwfHwucmVzb3VyY2Vfc2NvcmV8fGltZyYmVGV4dCcpO1xcblxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgZGVzYzogc2NvcmUsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnJykubGF6eVJ1bGUoKG4sIHUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJzb3VcXFwiLCBuKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2R1cmwnLCB1KVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBuYW1lLCB1cmwpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgW3tcXG4gICAgICAgIG5hbWU6ICfng63pl6jnlLXop4bliacnLFxcbiAgICAgICAgc2VsZWN0OiAndHZzJyxcXG4gICAgICAgIGltZzogJ2h0dHBzOi8vd3d3LnRic2R5LmNvbS9pbWcvbXJzdy93ZWIvaW5kZXgvaW5kZXhfdHYuc3ZnJyxcXG4gICAgfSwge1xcbiAgICAgICAgbmFtZTogJ+eDremXqOeUteW9sScsXFxuICAgICAgICBzZWxlY3Q6ICdtb3ZpZXMnLFxcbiAgICAgICAgaW1nOiAnaHR0cHM6Ly93d3cudGJzZHkuY29tL2ltZy9tcnN3L3dlYi9pbmRleC9pbmRleF9tdi5zdmcnXFxuICAgIH0sIHtcXG4gICAgICAgIG5hbWU6ICfng63pl6jliqjmvKsnLFxcbiAgICAgICAgc2VsZWN0OiAnYW5pbWVzJyxcXG4gICAgICAgIGltZzogJ2h0dHBzOi8vd3d3LnRic2R5LmNvbS9pbWcvbXJzdy93ZWIvaW5kZXgvaW5kZXhfc2hvdy5zdmcnXFxuICAgIH0sIHtcXG4gICAgICAgIG5hbWU6ICfng63pl6jnu7zoibonLFxcbiAgICAgICAgc2VsZWN0OiAndmFyaWV0eXMnLFxcbiAgICAgICAgaW1nOiAnaHR0cHM6Ly93d3cudGJzZHkuY29tL2ltZy9tcnN3L3dlYi9pbmRleC9pbmRleF9yZWNvcmRzLnN2ZydcXG4gICAgfSwge1xcbiAgICAgICAgbmFtZTogJ+eDremXqOe6quW9leeJhycsXFxuICAgICAgICBzZWxlY3Q6ICdkb2N1bWVudGFyeXMnLFxcbiAgICAgICAgaW1nOiAnaHR0cHM6Ly93d3cudGJzZHkuY29tL2ltZy9tcnN3L3dlYi9pbmRleC9pbmRleF9yZWNvcmRzLnN2ZycsXFxuICAgIH1dLm1hcCh4ID0+IHtcXG5cXG4gICAgICAgIHNldExpc3RzKHgpXFxuICAgIH0pXFxufVwifV0iLCJpY29uIjoiIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment