Advertisement
xiaomianao666

邀您一起看:看看y

Feb 18th, 2023
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥看看y@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS6jOe6p+ino+aekFwiLFwicGF0aFwiOlwicFwiLFwicnVsZVwiOlwianM6XFxudmFyIGQgPSBbXTtcXG5sZXQgdXJsID0gYmFzZTY0RGVjb2RlKGdldFBhcmFtKFxcXCJ1XFxcIikpO1xcbmxldCBtdnRpdGxlID0gYmFzZTY0RGVjb2RlKGdldFBhcmFtKFxcXCJtb3Z0aXRsZVxcXCIpKTtcXG5sZXQgaHRtbCA9IHJlcXVlc3QodXJsKTtcXG5sZXQgYWxpc3QgPSBwZGZhKGh0bWwsIFxcXCJib2R5JiZhXFxcIik7XFxubGV0IGFyciA9IGFsaXN0Lm1hcChpdCA9PiB7XFxuICAgIHJldHVybiB7XFxuICAgICAgICAvL2h0bWw6IGl0LFxcbiAgICAgICAgdGV4dDogcGRmaChpdCwgXFxcImEmJlRleHRcXFwiKSxcXG4gICAgICAgIHRpdGxlOiBwZGZoKGl0LCBcXFwiYSYmdGl0bGVcXFwiKSxcXG4gICAgICAgIGhyZWY6IHBkKGl0LCBcXFwiYSYmaHJlZlxcXCIsIHVybClcXG4gICAgfVx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8IGl0LmhyZWYgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgIGNvbnRpbnVlO1xcbiAgICB9XFxuICAgIGxldCBwcmUgPSBpID09IDAgPyBudWxsIDogYXJyW2kgLSAxXTtcXG4gICAgbGV0IG5leHQgPSBpID09IChhcnIubGVuZ3RoIC0gMSkgPyBudWxsIDogYXJyW2kgKyAxXTtcXG4gICAgaWYgKGlzQ2hhcHRlcihpdCwgcHJlLCBuZXh0KSkge1xcbiAgICAgICAgaWYgKHdlYikge1xcbiAgICAgICAgICAgIHZhciB1cmx4ID0gXFxcIndlYlJ1bGU6Ly9cXFwiICsgaXQuaHJlZiArIFxcXCJAXFxcIiArIF93ZWI7XFxuICAgICAgICAgICAgdmFyIGV4dHJheCA9IHtcXG4gICAgICAgICAgICAgICAganNMb2FkaW5nSW5qZWN0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICBpZDogaXQuaHJlZixcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycubTRhJywgJy5tcDMnLCAnLmZsdicsICcuYXZpJywgJy4zZ3AnLCAnLm1wZWcnLCAnLndtdicsICcubW92JywgJy5ybXZiJywgJy5naWYnLCAnLmpwZWcnLCAnLnBuZycsICcuaWNvJywgJy5zdmcnXVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHZhciB1cmx4ID0gXFxcInZpZGVvOi8vXFxcIiArIGl0LmhyZWY7XFxuICAgICAgICAgICAgdmFyIGV4dHJheCA9IHtcXG4gICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWZcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdCxcXG4gICAgICAgICAgICB1cmw6IHVybHgsXFxuICAgICAgICAgICAgcGg6IHQgKyBcXFwiJFxcXCIgKyBpdC5ocmVmLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF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fCB0MSAtIHQyID4gMSkge1xcbiAgICAgICAgICAgICAgICBtdGFiLnB1c2goJyMnKTtcXG4gICAgICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJpZ19ibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJpZ19ibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGxldCBwbGF5bCA9IG10YWIuam9pbignIycpLnJlcGxhY2UoLyMjIy9nLCAnJCQkJCQkJyk7XFxuXFxuICAgIGxldCBmcm9tID0gW107XFxuICAgIGZvciAodmFyIGogPSAwOyBqIDwgcGxheWwuc3BsaXQoJyQkJCcpLmxlbmd0aDsgaisrKSB7XFxuICAgICAgICBmcm9tLnB1c2goXFxcIuaSreaUvuWIl+ihqFxcXCIgKyBbaiArIDFdKTtcXG4gICAgfVxcbiAgICBsZXQgcHVzaCA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgIFxcXCJuYW1lXFxcIjogbXZ0aXRsZSxcXG4gICAgICAgIFxcXCJmcm9tXFxcIjogZnJvbS5qb2luKCckJCQnKSxcXG4gICAgICAgIFxcXCJ1cmxcXFwiOiBwbGF5bC5yZXBsYWNlKC9cXFxcJi9nLCAn77yG77yGJylcXG4gICAgfSk7XFxuICAgIC8vbG9nKHB1c2gpO1xcblxcbiAgICBkMi51bnNoaWZ0KHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5o6o6YCB5b2T5YmN6aG15Y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gICAgaWYgKGRhdGEubGVuZ3RoID4gMCkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuWKoOi9veesrFxcXCIgKyBwICsgXFxcIumhteS4re+8jOi/m+W6pu+8mjEvXFxcIiArIGRhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgIHVybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgc2V0UmVzdWx0KGQpO1xcbiAgICBsb2coZGF0YS5sZW5ndGgpO1xcbiAgICBpZiAoZGF0YS5sZW5ndGggPiAwKSB7XFxuICAgICAgICAvL+Wkmue6v+eoi+WKoOi9vSAgICAgICAgXFxuICAgICAgICBsZXQgcmVhbFBhZ2UgPSBcXFwiXFxcIiA9PSByID8gMSA6IHA7XFxuICAgICAgICBsZXQgdGFza3MgPSBkYXRhLm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocnVsZSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUuZmluZChzLCByZWFsUGFnZSk7XFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIHBhcmFtOiBpdCxcXG4gICAgICAgICAgICAgICAgaWQ6IFxcXCJydWxlQFxcXCIgKyBpdC5uYW1lXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuXFxuICAgICAgICBiYXRjaEV4ZWN1dGUodGFza3MsIHtcXG4gICAgICAgICAgICBmdW5jOiBmdW5jdGlvbihwYXJhbSwgaWQsIGVycm9yLCByZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgLy9sb2coXFxcImxpc3RlbmVyOiBcXFwiICsgKHJlc3VsdCB8fCBbXSkubGVuZ3RoKVxcbiAgICAgICAgICAgICAgICBwYXJhbS5pID0gcGFyYW0uaSArIDE7XFxuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgcmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLmogPSBwYXJhbS5qICsgMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB3cmFwKGl0LnRpdGxlLCBzKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGl0LmRlc2MsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnBpY191cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQucGljX3VybCA/ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycgOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBpdC5leHRyYVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtLmkgPj0gcGFyYW0uYWxsKSB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yqg6L2956ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFwiL1xcXCIgKyBwYXJhbS5hbGwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICBhbGw6IGRhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgICAgICBpOiAwLFxcbiAgICAgICAgICAgICAgICBqOiAtMVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG59IGVsc2Uge1xcbiAgICBsZXQge1xcbiAgICAgICAgbG9hZFxcbiAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZGF0YVxcXCIpO1xcbiAgICBsZXQgZGF0YSA9IGxvYWQoLTEsIG51bGwpO1xcbiAgICBpZiAoZGF0YS5sZW5ndGggPiAwKSB7XFxuICAgICAgICAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9tYW5hZ2VcXFwiKShkLCBkYXRhLm1hcChpdCA9PiBpdC5uYW1lKSk7XFxuICAgICAgICBmb3IgKGxldCBpdCBvZiBkYXRhKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0Lm5hbWUsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcInNlbGVjdDovL1xcXCIgKyBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuivt+mAieaLqeaTjeS9nFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2w6IDEsXFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiBbXFxcIuiuv+mXrummlumhtVxcXCIsIFxcXCLmkJzntKLmraTnq5lcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuiuv+mXrummlumhtVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVlfVVJMID0gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIng1Oi8vXFxcIiArIGdldEhvbWUodXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3NpbmdsZXNcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgaXQudXJsKVxcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJmbGV4X2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbi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UveXptXFxcIik7XFxuICAgICAgICBpZiAoY2hlY2sodXJsLCBodG1sLCBkKSkge1xcbiAgICAgICAgICAgIGxvZyhcXFwi6YeN6K+V5LqGXFxcIik7XFxuICAgICAgICAgICAgaHRtbCA9IHJlcXVlc3QodXJsLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogdXJsXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTsgICAgICAgICAgIFxcbiAgICAgICAgfSAgICAgICAgIFxcbiAgICAgICAgdGVzdCh1cmwsIGh0bWwsIGQsIG9sZCwga2V5LCBydWxlKTtcXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIC8v6Ieq5Yqo6K+G5YircG9zdOivt+axglxcbiAgICAgICAgaHRtbCA9IHJlcXVlc3QodXJsKTtcXG4gICAgICAgIGxldCBmb3JtID0gcGRmaChodG1sLCBcXFwiYm9keSYmZm9ybSYmSHRtbFxcXCIpO1xcbiAgICAgICAgbGV0IGFjdGlvbiA9IHBkKGh0bWwsIFxcXCJmb3JtJiZhY3Rpb25cXFwiLCB1cmwpO1xcbiAgICAgICAgbGV0IGlucHV0cyA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJmZvcm0mJmlucHV0XFxcIik7XFxuICAgICAgICBsZXQgYm9keSA9IHt9O1xcbiAgICAgICAgZm9yIChsZXQgaXQgb2YgaW5wdXRzKSB7XFxuICAgICAgICAgICAgbGV0IG5hbWUgPSBwZGZoKGl0LCBcXFwiaW5wdXQmJm5hbWVcXFwiKTtcXG4gICAgICAgICAgICBpZiAobmFtZSAmJiBuYW1lICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGxldCB2YWx1ZSA9IHBkZmgoaXQsIFxcXCJpbnB1dCYmdmFsdWVcXFwiKTtcXG4gICAgICAgICAgICAgICAgYm9keVtuYW1lXSA9IHZhbHVlIHx8IGtleTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBodG1sID0gcG9zdChhY3Rpb24sIHtcXG4gICAgICAgICAgICBib2R5OiBib2R5XFxuICAgICAgICB9KTtcXG4gICAgfVxcblxcbiAgICBsZXQgYWxpc3QgPSBwZGZhKGh0bWwsIFxcXCJib2R5JiZhXFxcIik7XFxuICAgIGxldCBhcnIgPSBhbGlzdC5tYXAoaXQgPT4ge1xcbiAgICAgICAgbGV0IHQgPSBwZGZoKGl0LCBcXFwiYSYmVGV4dFxcXCIpO1xcbiAgICAgICAgbGV0IHQyID0gcGRmaChpdCwgXFxcImEmJnRpdGxlXFxcIik7XFxuICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgIC8vaHRtbDogaXQsXFxuICAgICAgICAgICAgdGV4dDogdDIgJiYgdDIuaW5jbHVkZXMoa2V5KSA/IHQyIDogdCxcXG4gICAgICAgICAgICBocmVmOiBwZChpdCwgXFxcImEmJmhyZWZcXFwiLCB1cmwpXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbiAgICBmdW5jdGlvbiBpc1Jlc3VsdChpdCkge1xcbiAgICAgICAgaXQgPSBpdC50ZXh0IHx8IFxcXCJcXFwiO1xcbiAgICAgICAgaWYgKGl0ID09IFxcXCJcXFwiIHx8IGl0Lm1hdGNoKC/mkJzntKJ857uT5p6cLykpIHtcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2VcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBpdC5pbmNsdWRlcyhrZXkpO1xcbiAgICB9XFxuXFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICBsZXQgdCA9IGl0LnRleHQ7XFxuICAgICAgICBpZiAoIWl0LmhyZWYgfHwgaXQuaHJlZiA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgf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CIgPyBcXFwi6KeG6aKR5ZeF5o6iXFxcIiA6IFxcXCJXZWLpgJrlhY1cXFwiLFxcbiAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBpZiAoZ2V0SXRlbSgnd2ViJywgJzAnKSA9PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbSgnd2ViJywgJzEnKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oJ3dlYicsICcwJylcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiXFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCIgKyBcXFwiLFxcbiAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChycikgPT4ge1xcbiAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhcXFwiYWlhZGRcXFwiKTtcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIocnIgKyBcXFwiYWlzZGVsXFxcIiwgW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXnvZHnq5nlkI3np7BcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignbmFtZScsIGlucHV0KVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBcXFwiYWlhZGRcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXnvZHnq5nmkJzntKLlnLDlnYBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc3VybCcsIGlucHV0KVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBcXFwiYWlhZGRcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5o+Q5Lqk5L+d5a2YXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdXJsID0gZ2V0TXlWYXIoXFxcInN1cmxcXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5hbWUgPSBnZXRNeVZhcihcXFwibmFtZVxcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3VybCA9PSBcXFwiXFxcIiB8fCBuYW1lID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/or7fovpPlhaXlrozmlbTlhoXlrrlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByID0gZGVjb2RlVVJJQ29tcG9uZW50KHN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHIgPSByLnJlcGxhY2UobmV3IFJlZ0V4cChcXFwiW1xcXFx1NGUwMC1cXFxcdTlmYTVdK1xcXCIsIFxcXCJnXFxcIiksIFxcXCIqKlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZFJ1bGVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZGF0YVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZFJ1bGUobmFtZSwgcik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey5L+d5a2YXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbHM6IFxcXCJhaWFkZFxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIF0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgIH0sIE1ZX1JVTEUudGl0bGUpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJmbGV4X2J1dHRvblxcXCIsXFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCIgLSBcXFwiLFxcbiAgICAgICAgdXJsOiBcXFwic2VsZWN0Oi8vXFxcIiArIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICBvcHRpb25zOiBuYW1lcyxcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuivt+mAieaLqeimgeWIoOmZpOeahOermeeCuVxcXCIsXFxuICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQge1xcbiAgICAgICAgICAgICAgICAgICAgcmVtb3ZlUnVsZVxcbiAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZGF0YVxcXCIpO1xcbiAgICAgICAgICAgICAgICByZW1vdmVSdWxlKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL09LXFxcIjtcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IE1ZX1JVTEUudGl0bGUgKyBcXFwiYWlzZGVsXFxcIlxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgIH0pO1xcblxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIumqjOivgeeggVwiLFwicGF0aFwiOlwieXptXCIsXCJydWxlXCI6XCJmdW5jdGlvbiBjaGVjayh1cmwsIGh0bWwsIGQpIHtcXG4gICAgbGV0IHJlbG9hZCA9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1ZX0hPTUUgKyBodG1sLm1hdGNoKC9cXFxcL2luZGV4LnBocC4qP3ZlcmlmeT0vKVswXSArIEpTT04ucGFyc2UodmNvZGUpLnJldCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmVsb2FkID0gdHJ1ZTtcXG4gICAgfVxcbiAgICByZXR1cm4gcmVsb2FkO1xcbn1cXG5cXG5mdW5jdGlvbiB0ZXN0KHVybCwgaHRtbCwgZCwgb2xkLCBrZXksIHJ1bGUpIHtcXG4gICAgaWYgKC8156eSfOmikee5gS8udGVzdChodG1sKSkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+aQnOe0oumcgOmXtOmalDXnp5LvvIzngrnlh7vph43mlrDliqDovb0nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+XFxcIiArIHJ1bGUgKyBcXFwiPC9mb250PlxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKHVybCwgb2xkLCBrZXksIHJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHNwID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2Uvc3BcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IGQgPSBzcChvbGQsIGtleSwgcnVsZSk7XFxuICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICB3cmFwXFxuICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS90b29sXFxcIik7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIGQpIHtcXG4gICAgICAgICAgICAgICAgIC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pdC5ocmVmLFxcXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLm00YScsICcubXAzJywgJy5mbHYnLCAnLmF2aScsICcuM2dwJywgJy5tcGVnJywgJy53bXYnLCAnLm1vdicsICcucm12YicsICcuZ2lmJywgJy5qcGVnJywgJy5wbmcnLCAnLmljbycsICcuc3ZnJ11cXFxcbiAgICAgICAgICAgIH07XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICB2YXIgdXJseCA9IFxcXFxcXFwidmlkZW86Ly9cXFxcXFxcIiArIGl0LmhyZWY7XFxcXG4gICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xcXFxuICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmXFxcXG4gICAgICAgICAgICB9O1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogdCxcXFxcbiAgICAgICAgICAgIHVybDogdXJseCxcXFxcbiAgICAgICAgICAgIHBoOiB0ICsgXFxcXFxcXCIkXFxcXFxcXCIgKyBpdC5ocmVmLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8zXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYTogZXh0cmF4XFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcbn1cXFxcbmlmIChkLmxlbmd0aCA9PSAwKSB7XFxcXG4gICAgLy/ljLnphY3lpLHotKVcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgIGNvbF90eXBlOiBcXFxcXFxcIng1X3dlYnZpZXdfc2luZ2xlXFxcXFxcXCIsXFxcXG4gICAgICAgIGRlc2M6IFxcXFxcXFwiZmxvYXQmJjEwMCVcXFxcXFxcIixcXFxcbiAgICAgICAgcGljX3VybDogXFxcXFxcX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ApIHtcXFxcbiAgICAgICAgLy/lpJrnur/nqIvliqDovb0gICAgICAgIFxcXFxuICAgICAgICBsZXQgcmVhbFBhZ2UgPSBcXFxcXFxcIlxcXFxcXFwiID09IHIgPyAxIDogcDtcXFxcbiAgICAgICAgbGV0IHRhc2tzID0gZGF0YS5tYXAoaXQgPT4ge1xcXFxuICAgICAgICAgICAgcmV0dXJuIHtcXFxcbiAgICAgICAgICAgICAgICBmdW5jOiBmdW5jdGlvbihydWxlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmZpbmQocywgcmVhbFBhZ2UpO1xcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgcGFyYW06IGl0LFxcXFxuICAgICAgICAgICAgICAgIGlkOiBcXFxcXFxcInJ1bGVAXFxcXFxcXCIgKyBpdC5uYW1lXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuXFxcXG4gICAgICAgIGJhdGNoRXhlY3V0ZSh0YXNrcywge1xcXFxuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxcXG4gICAgICAgICAgICAgICAgLy9sb2coXFxcXFxcXCJsaXN0ZW5lcjogXFxcXFxcXCIgKyAocmVzdWx0IHx8IFtdKS5sZW5ndGgpXFxcXG4gICAgICAgICAgICAgICAgcGFyYW0uaSA9IHBhcmFtLmkgKyAxO1xcXFxuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIHJlc3VsdCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLmogPSBwYXJhbS5qICsgMTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogd3JhcChpdC50aXRsZSwgcyksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGl0LmRlc2MsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaXQudXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC5waWNfdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQucGljX3VybCA/ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycgOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogaXQuZXh0cmFcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWKoOi9veesrFxcXFxcXFwiICsgTVlfUEFHRSArIFxcXFxcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcXFxcXCIgKyAocGFyYW0uaSArIDEpICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBwYXJhbS5hbGwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICBwYXJhbToge1xcXFxuICAgICAgICAgICAgICAgIGFsbDogZGF0YS5sZW5ndGgsXFxcXG4gICAgICAgICAgICAgICAgaTogMCxcXFxcbiAgICAgICAgICAgICAgICBqOiAtMVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcbn0gZWxzZSB7XFxcXG4gICAgbGV0IHtcXFxcbiAgICAgICAgbG9hZFxcXFxuICAgIH0gPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvZGF0YVxcXFxcXFwiKTtcXFxcbiAgICBsZXQgZGF0YSA9IGxvYWQoLTEsIG51bGwpO1xcXFxuICAgIGlmIChkYXRhLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL21hbmFnZVxcXFxcXFwiKShkLCBkYXRhLm1hcChpdCA9PiBpdC5uYW1lKSk7XFxcXG4gICAgICAgIGZvciAobGV0IGl0IG9mIGRhdGEpIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0Lm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcInNlbGVjdDovL1xcXFxcXFwiICsgSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLor7fpgInmi6nmk43kvZxcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sOiAxLFxcXFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiBbXFxcXFxcXCLorr/pl67pppbpobVcXFxcXFxcIiwgXFxcXFxcXCLmkJzntKLmraTnq5lcXFxcXFxcIl0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFxcXFxcIuiuv+mXrummlumhtVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVlfVVJMID0gdXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcIng1Oi8vXFxcXFxcXCIgKyBnZXRIb21lKHVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9wYWdlL3NpbmdsZXNcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBpdC51cmwpXFxcXG4gICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiZmxleF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcb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FxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXFxcXFwicHV0TXlWYXIoJ25hbWUnLCBpbnB1dClcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogXFxcXFxcXCJhaWFkZFxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi6K+36L6T5YWl572R56uZ5pCc57Si5Zyw5Z2AXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImlucHV0XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXFxcXFwicHV0TXlWYXIoJ3N1cmwnLCBpbnB1dClcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogXFxcXFxcXCJhaWFkZFxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5o+Q5Lqk5L+d5a2YXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN1cmwgPSBnZXRNeVZhcihcXFxcXFxcInN1cmxcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmFtZSA9IGdldE15VmFyKFxcXFxcXFwibmFtZVxcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdXJsID09IFxcXFxcXFwiXFxcXFxcXCIgfHwgbmFtZSA9PSBcXFxcXFxcIlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/or7fovpPlhaXlrozmlbTlhoXlrrlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHIgPSBkZWNvZGVVUklDb21wb25lbnQoc3VybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByID0gci5yZXBsYWNlKG5ldyBSZWdFeHAoXFxcXFxcXCJbXFxcXFxcXFx1NGUwMC1cXFxcXFxcXHU5ZmE1XStcXFxcXFxcIiwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIioqXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRSdWxlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2RhdGFcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRSdWxlKG5hbWUsIHIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5bey5L+d5a2YXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBcXFxcXFxcImFpYWRkXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIF0pO1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgIH0sIE1ZX1JVTEUudGl0bGUpLFxcXFxuICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJmbGV4X2J1dHRvblxcXFxcXFwiLFxcXFxuICAgIH0pO1xcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOiBcXFxcXFxcIiAtIFxcXFxcXFwiLFxcXFxuICAgICAgICB1cmw6IFxcXFxcXFwic2VsZWN0Oi8vXFxcXFxcXCIgKyBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICBvcHRpb25zOiBuYW1lcyxcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuivt+mAieaLqeimgeWIoOmZpOeahOermeeCuVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZVJ1bGVcXFxcbiAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2RhdGFcXFxcXFxcIik7XFxcXG4gICAg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