Advertisement
xiaomianao666

邀您一起看:选择器|[综]用绳命推销的男人 作者:醉饮长歌

Oct 10th, 2022
1,229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥选择器|[]用绳命推销的男人 作者:醉饮长歌@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmLkZpbGXlt6XlhbdcIixcInBhdGhcIjpcIkZpbGUuanNcIixcInJ1bGVcIjpcImNvbnN0IEZpbGUgPSBqYXZhLmlvLkZpbGU7XFxuY29uc3Qge1xcbiAgICBGaWxlcyxcXG4gICAgUGF0aHMsXFxuICAgIFN0YW5kYXJkQ29weU9wdGlvbixcXG4gICAgU3RhbmRhcmRPcGVuT3B0aW9uXFxufSA9IGphdmEubmlvLmZpbGU7XFxuY29uc3QgamF2YVN0cmluZyA9IGphdmEubGFuZy5TdHJpbmc7XFxubGV0IGphdmFTY29wZSA9IG5ldyBKYXZhSW1wb3J0ZXIoamF2YS5pbywgamF2YS5sYW5nLCBqYXZhLmxhbmcucmVmbGVjdCwgamF2YS51dGlsLlZlY3Rvcik7XFxuXFxuZnVuY3Rpb24gZGVsZXRlRmlsZXMoZmlsZU5hbWUpIHtcXG4gICAgbGV0IGZpbGUgPSBuZXcgRmlsZShmaWxlTmFtZSk7XFxuIC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XQgaXMgPSBuZXcgRmlsZUlucHV0U3RyZWFtKGZpbGUpO1xcbiAgICAgICAgICAgICAgICBsZXQgbGVuID0gMDtcXG4gICAgICAgICAgICAgICAgd2hpbGUgKChsZW4gPSBpcy5yZWFkKHRieXMpKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdG9zLndyaXRlKHRieXMsIDAsIGxlbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaXMuY2xvc2UoKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICB0b3MuY2xvc2UoKTtcXG4gICAgICAgIC8v6KeE5YiZ5pu/5o2i6KeE5YiZO1xcbiAgICAgICAgbGV0IG91dEZpbGUgPSBuZXcgRmlsZShmaWxlT3V0KTtcXG4gICAgICAgIGlmICh0eXBlb2YgaW50ZXJjZXB0ID09PSBcXFwiZnVuY3Rpb25cXFwiKSB7XFxuICAgICAgICAgICAgbGV0IHRpcyA9IG5ldyBGaWxlSW5wdXRTdHJlYW0odG1wRmlsZSk7XFxuICAgICAgICAgICAgbGV0IG9zID0gbmV3IEJ1ZmZlcmVkT3V0cHV0U3RyZWFtKG5ldyBGaWxlT3V0cHV0U3RyZWFtKG91dEZpbGUpKTtcXG4gICAgICAgICAgICBsZXQgbGVuID0gMDtcXG4gICAgICAgICAgICBsZXQgYnlzID0gQXJyYXkubmV3SW5zdGFuY2UoQnl0ZS5UWVBFLCBCVUZGRVJfU0laRSk7XFxuICAgICAgICAgICAgd2hpbGUgKChsZW4gPSB0aXMucmVhZChieXMpKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICBsZXQgbmJ5cyA9IGludGVyY2VwdChuZXcgU3RyaW5nKGJ5cywwLGxlbikpO1xcbiAgICAgICAgICAgICAgICBvcy53cml0ZShuYnlzLCAwLCBuYnlzLmxlbmd0aCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHRtcEZpbGUuZGVsZXRlKCk7XFxuICAgICA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ICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgfSk7XFxuXFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBbXFxcIlvlj5bmtojkuIvovb1dXFxcIiwgXFxcIlvmraPlnKjlgZzmraIuLi5dXFxcIiwgXFxcIlvov5Tlm55dXFxcIiwgXFxcIlvlpITnkIblpLHotKVdXFxcIiwgXFxcIlvph43mlrDlvIDlp4tdXFxcIl1bc3RhdHVzXSxcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoTVlfSUQpID0+IHtcXG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gZ2V0TXlWYXIoTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCIwXFxcIik7XFxuICAgICAgICAgICAgaWYgKHN0YXR1cyA9PT0gXFxcIjBcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiMVxcXCIpO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiW+ato+WcqOWBnOatoi4uLl1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3mjqfliLZcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5q2j5Zyo5Y+W5raI5LiL6L295Lu75YqhXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PT0gXFxcIjFcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mraPlnKjmmoLlgZwuLi5cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSBcXFwiMlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey6YCA5Ye65LiL6L295ZmoXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKFtcXFwiM1xcXCIsIFxcXCI0XFxcIl0uaW5jbHVkZXMoc3RhdHVzKSkge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKE1ZX0lEICsgXFxcIjppc1N0YXJ0XFxcIik7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKE1ZX0lEICsgXFxcIjpsb2dcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mHjeaWsOeCueWHu+S4i+i9vVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCBNWV9JRCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwiPHN0cm9uZz7kuIvovb3ml6Xlv5c8L3N0cm9uZz5cXFwiLmJpZygpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiLFxcbiAgICAgICAgXFxuICAgIH0pO1xcbiAgICBsYXlvdXQuc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IiArIHRhc2tDb3VudCxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwi4paHXFxcIi5yZXBlYXQoc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXCIjZmZhYzJkXFxcIikgKyBcXFwi4paHXFxcIi5yZXBlYXQoMTAgLSBzdHJpcENvdW50KS5mb250Y29sb3IoXFxcIiNlNWUxZTRcXFwiKSArIFxcXCIgXFxcIiArIChyYXRpbyAqIDEwMCkgKyBcXFwiJVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3ov5vluqZcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIltsaXN0ZW5lcl3lt7LlrozmiJDkuIvovb3vvJpcXFwiICsgaWQpO1xcbiAgICAgICAgfSBlbHNlIGlmIChDSUQgPT09IC0xKSB7XFxuICAgICAgICAgICAgZmFpbE5hbWUucHVzaChpZCk7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5YGc5q2i77yaXFxcIiArIGlkKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0YXNrQ291bnQgIT09IGNvdW50KSByZXR1cm47XFxuICAgICAgICBpZiAoc3VjY2Vzc0NJRC5sZW5ndGggPT09IHRhc2tDb3VudCkge1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCLilodcXFwiLnJlcGVhdCgxMCkuZm9udGNvbG9yKFxcXCIjMDBmZjAwXFxcIikgKyBcXFwiIDEwMCVcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85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3RhdHVzID09PSBcXFwiMVxcXCIpIHtcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjRcXFwiKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIltsaXN0ZW5lcl0j5bey5YGc5q2i5omA5pyJ5Lu75Yqh77yM5L2G5bey5pyJ6L+b5bqm5LiN5Lya5raI5aSxI1xcXCIpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlvph43mlrDlvIDlp4tdXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjJcXFwiKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIuS4i+i9veS7u+WKoVtcXFwiICsgaW5mby5ib29rTmFtZSArIFxcXCJd5bey5YWo6YOo5oiQ5Yqf5a6M5oiQXFxcIik7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiW+i/lOWbnl1cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L295o6n5Yi2XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICB0b2FzdChcXFwi5LiL6L295Lu75YqhW1xcXCIgKyBpbmZvLmJvb2tOYW1lICsgXFxcIl3lt7LlrozmiJBcXFwiKTtcXG4gICAgfVxcbiAgICBsZXQgdGFza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pk77mjqXov5Tlm57kuLrnqbo+XFxcIik7XFxuICAgIH1cXG4gICAgaWYgKGluZm8uYm9va1RvcFBpYykge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgYm9va1RvcFBpYyA9IFRvb2wuaGlrZXJQaWMoaW5mby5ib29rVG9wUGljKTtcXG4gICAgICAgICAgICByZXF1aXJlRG93bmxvYWQoYm9va1RvcFBpY1swXSwgbWFpblBhdGggKyBpbmZvLmJvb2tOYW1lICsgXFxcIi5qcGdcXFwiLCBib29rVG9wUGljWzFdKTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coXFxcIjzlsIHpnaLkuIvovb3plJnor6/vvJpcXFwiICsgZS5tZXNzYWdlICsgXFxcIj5cXFwiKTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICB2YXIgc2NoZWR1bGUgPSBuZXcgTWFwKFtcXG4gICAgICAgIFtMLCAoKSA9PiBsb2coY2hhcHRlckl0ZW0udGl0bGUgKyBcXFwi5bey5LiL6L29MTAwJVxcXCIpXSxcXG4gICAgICAgIFt+figwLjkwICogTCksICgpID0+IGxvZyhjaGFwdGVySXRlbS50aXRsZSArIFxcXCLlt7LkuIvovb05MCUrXFxcIildLFxcbiAgICAgICAgW35+KDAuNzUgKiBMKSwgKCkgPT4gbG9nKGNoYXB0ZXJJdGVtLnRpdGxlICsgXFxcIuW3suS4i+i9vTc1JStcXFwiKV0sXFxuICAgICAgICBbfn4oMC41MCAqIEwpLCAoKSA9PiBsb2coY2hhcHRlckl0ZW0udGl0bGUgKyBcXFwi5bey5LiL6L29NTAlK1xcXCIpXSxcXG4gICAgICAgIFt+figwLjI1ICogTCksICgpID0+IGxvZyhjaGFwdGVySXRlbS50aXRsZSArIFxcXCLlt7LkuIvovb0yNSUrXFxcIildXFxuICAgIF0pO1xcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IEw7IGkrKykge1xcbiAgICAgICAgbGV0IHBpYyA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3BsaXQoXFxcIiYmXFxcIik7XFxuICAgICAgICB9XFxuICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIGUubWVzc2FnZSA9IFxcXCI85ryr55S75Zu+54mH6Kej5p6Q6ZSZ6K+vPiBcXFwiICsgZS5tZXNzYWdlO1xcbiAgICAgICAgdGhyb3cgZTtcXG4gICAgfVxcblxcbiAgICBjb25zdCBMID0gcGljTGlzdC5sZW5ndGg7XFxuICAgIGlmKEw9PT0wKXtcXG4gICAgICAgIHRvYXN0KFxcXCLlm77niYfpk77mjqXkuLrnqbpcXFwiKTtcXG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwiPOa8q+eUu+WbvueJh+ino+aekOmUmeivr++8muWbvueJh+mTvuaOpei/lOWbnuS4uuepuj5cXFwiKTtcXG4gICAgfVxcbiAgICBpZiAoaW5mby5ib29rVG9wUGljKSB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBib29rVG9wUGljID0gVG9vbC5oaWtlclBpYyhpbmZvLmJvb2tUb3BQaWMpO1xcbiAgICAgICAgICAgIHJlcXVpcmVEb3dubG9hZChib29rVG9wUGljWzBdLCBtYWluUGF0aCArIGluZm8uYm9va05hbWUgKyBcXFwiLmpwZ1xcXCIsIGJvb2tUb3BQaWNbMV0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhcXFwiPOWwgemdouS4i+i9vemUmeivrz4gXFxcIiArIGUubWVzc2FnZSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgdmFyIHNjaGVkdWxlID0gbmV3IE1hcChbXFxuICAgICAgICBbTCwgKCkgPT4gbG9nKGl0ZW0udGl0bGUgKyBcXFwi5bey5LiL6L29MTAwJVxcXCIpXSxcXG4gICAgICAgIFt+figwLjkwICogTCksICgpID0+IGxvZyhpdGVtLnRpdGxlICsgXFxcIuW3suS4i+i9vTkwJStcXFwiKV0sXFxuICAgICAgICBbfn4oMC43NSAqIEw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NmLumAmueUqOW3peWFt1wiLFwicGF0aFwiOlwiVG9vbC5qc1wiLFwicnVsZVwiOlwiJC5leHBvcnRzID0ge1xcbiAgICBzcGxpdCh0ZXh0LCB0YXJnZXQsIGNvdW50KSB7XFxuICAgICAgICBjb3VudCA9IGNvdW50ID09PSB1bmRlZmluZWQgPyAxIDogY291bnQ7XFxuICAgICAgICBsZXQgYXJyYXkgPSBbdGV4dF07XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHtcXG4gICAgICAgICAgICB0ZXh0ID0gYXJyYXlbaV07XFxuICAgICAgICAgICAgbGV0IGluZGV4ID0gdGV4dC5pbmRleE9mKHRhcmdldCk7XFxuICAgICAgICAgICAgaWYgKGluZGV4ID09PSAtMSkge1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYXJyYXlbaV0gPSB0ZXh0LnNsaWNlKDAsIGluZGV4KTtcXG4gICAgICAgICAgICBhcnJheVtpICsgMV0gPSB0ZXh0LnNsaWNlKGluZGV4ICsgdGFyZ2V0Lmxlbmd0aCk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gYXJyYXk7XFxuICAgIH0sXFxuICAgIGNodW5rKGFyciwgc2l6ZSkge1xcbiAgICAgICAgdmFyIHJlc3VsdCA9IFtdO1xcbiAgICAgICAgZm9yICh2YXIgaSA9IDAsIGxlbiA9IGFyci5sZW5ndGg7IGkgPCBsZW47IGkgKz0gc2l6ZSkge1xcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoKGFyci5zbGljZShpLCBpICsgc2l6ZSkpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcXG4gICAgfSxcXG4gICAgaGlrZXJQaWModXJsKSB7XFxuICAgICAgICB2YXIgaGVhZGVycyA9IHt9O1xcbiAgICAgICAgbGV0IHVybHMgPSB1cmwuc3BsaXQoXFxcIkBcXFwiKTtcXG4gICA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xcImhpa2VyOi8vcGFnZS9TZXR0aW5nLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiBNWV9SVUxFLnZlcnNpb25cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOW4ruWKqeKAneKAnVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2hlbHAudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5Iz9rZXl3b3JkPW5vdmVsQ29taWNcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8aDEgc3R5bGU9XFxcInRleHQtYWxpZ246IGNlbnRlcjtcXFwiPuWVpemDveayoeacieiAtjwvaDE+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIHNldFJlc3VsdChsYXlvdXQpO1xcbiAgICB9XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHVybDogJ1xcXCJoaWtlcjovL3NlYXJjaD9zPVxcXCIraW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuaQnOS9oOaDs+imgeeahCNcXFwiICsgdHlwZSArIFxcXCIjLi4uLi4uXFxcIixcXG4gICAgICAgIHRpdGxlOiAn5pCc57SiJyxcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBydWxlczogJC50b1N0cmluZygodGFnLCB0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBhcnIxID0gW107XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGFnLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBhcnIxLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ0aXRsZVxcXCI6IHRhZ1tpXS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzZWFyY2hfdXJsXFxcIjogXFxcImhpa2VyOi8vZW1wdHk/aXNBbGw9MSZzZWFyY2hUZXJtcz0qKiZ0eXBlPVxcXCIgKyB0eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzZWFyY2hGaW5kXFxcIjogXFxcImpzOiQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL1NlYXJjaC52aWV3P3J1bGU9JytNWV9SVUxFLl90aXRsZSk7XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KGFycjEpO1xcbiAgICAgICAgICAgIH0sIHRhZywgdHlwZSksXFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcignc2VhcmNoS2V5JywgJycpLFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ3NlYXJjaEtleScsaW5wdXQpXFxcIlxcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG4gICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLigJjigJjimpnorr7nva7igJnigJlcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9TZXR0aW5nLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB2ZXJzaW9uOiBNWV9SVUxFLnZlcnNpb25cXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuXFxuICAgIGZvciAobGV0IGkgaW4gdGFnKSB7XFxuICAgICAgICBsZXQgaXQgPSB0YWdbaV07XFxuICAgICAgICBpZiAodGdudW0gPT09IGkpIHtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCcXFxcIiArIGl0Lm5hbWUgKyBcXFwi4oCd4oCdXFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFtcXFwi5Yig6Zmk6K+l55uu5b2VXFxcIiwgXFxcIui3s+i9rOWwj+eoi+W6j1xcXCJdLCAxLCBcXFwi6YCJ5oup5pON5L2cXFxcIikuc2VsZWN0KChpdCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKFxcXCLot7PovazlsI/nqIvluo9cXFwiID09PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9ob21lQFxcXCIgKyBpdC5uYW1lO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiB0aGVuKFtcXFwi6K+l5pON5L2c5LiN5Lya5Yig6Zmk5bCP56iL5bqP77yM5L2G6K+l5bCP56iL5bqP5LiL6L2955qE5omA5pyJ5ryr55S75bCG6KKr5Yig6ZmkXFxcIl0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLor6Xmk43kvZzkuI3kvJrliKDpmaTlsI/nqIvluo/vvIzkvYbor6XlsI/nqIvluo/kuIvovb3nmoTmiYDmnIkg5ryr55S7L+Wwj+ivtCDlsIbooqvliKDpmaRcXFwiKS5jb25maXJtKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGaWxlLmRlbGV0ZUZpbGVzKHBhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXCIudGdudW1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXQucGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIGl0KVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdC5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoaSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiLnRnbnVtXFxcIiwgaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaSksXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgbGV0IHBhdGggPSB0YWdbdGdudW1dLnBhdGg7XFxuICAgIGxldCBtaGxpc3QgPSBGaWxlLmdldEZpbGVQYXRoKHBhdGgsIFxcXCJkaXJcXFwiKTtcXG5cXG4gICAgaWYgKG1obGlzdC5sZW5ndGggPT09IDApIHtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwi5ZWl6YO95rKh5pyJ6IC2XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICByZXR1cm4gc2V0UmVzdWx0KGxheW91dCk7XFxuICAgIH1cXG4gICAgbGV0IHBhZ2VVcmwgPSB0eXBlID09PSBcXFwibm92ZWxcXFwiID8gXFxcImhpa2VyOi8vcGFnZS9Ob3ZlbEJyb3dzZXIudmlld1xcXCIgOiBcXFwiaGlrZXI6Ly9wYWdlL0NvbWljQnJvd3Nlci52aWV3XFxcIjtcXG4gICAgZm9yIChsZXQgaXRlbSBvZiBtaGxpc3QpIHtcXG4gICAgICAgIGxldCBwaWMgPSBmaWxlRXhpc3QoXFxcImZ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N0KSB7XFxuICAgICAgICBhcnJheS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogZ2V0VGl0bGUoaXRlbS5uYW1lKSxcXG4gICAgICAgICAgICB1cmw6IGl0ZW0ucGF0aCtsYXp5LFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBDb25maWcuZGVmX1ZpZXdfU3R5bGVcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufSBlbHNlIHtcXG4gICAgZm9yIChsZXQgaXRlbSBvZiBtaGxpc3QpIHtcXG4gICAgICAgIGxldCBuYW1lID0gZ2V0VGl0bGUoaXRlbS5uYW1lKTtcXG4gICAgICAgIGFycmF5LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIHVybDogJChcXFwi56Gu6K6k5Yig6ZmkW1xcXCIgKyBuYW1lICsgXFxcIl3vvJ9cXFwiKS5jb25maXJtKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmIChGaWxlLmRlbGV0ZUZpbGVzKHBhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpdGVtLnBhdGgpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBDb25maWcuZGVmX1ZpZXdfU3R5bGVcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcbmlmIChpc1JldmVyc2UgPT09IFxcX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Fwi5qOA5rWL5pu05pawXFxcIixcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKG9sZFZlcnNpb24sIHRpZCkgPT4ge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgbmV3VmVyc2lvbiA9IEpTT04ucGFyc2UocmVxdWVzdChcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL2Rldi9nZXRieWlkP2lkPTM1NTlcXFwiLCB7XFxuICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDIwMDBcXG4gICAgICAgICAgICB9KSkucmVzdWx0LnZlcjtcXG4gICAgICAgICAgICBpZiAobmV3VmVyc2lvbiA8PSBvbGRWZXJzaW9uKSB7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0odGlkICsgXFxcIiPorr7nva5f5pu05pawXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlt7Lnu4/mmK/mnIDmlrDniYjmnKzkuoZcXFwiXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5piv5pyA5paw54mI5pys5LqGXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHRpZCArIFxcXCIj6K6+572uX+abtOaWsFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5pyJ5paw54mI5pys6L+Y5pyq5pu05pawXFxcIlxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgdG9hc3QoXFxcIuacieaWsOeJiOacrOi/mOacquabtOaWsFxcXCIpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInJ1bGU6Ly81clczNlppVTZLZUc1NVdNNzcrbGF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cXFwiICsgaW5wdXROdW0pO1xcbiAgICAgICAgICAgIGNvbnN0IGJvb2tJbmZvID0gSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiKSB8fCBcXFwie31cXFwiKTtcXG4gICAgICAgICAgICBib29rSW5mby5mb290ID0gaW5wdXROdW07XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShib29rSW5mbykpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgfSwgdmlld1BhZ2VDb3VudCwgcGFnZU51bSwgcGF0aCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfNVxcXCJcXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5pyr6aG1XFxcIixcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgodmlld1BhZ2VDb3VudCwgcGFnZU51bSwgcGF0aCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBpbnB1dE51bSA9IHZpZXdQYWdlQ291bnQgLSAxO1xcbiAgICAgICAgICAgIGlmIChwYWdlTnVtID09PSBpbnB1dE51bSB8fCBpbnB1dE51bSA9PT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sue7j+aYr+acgOWQjuS4gOmhteS6hlxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCIucGFnZU51bVxcXCIsIFxcXCJcXFwiICsgaW5wdXROdW0pO1xcbiAgICAgICAgICAgIGNvb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cmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgaWYgKEZpbGUuZGVsZXRlRmlsZXMocGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5riF6Zmk5a6M5oiQXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5riF6Zmk5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKGxldCBjYWNoZSBvZiBjYWNoZURpcikge1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGNhY2hlLm5hbWUsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLlpKflsI/vvJpcXFwiICsgRmlsZS5nZXRGaWxlU2l6ZShjYWNoZS5wYXRoKSArIFxcXCJcXFxcbuaPj+i/sO+8mlxcXCIgKyAoa25vd25MaXN0LmdldChjYWNoZS5uYW1lKSB8fCBcXFwi5pyq55+l55uu5b2VW+mjjumZqeacquefpV1cXFwiKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIuehruiupOa4hemZpCBcXFwiICsgY2FjaGUubmFtZSArIFxcXCIgP1xcXCIpLmNvbmZpcm0oY2xlYW5DYWNoZSwgY2FjaGUucGF0aClcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZT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gICAgICAgIGlmICh0eXBlb2YoTVlfTkFNRSkgIT09IFxcXCJ1bmRlZmluZWRcXFwiICYmIE1ZX05BTUUgPT09IFxcXCLll4Xop4nmtY/op4jlmahcXFwiKSB7XFxuICAgICAgICAgICAgc3RhcnQgPSA0O1xcbiAgICAgICAgfVxcbiAgICAgICAgZm9yIChsZXQgaSA9IHN0YXJ0OyBpIDw9IDQ7IGkrKykge1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlm77niYdcXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJtb3ZpZV8zXFxcIixcXG4gICAgICAgICAgICAgICAgcGljX3VybDogXFxcImhpa2VyOi8vaW1hZ2VzL2hvbWVfcGljXFxcIiArIGksXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShzZXREZWZhdWx0UGljLCBcXFwiaGlrZXI6Ly9pbWFnZXMvaG9tZV9waWNcXFwiICsgaSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuiHquWumuS5ieKelVxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChbXFxcIuiHquWumuS5iXVybFxcXCIsIFxcXCLpgInmi6nmlofku7bot6/lvoRcXFwiXSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi6Ieq5a6a5LmJdXJsXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLovpPlhaXlm77niYfnmoTot6/lvoTmiJbogIXpk77mjqVcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IENvbmZpZyA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgMCkgfHwgXFxcInt9XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgQ29uZmlnLmRlZl9QaWMgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShDb25maWcpLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSByZXF1aXJlKHJlcXVpcmVVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCAwKSB8fCBcXFwie31cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29uZmlnLmRlZl9QaWMgPSBcXFwiZmlsZTovL1xcXCIgKyBQQVRIO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShDb25maWcpLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcIjpkZWZhdWx0UGljQmFja1xcXCIsIFxcXCJ0cnVlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZVVybDogcmVxdWlyZVVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcIi5qcGd8LmpwZWd8LmdpZnwucG5nfC5zdmd8LmJtcFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DbGlja1R5cGU6IFxcXCJjb25maXJtXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZW1vcnk6IFxcXCJzZWxlY3RQYXRoQ2FjaGUyXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSBcXFwicmVwbGFjZVJ1bGVcXFwiOlxcbiAgICAgICAgaWYgKE1ZX1BBUkFNUy5pc1JlZnJlc2gpIHtcXG4gICAgICAgICAgICBhZGRMaXN0ZW5lcihcXFwib25DbG9zZVxcXCIsICQudG9TdHJpbmcoKCkgPT4gcmVmcmVzaFBhZ2UoKSkpO1xcbiAgICAgICAgfVxcbiAgICAgICAgc2V0UGFnZVRpdGxlKFxcXCLmm7/mjaLop4TliJl86K6+572uXFxcIik7XFxuICAgICAgICBsZXQgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIikgfHwgXFxcIltdXFxcIik7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLmlrDlu7rmm7/mjaJcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9lZGl0UmVwbGFjZVJ1bGUudmlldyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSMjbm9SZWZyZXNoIz9pc05ldz10cnVlXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5a+85Ye66KeE5YiZXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIuehruiupOWvvOWHulxcXCIgKyBydWxlTGlzdC5sZW5ndGggKyBcXFwi5p2h6KeE5YiZ77yfXFxcXG4oe2hvbWVQdGFofS9yZXBsYWNlUnVsZS5qc29uKVxcXCIpLmNvbmZpcm0oKG51bSkgPT4ge1xcbiAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgc2F2ZVB0YSA9IENvbmZpZy5ob21lUGF0aCArIFxcXCIvcmVwbGFjZVJ1bGUuanNvblxcXCI7XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShzYXZlUHRhLCByZWFkRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIpIHx8IFxcXCJbXVxcXCIpO1xcbiAgICAgICAgICAgICAgICBsb2coXFxcIlxcXFxu6Lev5b6E77yaXFxcIiArIHNhdmVQdGEgKyBcXFwiXFxcXG7lr7zlh7rop4TliJkgXFxcIiArIG51bSArIFxcXCIg5p2hXFxcIik7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwic2hhcmU6Ly9cXFwiICsgc2F2ZVB0YTtcXG4gICAgICAgICAgICB9LCBydWxlTGlzdC5sZW5ndGgpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIlxcbiAgICAgICAgfSk7XFxuXFxuICAgICAgICBmdW5jdGlvbiBpbXBvcnRSdWxlKGlzYmFjaykge1xcbiAgICAgICAgICAgIGlucHV0ID0gdHlwZW9mIFBBVEggPT09IFxcXCJ1bmRlZmluZWRcXFwiID8gaW5wdXQgOiBQQVRIO1xcbiAgICAgICAgICAgIGlucHV0ID0gaW5wdXQuc3RhcnRzV2l0aChcXFwiZmlsZTovL1xcXCIpID8gaW5wdXQgOiBcXFwiZmlsZTovL1xcXCIgKyBpbnB1dFxcbiAgICAgICAgICAgIGxldCBydWxlVGV4dCA9IHJlcXVlc3QoaW5wdXQpO1xcbiAgICAgICAgICAgIGlmICghcnVsZVRleHQpIHJldHVybiBcXFwidG9hc3Q6Ly/ojrflj5bmlofku7bkuLrnqbpcXFwiO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBuZXdSdWxlTGlzdCA9IEpTT04ucGFyc2UocnVsZVRleHQpO1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIikgfHwgXFxcIltdXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBuZXdDb3VudCA9IDAsXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb3VudCA9IDA7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gbmV3UnVsZUxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBuZXdSdWxlID0gbmV3UnVsZUxpc3RbaV07XFxuICAgICAgICAgICAgICAgICAgICBpZiAoIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcInJlcGxhY2VtZW50XFxcIikgfHwgIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcInBhdHRlcm5cXFwiKSB8fCAhbmV3UnVsZS5oYXNPd25Qcm9wZXJ0eShcXFwibmFtZVxcXCIpIHx8IChuZXdSdWxlLnNjb3BlQ29udGVudCA9PT0gdW5kZWZpbmVkID8gZmFsc2UgOiAhbmV3UnVsZS5zY29wZUNvbnRlbnQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSBuZXdSdWxlLmlkO1xcbiAgICAgICAgICAgICAgICAgICAgbmV3UnVsZS5pZCA9IGlkIHx8IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkSW5kZXggPSBydWxlTGlzdC5maW5kSW5kZXgocnVsZSA9PiBydWxlLmlkID09PSBpZCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaWRJbmRleCA+IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlQ291bnQrKztcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5zcGxpY2UoaWRJbmRleCwgMSwgbmV3UnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0NvdW50Kys7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZUxpc3QucHVzaChuZXdSdWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1bGVMaXN0KSk7XFxuICAgICAgICAgICAgICAgIGlmIChpc2JhY2spIHtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbG9nKFxcXCJcXFxcbui3r+W+hO+8mlxcXCIgKyBpbnB1dCArIFxcXCJcXFxcbuaAu+inhOWImeaVsO+8mlxcXCIgKyBuZXdSdWxlTGlzdC5sZW5ndGggKyBcXFwiXFxcXG7mm7TmlrDop4TliJkgXFxcIiArIHVwZGF0ZUNvdW50ICsgXFxcIiDmnaFcXFxcdOaWsOWinuinhOWImSBcXFwiICsgbmV3Q291bnQgKyBcXFwiIOadoVxcXCIpO1xcbiAgICAgICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5oiQ5YqfXFxcIik7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgaWYgKGlzYmFjaykgYmFjaygpO1xcbiAgICAgICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5aSx6LSlXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5a+85YWl6KeE5YiZXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLlpJbpg6jmlofku7ZcXFwiLCBcXFwi5YaF6YOo5paH5Lu2XFxcIl0sIDEsIFxcXCLop4TliJnlr7zlhaVcXFwiKS5zZWxlY3QoKGltcG9ydFJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi5aSW6YOo5paH5Lu2XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJmaWxlU2VsZWN0Oi8vXFxcIiArICQudG9TdHJpbmcoaW1wb3J0UnVsZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKGltcG9ydFJ1bGUsIHRydWUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IHJlcXVpcmVVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIuanNvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DbGlja1R5cGU6IFxcXCJjb25maXJtXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZW1vcnk6IFxcXCJzZWxlY3RQYXRoQ2FjaGVcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGltcG9ydFJ1bGUpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBmb3IgKGxldCBpID0gMCwgbGVuID0gcnVsZUxpc3QubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgcmVwbGFjZVJ1bGUgPSBydWxlTGlzdFtpXTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiByZXBsYWNlUnVsZS5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCIuXFxcIiArIGksXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGlkLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJ1bGVMaXN0ID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIpIHx8IFxcXCJbXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGcgPSBydWxlTGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9kZWxldGVJdGVtQnlDbHMoaWQgKyBcXFwiLlxcXCIgKyBpbmRleCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5Yig6Zmk5oiQ5YqfXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBpZCwgaSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaVxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi57yW6L6RXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2VkaXRSZXBsYWNlUnVsZS52aWV3I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IyNub1JlZnJlc2gjP2luZGV4PVxcXCIgKyBpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCIuXFxcIiArIGlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgXFxcImNvbnRlbnRzXFxcIjpcXG4gICAgICAgIGxldCBmID0gcmVxdWlyZShcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCIpO1xcbiAgICAgICAgc2V0UGFnZVRpdGxlKFxcXCLnm67lvZXorr7nva586K6+572uXFxcIik7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLpgInmi6nmlofku7blpLlcXFwiLFxcbiAgICAgICAgICAgIHVybDogSlNPTi5zdHJpbmdpZnkoZi5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGFyZ2V0ID0gZmluZEl0ZW0oaWQpLmV4dHJhO1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHRhcmdldCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IFBBVEhcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgfSwgaWQpLFxcbiAgICAgICAgICAgICAgICBpbml0aWFsUGF0aDogQ29uZmlnLmhvbWVQYXRoLFxcbiAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiBcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCIsXFxuICAgICAgICAgICAgICAgIHBhdHRlcm46IDFcXG4gICAgICAgICAgICB9KSksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIuaUr+aMgWhpa2VyOi8vZmlsZXPot6/lvoQo6K+l5pON5L2c5LiN5Lya5Yid5aeL5YyW55uu5b2VKVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgZGVm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xcbiAgICAgICAgICAgIGNvbnN0IGJvb2tJbmZvID0gT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkOiBbXVxcbiAgICAgICAgICAgIH0sIEpTT04ucGFyc2UocmVxdWVzdChcXFwiZmlsZTovL1xcXCIgKyBwYXRoICsgXFxcIi9ib29rSW5mby5qc29uXFxcIikgfHwgXFxcInt9XFxcIikpO1xcbiAgICAgICAgICAgIGJvb2tJbmZvLnNlbGVjdGVkLnB1c2gocmVwbGFjZVJ1bGUuaWQpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJGlkLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4pePXFxcIiArIHJlcGxhY2VSdWxlLm5hbWUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpc1RydWU6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICBpZDogJGlkLFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIvYm9va0luZm8uanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGJvb2tJbmZvKSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgIH0sIGlkICsgaSwgcmVwbGFjZVJ1bGUsIE1ZX1BBUkFNUy5wYXRoKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbiAgICB9KTtcXG4gICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLlhbPpl61cXFwiLFxcbiAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgkaWQsIHJlcGxhY2VSdWxlLCBwYXRoKSA9PiB7XFxuICAgICAgICAgICAgaWYgKCFmaW5kSXRlbSgkaWQpLmV4dHJhLmlzVHJ1ZSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey5YWz6ZetXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgY29uc3QgYm9va0luZm8gPSBPYmplY3QuYXNzaWduKHtcXG4gICAgICAgICAgICAgICAgc2VsZWN0ZWQ6IFtdXFxuICAgICAgICAgICAgfSwgSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiKSB8fCBcXFwie31cXFwiKSk7XFxuICAgICAgICAgICAgYm9va0luZm8uc2VsZWN0ZWQuc3BsaWNlKGJvb2tJbmZvLnNlbGVjdGVkLmluZGV4T2YocmVwbGFjZVJ1bGUuaWQpLCAxKTtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKCRpZCwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKXi1xcXCIgKyByZXBsYWNlUnVsZS5uYW1lLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaXNUcnVlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiAkaWQsXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiZmlsZTovL1xcXCIgKyBwYXRoICsgXFxcIi9ib29rSW5mby5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoYm9va0luZm8pKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgfSwgaWQgKyBpLCByZXBsYWNlUnVsZSwgTVlfUE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xcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJmaWxlU2VsZWN0Oi8vXFxcIiArICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEvKFxcXFwudHh0KSQvaS50ZXN0KGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLpgInmi6nkuobplJnor6/nmoTmlofku7bnsbvlnotcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5vdmVsTmFtZSA9IGlucHV0Lm1hdGNoKC9cXFxcLyhbXlxcXFwvXSo/KShcXFxcLnR4dCkkL2kpWzFdLnJlcGxhY2UoXFxcIl9maWxlU2VsZWN0X1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGggPSBDb25maWcuZXh0ZXJuYWxJbXBvcnRQYXRoICsgbm92ZWxOYW1lICsgXFxcIi50eHRcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBpbnB1dC5yZXBsYWNlKFxcXCJmaWxlOi8vXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5a+85YWl5o+Q56S6XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXFxcIuW3suWtmOWcqFtcXFwiICsgbm92ZWxOYW1lICsgXFxcIl3mmK/lkKbopobnm5Y/XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygocGF0aCwgdG9wYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgsIHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGggKyBcXFwiLmpzb25cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoICsgXFxcIi5qc29uXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcGF0aCwgdG9wYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGggKyBcXFwiLmpzb25cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aCArIFxcXCIuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuWvvOWFpeaIkOWKn1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCI7XFxuICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzb25cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbm92ZWxOYW1lID0gUEFUSC5tYXRjaCgvXFxcXC8oW15cXFxcL10qPykoXFxcXC50eHQpJC9pKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoID0gQ29uZmlnLmV4dGVybmFsSW1wb3J0UGF0aCArIG5vdmVsTmFtZSArIFxcXCIudHh0XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IFBBVEg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLlt7LlrZjlnKhbXFxcIiArIG5vdmVsTmFtZSArIFxcXCJd5piv5ZCm6KaG55uWP1xcXCIpLmNvbmZpcm0oKHBhdGgsIHRvcGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoLCB0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoICsgXFxcIi5qc29uXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aCArIFxcXCIuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBhdGgsIHRvcGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aCArIFxcXCIuanNvblxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aCArIFxcXCIuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiByZXF1aXJlVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIudHh0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFwiY29uZmlybVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBtZW1vcnk6IFxcXCJzZWxlY3RQYXRoQ2FjaGUxXFxcIlxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBsZXQgb3B0aW9ucyA9IFtcXFwi6ZiF6K+7XFxcIiwgXFxcIuWIhuS6q1xcXCIsIFxcXCLliKDpmaRcXFwiLCBcXFwi5omT5byA5pa55byPXFxcIl07XFxuXFxuICAgIGxldCBwYXR0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iAkKFxcXCLnoa7orqTliKDpmaRbXFxcIiArIG5hbWUgKyBcXFwiXVxcXCIpLmNvbmZpcm0oKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIuanNvblxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXMocGF0aCArIFxcXCIuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgcGF0aCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgXFxcIumYheivu1xcXCI6XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3R4dFBhcnNlci52aWV3XFxcIjtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSBcXFwi5omT5byA5pa55byPXFxcIjpcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJvcGVuRmlsZTovL2ZpbGU6Ly9cXFwiICsgcGF0aDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH1cXG5cXG4gICAgZm9yIChsZXQgbm92ZWwgb2YgZmlsZXMpIHtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbm92ZWwubmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUob3BlcmF0aW9uLCBub3ZlbC5wYXRoLCBub3ZlbC5uYW1lKSxcXG4gICAgICAgICAgICBkZXNjOiBcXFwi5aSn5bCP77yaXFxcIiArIEZpbGUuZ2V0RmlsZVNpemUobm92ZWwucGF0aCkgKyBcXFwiXFxcXG7kv67mlLnml7bpl7TvvJpcXFwiICsgJC5kYXRlRm9ybWF0KG5vdmVsLmxhc3RNb2RpZmllZCwgXFxcInl5eXktTU0tZGQgSEg6bW06c3NcXFwiKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgcGF0aDogbm92ZWwucGF0aCxcXG4gICAgICAgICAgICAgICAgaXNDYWNoZTogdHJ1ZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIGlmIChmaWxlcy5sZW5ndGggPT09IDApIHtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuiuvue9rlxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL1NldHRpbmcudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5I1xcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHZlcnNpb246IE1ZX1JVTEUudm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TtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcIi5qc29uXFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTpmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTpcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICBzZXRSZXN1bHQoW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08c3Ryb25nPuebruW9leino+aekOWksei0pSjph43mlrDop6PmnpApPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcIi5qc29uXFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1dKTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuXFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBzaG93TG9hZGluZyhcXFwi5q2j5Zyo6Kej5p6Q55uu5b2VXFxcIik7XFxuICAgICAgICBsZXQgdHh0ID0gcmVxdWVzdChwYXRoLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAvL1xcXCJjb250ZW50LXR5cGVcXFwiOiBcXFwidGV4dC9wbGFpbjsgY2hhcnN0PVxcXCIgKyBjaGFyc3RcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCBwYXR0ZXJuID0gcmVncy5nZXRUb2NSdWxlKHR4dCk7XFxuICAgICAgICBpZiAoIXBhdHRlcm4pIHtcXG4gICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxzdHJvbmc+55uu5b2V6Kej5p6Q5aSx6LSlPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1dKTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgbWF0Y2hlciA9IHBhdHRlcm4ubWF0Y2hlcih0eHQpO1xcbiAgICAgICAgbGV0IHBvaW50ZXIgPSAwO1xcbiAgICAgICAgd2hpbGUgKG1hdGNoZXIuZmluZCgpKSB7XFxuICAgICAgICAgICAgbGV0IHN0YXJ0ID0gbWF0Y2hlci5zdGFydCgpO1xcbiAgICAgICAgICAgIGxldCBlbmQgPSBtYXRjaGVyLmVuZCgpO1xcbiAgICAgICAgICAgIGxldCB0ID0gbWF0Y2hlci5ncm91cCgpO1xcbiAgICAgICAgICAgIGlmIChwb2ludGVyID09PSAwICYmIHN0YXJ0ID4gMzApIHtcXG4gICAgICAgICAgICAgICAgaGFzUHJlZmFjZSA9IHRydWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNoYXB0ZXJOYW1lcy5wdXNoKHQpO1xcbiAgICAgICAgICAgIGludGVydmFscy5wdXNoKFtwb2ludGVyLCBzdGFydF0pO1xcbiAgICAgICAgICAgIHBvaW50ZXIgPSBlbmQ7XFxuICAgICAgICB9XFxuICAgICAgICBpbnRlcnZhbHMucHVzaChbcG9pbnRlciwgdHh0Lmxlbmd0aF0pO1xcbiAgICAgICAgaWYgKGlzQ2FjaGUpIHtcXG4gICAgICAgICAgICB3cml0ZUZpbGUocGF0aCArIFxcXCIuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgY2hhcHRlck5hbWVzOiBjaGFwdGVyTmFtZXMsXFxuICAgICAgICAgICAgICAgIGludGVydmFsczogaW50ZXJ2YWxzLFxcbiAgICAgICAgICAgICAgICBoYXNQcmVmYWNlOiBoYXNQcmVmYWNlXFxuICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgfVxcblxcblxcbiAgICBpZiAoaGFzUHJlZmFjZSkge1xcbiAgICAgICAgbGV0IGludGVydmFsID0gaW50ZXJ2YWxzWzBdO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5bqP6KiAXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL1RYVFZpZXdlci52aWV3I2F1dG9QYWdlIyNyZWFkVGhlbWUjXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBjaGFwdGVyTmFtZTogXFxcIuW6j+iogFxcXCIsXFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswXSxcXG4gICAgICAgICAgICAgICAgZW5kOiBpbnRlcnZhbFsxXSxcXG4gICAgICAgICAgICAgICAgcGF0aDogcGF0aCxcXG4gICAgICAgICAgICAgICAgY2hhcnN0OiBjaGFyc3RcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNoYXB0ZXJOYW1lcy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgbGV0IG5hbWUgPSBjaGFwdGVyTmFtZXNbaV07XFxuICAgICAgICBsZXQgaW50ZXJ2YWwgPSBpbnRlcnZhbHNbaSArIDFdO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvVFhUVmlld2VyLnZpZXcjYXV0b1BhZ2UjI3JlYWRUaGVtZSNcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswXSxcXG4gICAgICAgICAgICAgICAgZW5kOiBpbnRlcnZhbFsxXSxcXG4gICAgICAgICAgICAgICAgY2hhcHRlck5hbWU6IG5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BcXFxcXFxcIumAieaLqeaTjeS9nFxcXFxcXFwiKS5zZWxlY3QoKGl0KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChcXFxcXFxcIui3s+i9rOWwj+eoi+W6j1xcXFxcXFwiID09PSBpbnB1dCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9ob21lQFxcXFxcXFwiICsgaXQubmFtZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIHRoZW4oW1xcXFxcXFwi6K+l5pON5L2c5LiN5Lya5Yig6Zmk5bCP56iL5bqP77yM5L2G6K+l5bCP56iL5bqP5LiL6L2955qE5omA5pyJ5ryr55S75bCG6KKr5Yig6ZmkXFxcXFxcXCJdKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwi6K+l5pON5L2c5LiN5Lya5Yig6Zmk5bCP56iL5bqP77yM5L2G6K+l5bCP56iL5bqP5LiL6L2955qE5omA5pyJIOa8q+eUuy/lsI/or7Qg5bCG6KKr5Yig6ZmkXFxcXFxcXCIpLmNvbmZpcm0oKHBhdGgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZpbGUuZGVsZXRlRmlsZXMocGF0aCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFxcXFxcIi50Z251bVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0LnBhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSwgaXQpXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogaXQubmFtZSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoaSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiLnRnbnVtXFxcXFxcXCIsIGkpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSwgaSksXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBsZXQgcGF0aCA9IHRhZ1t0Z251bV0ucGF0aDtcXFxcbiAgICBsZXQgbWhsaXN0ID0gRmlsZS5nZXRGaWxlUGF0aChwYXRoLCBcXFxcXFxcImRpcl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zNcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJChbXFxcXFxcXCLoh6rlrprkuYl1cmxcXFxcXFxcIiwgXFxcXFxcXCLpgInmi6nmlofku7bot6/lvoRcXFxcXFxcIl0pLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFxcXFxcIuiHquWumuS5iXVybFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwiXFxcXFxcXCIsIFxcXFxcXFwi6L6T5YWl5Zu+54mH55qE6Lev5b6E5oiW6ICF6ZO+5o6lXFxcXFxcXCIpLmlucHV0KCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXFxcXFwiY29uZmlnLmpzb25cXFxcXFxcIiwgMCkgfHwgXFxcXFxcXCJ7fVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gaW5wdXQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFxcXFxcImNvbmZpZy5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFxcXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSByZXF1aXJlKHJlcXVpcmVVcmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmlsZVNlbGVjdC5maWxlU2VsZWN0aW9uVXJpKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFxcXFxcImNvbmZpZy5qc29uXFxcXFxcXCIsIDApIHx8IFxcXFxcXFwie31cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29uZmlnLmRlZl9QaWMgPSBcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIFBBVEg7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcXFxcXCJjb25maWcuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShDb25maWcpLCAwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcIjpkZWZhdWx0UGljQmFja1xcXFxcXFwiLCBcXFxcXFxcInRydWVcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IHJlcXVpcmVVcmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcXFxcXCIuanBnfC5qcGVnfC5naWZ8LnBuZ3wuc3ZnfC5ibXBcXFxcXFxcIixcXFxcbi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wiKSB8fCAhbmV3UnVsZS5oYXNPd25Qcm9wZXJ0eShcXFxcXFxcInBhdHRlcm5cXFxcXFxcIikgfHwgIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcXFxcXCJuYW1lXFxcXFxcXCIpIHx8IChuZXdSdWxlLnNjb3BlQ29udGVudCA9PT0gdW5kZWZpbmVkID8gZmFsc2UgOiAhbmV3UnVsZS5zY29wZUNvbnRlbnQpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSBuZXdSdWxlLmlkO1xcXFxuICAgICAgICAgICAgICAgICAgICBuZXdSdWxlLmlkID0gaWQgfHwgbmV3IERhdGUoKS5nZXRUaW1lKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpZEluZGV4ID0gcnVsZUxpc3QuZmluZEluZGV4KHJ1bGUgPT4gcnVsZS5pZCA9PT0gaWQpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaWRJbmRleCA+IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb3VudCsrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZUxpc3Quc3BsaWNlKGlkSW5kZXgsIDEsIG5ld1J1bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3Q291bnQrKztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnB1c2gobmV3UnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcXFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1bGVMaXN0KSk7XFxcX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xcXFxcXCLop4TliJnlr7zlhaVcXFxcXFxcIikuc2VsZWN0KChpbXBvcnRSdWxlKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFxcXFxcIuWklumDqOaWh+S7tlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImZpbGVTZWxlY3Q6Ly9cXFxcXFxcIiArICQudG9TdHJpbmcoaW1wb3J0UnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFxcXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSByZXF1aXJlKHJlcXVpcmVVcmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmlsZVNlbGVjdC5maWxlU2VsZWN0aW9uVXJpKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKGltcG9ydFJ1bGUsIHRydWUpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZVVybDogcmVxdWlyZVVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFxcXFxcIi5qc29uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcXFxcXCJjb25maXJtXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZW1vcnk6IFxcXFxcXFwic2VsZWN0UGF0aENhY2hlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSwgaW1wb3J0UnVsZSksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzNcXFxcXFxcIlxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBmb3IgKGxldCBpID0gMCwgbGVuID0gcnVsZUxpc3QubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcXFxcbiAgICAgICAgICAgIGxldCByZXBsYWNlUnVsZSA9IHJ1bGVMaXN0W2ldO1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiByZXBsYWNlUnVsZS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXFxcXFwiLlxcXFxcXFwiICsgaSxcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5Yig6ZmkXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKGlkLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnVsZUxpc3QgPSBKU09OLnBh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3J5IyNub0hpc3RvcnkjI25vUmVmcmVzaCM/aW5kZXg9XFxcXFxcXCIgKyBpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIi5cXFxcXFxcIiArIGlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJsaW5lX2JsYW5rXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXFxcXFwiLlxcXFxcXFwiICsgaVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGJyZWFrO1xcXFxuICAgIGNhc2UgXFxcXFxcXCJjb250ZW50c1xcXFxcXFwiOlxcXFxuICAgICAgICBsZXQgZiA9IHJlcXVpcmUoXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCIpO1xcXFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcXFxcXCLnm67lvZXorr7nva586K6+572uXFxcXFxcXCIpO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLpgInmi6nmlofku7blpLlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogSlNPTi5zdHJpbmdpZnkoZi5maWxlU2VsZWN0aW9uVXJpKHtcXFxcbiAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoaWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9IGZpbmRJdGVtKGlkKS5leHRyYTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24odGFyZ2V0LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBQQVRIXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxcXG4gICAgICAgICAgICAgICAgfSwgaWQpLFxcXFxuICAgICAgICAgICAgICAgIGluaXRpYWxQYXRoOiBDb25maWcuaG9tZVBhdGgsXFxcXG4gICAgICAgICAgICAgICAgcmVxdWlyZVVybDogXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgcGF0dGVybjogMVxcXFxuICAgICAgICAgICAgfSkpLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiaW5wdXRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi5pSv5oyBaGlrZXI6Ly9maWxlc+i3r+W+hCjor6Xmk43kvZzkuI3kvJrliJ3lp4vljJbnm67lvZUpXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogQ29uZmlnLmhvbWVQYXRoLFxcXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiAkLnRvU3RyaW5nKChpZCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihpZCwgaW5wdXQp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FxcXFxcXFwvKFteXFxcXFxcXFwvXSo/KShcXFxcXFxcXC50eHQpJC9pKVsxXS5yZXBsYWNlKFxcXFxcXFwiX2ZpbGVTZWxlY3RfXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoID0gQ29uZmlnLmV4dGVybmFsSW1wb3J0UGF0aCArIG5vdmVsTmFtZSArIFxcXFxcXFwiLnR4dFxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IGlucHV0LnJlcGxhY2UoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5a+85YWl5o+Q56S6XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXFxcXFxcXCLlt7LlrZjlnKhbXFxcXFxcXCIgKyBub3ZlbE5hbWUgKyBcXFxcXFxcIl3mmK/lkKbopobnm5Y/XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygocGF0aCwgdG9wYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgsIHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoICsgXFxcXFxcXCIuanNvblxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGggKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBwYXRoLCB0b3BhdGgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGggKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGggKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcXFxcXCLlr7zlhaXmiJDlip9cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFxcXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9IHJlcXVpcmUocmVxdWlyZVVybCk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNvblxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3ZlbE5hbWUgPSBQQVRILm1hdGNoKC9cXFxcXFxcXC8oW15cXFxcXFxcXC9dKj8pKFxcXFxcXFxcLnR4dCkkL2kpWzFdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aCA9IENvbmZpZy5leHRlcm5hbEltcG9ydFBhdGggKyBub3ZlbE5hbWUgKyBcXFxcXFxcIi50eHRcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXRoID0gUEFUSDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGgpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCLlt7LlrZjlnKhbXFxcXFxcXCIgKyBub3ZlbE5hbWUgKyBcXFxcXFxcIl3mmK/lkKbopobnm5Y/XFxcXFxcXCIpLmNvbmZpcm0oKHBhdGgsIHRvcGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoLCB0cnVlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aCArIFxcXFxcXFwiLmpzb25cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoICsgXFxcXFxcXCIuanNvblxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcGF0aCwgdG9wYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoICsgXFxcXFxcXCIuanNvblxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aCArIFxcXFxcXFwiLmpzb25cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZVVybDogcmVxdWlyZVVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXFxcXFwiLnR4dFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcXFxcXCJjb25maXJtXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIG1lbW9yeTogXFxcXFxcXCJzZWxlY3RQYXRoQ2FjaGUxXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSksXFxcXG4gICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2Vc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G5hbWUpIHtcXFxcbiAgICAgICAgbGV0IHBhdHRlcm4gPSBnZXRNeVZhcihcXFxcXFxcIjp0eHRQYXR0ZXJuXFxcXFxcXCIsIFxcXFxcXFwi6ZiF6K+7XFxcXFxcXCIpO1xcXFxuICAgICAgICBzd2l0Y2ggKHBhdHRlcm4pIHtcXFxcbiAgICAgICAgICAgIGNhc2UgXFxcXFxcXCLliIbkuqtcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJzaGFyZTovL1xcXFxcXFwiICsgcGF0aDtcXFxcbiAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgIGNhc2UgXFxcXFxcXCLliKDpmaRcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuehruiupOWIoOmZpFtcXFxcXFxcIiArIG5hbWUgKyBcXFxcXFxcIl1cXFxcXFxcIikuY29uZmlybSgocGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChGaWxlLmRlbGV0ZUZpbGVzKHBhdGgpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgcGF0aCArIFxcXFxcXFwiLmpzb25cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHBhdGggKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxc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ZUZpbGUocGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9LCBwYXRoK1xcXFxcXFwiLmpzb25cXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6ZmFsc2VcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTpcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcXFxuICAgICAgICAgICAgc2V0UmVzdWx0KFt7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPHN0cm9uZz7nm67lvZXop6PmnpDlpLHotKUo6YeN5paw6Kej5p6QKTwvc3Ryb25nPlxcXFxcXFwiLmJpZygpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgocGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFxcXFxcIi5qc29uXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1dKTtcXFxcbiAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgfVxcXFxuXFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgc2hvd0xvYWRpbmcoXFxcXFxcXCLmraPlnKjop6PmnpDnm67lvZVcXFxcXFxcIik7XFxcXG4gICAgICAgIGxldCB0eHQgPSByZXF1ZXN0KHBhdGgsIHtcXFxcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAvL1xcXFxcXFwiY29udGVudC10eXBlXFxcXFxcXCI6IFxcXFxcXFwidGV4dC9wbGFpbjsgY2hhcnN0PVxcXFxcXFwiICsgY2hhcnN0XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBsZXQgcGF0dGVybiA9IHJlZ3MuZ2V0VG9jUnVsZSh0eHQpO1xcXFxuICAgICAgICBpZiAoIXBhdHRlcm4pIHtcXFxcbiAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxcXG4gICAgICAgICAgICBzZXRSZXN1bHQoW3tcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzigJ3igJ08c3Ryb25nPuebruW9leino+aekOWksei0pTwvc3Ryb25nPlxcXFxcXFwiLmJpZygpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfV0pO1xcXFxuICAgICAgICAgICAgcmV0dXJuO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCBtYXRjaGVyID0gcGF0dGVybi5tYXRjaGVyKHR4dCk7XFxcXG4gICAgICAgIGxldCBwb2ludGVyID0gMDtcXFxcbiAgICAgICAgd2hpbGUgKG1hdGNoZXIuZmluZCgpKSB7XFxcXG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBtYXRjaGVyLnN0YXJ0KCk7XFxcXG4gICAgICAgICAgICBsZXQgZW5kID0gbWF0Y2hlci5lbmQoKTtcXFxcbiAgICAgICAgICAgIGxldCB0ID0gbWF0Y2hlci5ncm91cCgpO1xcXFxuICAgICAgICAgICAgaWYgKHBvaW50ZXIgPT09IDAgJiYgc3RhcnQgPiAzMCkge1xcXFxuICAgICAgICAgICAgICAgIGhhc1ByZWZhY2UgPSB0cnVlO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgY2hhcHRlck5hbWVzLnB1c2godCk7XFxcXG4gICAgICAgICAgICBpbnRlcnZhbHMucHVzaChbcG9pbnRlciwgc3RhcnRdKTtcXFxcbiAgICAgICAgICAgIHBvaW50ZXIgPSBlbmQ7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaW50ZXJ2YWxzLnB1c2goW3BvaW50ZXIsIHR4dC5sZW5ndGhdKTtcXFxcbiAgICAgICAgaWYgKGlzQ2FjaGUpIHtcXF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cIik7XFxcXG5sZXQgdGV4dDtcXFxcbmlmIChrZXl3b3JkID09PSB1bmRlZmluZWQgfHwgISh0ZXh0ID0gaGVscFRleHRba2V5d29yZF0pKSB7XFxcXG4gICAgc2V0UmVzdWx0KFt7XFxcXG4gICAgICAgIHRpdGxlOiAnPGgxIHN0eWxlPVxcXFxcXFwidGV4dC1hbGlnbjogY2VudGVyO1xcXFxcXFwiPui1hOaWmeS4jeingeWSrzwvaDE+JyxcXFxcbiAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwicmljaF90ZXh0XFxcXFxcXCJcXFxcbiAgICB9XSk7XFxcXG59IGVsc2Uge1xcXFxuICAgIHNldFJlc3VsdChbe1xcXFxuICAgICAgICB0aXRsZTogdGV4dCxcXFxcbiAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwicmljaF90ZXh0XFxcXFxcXCJcXFxcbiAgICB9XSk7XFxcXG59XFxcIn1dXCIsXCJwcm94eVwiOlwiXCJ9IiwidGl0bGUiOiLpgInmi6nlmah8W+e7vF3nlKjnu7Plkb3mjqjplIDnmoTnlLfkurog5L2c6ICF77ya6YaJ6aWu6ZW/5q2MIn0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement