Advertisement
xiaomianao666

邀您一起看:流浪地球-HD高清

Jun 3rd, 2023
1,065
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥流浪地球-HD高清@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS6jOe6p+ino+aekFwiLFwicGF0aFwiOlwicFwiLFwicnVsZVwiOlwianM6XFxuYWRkTGlzdGVuZXIoXFxcIm9uQ2xvc2VcXFwiLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgdXBkYXRlSXRlbSgncGFyc2V0Jywge1xcbiAgICAgICAgdGl0bGU6IGdldEl0ZW0oJ+WXheaOoicsICfop4bpopHll4XmjqInKSwgICAgICAgIFxcbiAgICB9KTtcXG4gICAgY2xlYXJNeVZhcignd2VidXJsJyk7XFxuICAgIHB1dE15VmFyKCdibScsICcwJyk7XFxuICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJkdW9zZWxlY3RcXFwiLFtdKTtcXG4gICAgLy9iYWNrKGZhbHNlKVxcbn0pKTtcXG5cXG52YXIgQml0VFMgPSBbXTtcXG5cXG4vL3B1dE15VmFyKFxcXCJtdWJhblxcXCIsIHvlkI3np7A6J+aegeWuouW9seinhid9KVxcblxcbmV2YWw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IiQxXFxcIj48L2E+Jyk7XFxuICAgICAgICB1cmwgPSBwZCh0ZSwgXFxcImEmJmhyZWZcXFwiKTtcXG4gICAgICAgIGxvZygnanPph43lrprlkJE6JyArIHVybCk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBodG1sID0gdGVtcDtcXG4gICAgfVxcblxcbiAgICBwdXRNeVZhcignd2VidXJsJywgdXJsKTtcXG5cXG59IGVsc2Uge1xcbiAgICB1cmwgPSBnZXRNeVZhcignd2VidXJsJyk7XFxufVxcbnZhciBkdXJsID0gdXJsO1xcbmxvZygn5LqM57qn6aG16Z2iOicgKyBkdXJsKTtcXG5cXG5pZiAoZ2V0SXRlbSgnYWknLCAnMCcpID09ICcxJykge1xcbiAgICB2YXIgbGF6eSA9ICQoJycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKHJlcXVlc3QoaW5wdXQpLm1hdGNoKC9yIHBsYXllcl8uKj89KC4qPyk8LylbMV0pXFxuICAgICAgICAgICAgdmFyIHVybCA9IGh0bWwudXJsXFxuICAgICAgICAgICAgaWYgKGh0bWwuZW5jcnlwdCA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdW5lc2NhcGUodXJsKTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuZW5jcnlwdCA9PSAnMicpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdW5lc2NhcGUoYmFzZTY0RGVjb2RlKHVybCkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoL20zdTh8bXA0Ly50ZXN0KHVybCkpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVybFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndmlkZW86Ly8nICsgaW5wdXRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKS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JcXFwiKTtcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBpc01vdmllKGl0KSB7XFxuICAgICAgICBpZiAoaXQgPT0gbnVsbCB8fCBpdC50ZXh0ID09IG51bGwpIHtcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAobm9maWxlKGl0KSkge1xcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCB0aXQgPSBpdC50aXRsZSB8fCBcXFwiXFxcIjtcXG4gICAgICAgIGl0ID0gaXQudGV4dCB8fCBcXFwiXFxcIjtcXG4gICAgICAgIGlmIChpdCA9PSBcXFwiXFxcIiB8fCBpdC5sZW5ndGggPiA4KSB7XFxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy/mjpLpmaRcXG4gICAgICAgIGxldCByZWcgPSAvXFxcXC586auY5riF55u05pKtfOWGmeecn+aOqOiNkHzlvbHpmaJ85b2x6KeGfOiTneWFieeUteW9sXzpq5jmuIXnlLXlvbF856ys5LiA5a2jfOesrOS6jOWto3znrKzkuInlraN856ys5Zub5a2jfOesrOS6lOWtoy87XFxuICAgICAgICBpZiAodGl0ICE9IFxcXCJcXFwiICYmICF0aXQuaW5jbHVkZXMoaXQpIHx8IHJlZy50ZXN0KGl0KSkge1xcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBpdC5tYXRjaCgv5Y6f55S7fOWkh+eUqHzok53lhYl86LaF5riFfOmrmOa4hXzmraPniYd86Z+p54mIfDRLfDRrfDEwODBQfDcyMFB8VEN8SER8QkR85Lit5a2XLylcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBub3RDaGFwdGVyKGl0KSB7XFxuICAgICAgICBpZiAoaXQgPT0gbnVsbCB8fCBpdC50ZXh0ID09IG51bGwpIHtcXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBpdC50ZXh0Lm1hdGNoKC9bMC05XVxcXFwuWzAtOV3liIYvKTtcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBpc0NoYXB0ZXIoaXQsIHByZSwgbmV4dCkge1xcbiAgICAgICAgaWYgKG5vdENoYXB0ZXIoaXQpKSB7XFxuICAgICAgICAgICAgLy/kvJjlhYjmjpLpmaRcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9XFxuICAgICAgICAvL+WIpOaWreaYr+S4jeaYr+eUteW9sVxcbiAgICAgICAgaWYgKGlzTW92aWUoaXQpKSB7XFxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gaXNDaGFwdGVyMChpdCwgcHJlKSB8fCBpc0NoYXB0ZXIwKGl0LCBuZXh0KTtcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBnZXRDaGFwdGVyTnVtKGl0KSB7XFxuICAgICAgICBpZiAoaXQgPT0gbnVsbCB8fCBpdC50ZXh0ID09IG51bGwpIHtcXG4gICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICB9XFxuICAgICAgICBpdCA9IGl0LnRleHQgfHwgXFxcIlxcXCI7XFxuICAgICAgICBpZiAoaXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICB9XFxuICAgICAgICBpdCA9IGNsZWFyVGV4dChpdCk7XFxuICAgICAgICBsZXQgcmVnID0gL15bMC05XSokLztcXG4gICAgICAgIGlmICghcmVnLnRlc3QoaXQpKSB7XFxuICAgICAgICAgICAgcmV0dXJuIC0xO1xcbiAgICAgICAgfVxcbiAgICAgICAgaXQgPSBwYXJzZUludChpdCk7XFxuICAgICAgICBpZiAoaXNOYU4oaXQpKSB7XFxuICAgICAgICAgICAgcmV0dXJuIC0xO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGl0ID4gMTkwMCAmJiBpdCA8IDIxMDApIHtcXG4gICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gaXQ7XFxuICAgIH1cXG5cXG4gICAgZnVuY3Rpb24gaXNDaGFwdGVyMChpdCwgYnJvdGhlcikge1xcbiAgICAgICAgLyppZiAoZGVidWcpIHtcXG4gICAgICAgICAgICBsb2coe1xcbiAgICAgICAgICAgICAgICBpdDogaXQsXFxuICAgICAgICAgICAgICAgIGJyb3RoZXI6IGJyb3RoZXJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0qL1xcbiAgICAgICAgaXQgPSBnZXRDaGFwdGVyTnVtKGl0KTtcXG4gICAgICAgIC8vaWYgKGRlYnVnKSBsb2coaXQpO1xcbiAgICAgICAgaWYgKGl0IDwgMCkge1xcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgIH1cXG4gICAgICAgIGJyb3RoZXIgPSBnZXRDaGFwdGVyTnVtKGJyb3RoZXIpO1xcbiAgICAgICAgLy9pZiAoZGVidWcpIGxvZyhicm90aGVyKTtcXG4gICAgICAgIGlmIChicm90aGVyIDwgMCkge1xcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBpdCAtIGJyb3RoZXIgPCAyICYmIGl0IC0gYnJvdGhlciA+IC0yO1xcbiAgICB9XFxuXFxuICAgIGxldCB0ZnB1c2ggPSBnZXRJdGVtKCd3ZWJwdXNoJywgJzAnKTtcXG5cXG4gICAgbGV0IF93ZWIgPSAkLnRvU3RyaW5nKCh0ZnB1c2gpID0+IHtcXG4gICAgICAgIGxldCB1cmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgIGxldCByZWcgPSAvXFxcXC5odG1sfFxcXFwuY3NzfFxcXFwuanMvO1xcbiAgICAgICAgZm9yIChsZXQgayBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgaWYgKCFyZWcudGVzdCh1cmxzW2tdKSAmJiB1cmxzW2tdLm1hdGNoKC9cXFxcLm1wNHxcXFxcLm0zdTgvKSkge1xcbiAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLmxvZyh1cmxzW2tdKTtcXG4gICAgICAgICAgICAgICAgLy9yZXR1cm4gZnlfYnJpZGdlX2FwcC5nZXRIZWFkZXJVcmwodXJsc1trXS5yZXBsYWNlKC8uKj91cmw9LywgXFxcIlxcXCIpKSArIFxcXCIjaWdub3JlSW1nPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgaWYgKHRmcHVzaCA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmeV9icmlkZ2VfYXBwLmdldEhlYWRlclVybCh1cmxzW2tdLnJlcGxhY2UoLy4qP3VybD0vLCBcXFwiXFxcIikpICsgXFxcIiNpZ25vcmVJbWc9dHJ1ZSNcXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXkgPSBmeV9icmlkZ2VfYXBwLmdldEhlYWRlclVybCh1cmxzW2tdLnJlcGxhY2UoLy4qP3VybD0vLCBcXFwiXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD9wdXNodXJsPScgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogZG9jdW1lbnQudGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IHBsYXlcXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSwgdGZwdXNoKTtcXG5cXG4gICAgZnVuY3Rpb24gX193ZWIobW9kZSkge1xcbiAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHRmcHVzaCkgPT4ge1xcbiAgICAgICAgICAgIGxldCB1cmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgICAgICBsZXQgcmVnID0gL1xcXFwuaHRtbHxcXFxcLmNzc3xcXFxcLmpzLztcXG4gICAgICAgICAgICBmb3IgKGxldCBrIGluIHVybHMpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCFyZWcudGVzdCh1cmxzW2tdKSAmJiB1cmxzW2tdLm1hdGNoKC9cXFxcLm1wNHxcXFxcLm0zdTgvKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5sb2codXJsc1trXSk7XFxuICAgICAgICAgICAgICAgICAgICAvL3JldHVybiBmeV9icmlkZ2VfYXBwLmdldEhlYWRlclVybCh1cmxzW2tdLnJlcGxhY2UoLy4qP3VybD0vLCBcXFwiXFxcIikpICsgXFxcIiNpZ25vcmVJbWc9dHJ1ZSNcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRmcHVzaCA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnlfYnJpZGdlX2FwcC5nZXRIZWFkZXJVcmwodXJsc1trXS5yZXBsYWNlKC8uKj91cmw9LywgXFxcIlxcXCIpKSArIFxcXCIjaWdub3JlSW1nPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXkgPSBmeV9icmlkZ2VfYXBwLmdldEhlYWRlclVybCh1cmxzW2tdLnJlcGxhY2UoLy4qP3VybD0vLCBcXFwiXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/cHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBkb2N1bWVudC50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IHBsYXlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCBtb2RlKTtcXG4gICAgfVxcblxcbiAgICAkLmV4dGVuZCh7XFxuICAgICAgICBsd2ViOiBfX3dlYlxcbiAgICB9KVxcblxcbiAgICBsZXQgd2ViID0gZ2V0SXRlbSgnd2ViJywgJzAnKTtcXG4gICAgdmFyIHB1c2h0eXBlID0gWyfliJfooagnLCAn5Y2V6ZuGJ11cXG4gICAgdmFyIHBhcnNldHlwZSA9IFsnV2Vi5ZeF5o6iOjAnLCAn6KeG6aKR5ZeF5o6iOjEnLCAnZG3nm5LlrZA6MiddXFxuICAgIGxvZygn5o6o6YCB57G75Z6LOicgKyBwdXNodHlwZVtwYXJzZUludCh0ZnB1c2gpXSlcXG4gICAgbG9nKCfll4XmjqLnsbvlnos6JyArIHBhcnNldHlwZVtwYXJzZUludCh3ZWIpXS5zcGxpdCgnOicpWzBdKVxcblxcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcbiAgICAgICAgbGV0IHQgPSBpdC50ZXh0O1xcbiAgICAgICAgaWYgKCFpdC5ocmVmIHx8IGl0LmhyZWYgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBwcmUgPSBpID09IDAgPyBudWxsIDogYXJyW2kgLSAxXTtcXG4gICAgICAgIGxldCBuZXh0ID0gaSA9PSAoYXJyLmxlbmd0aCAtIDEpID8gbnVsbCA6IGFycltpICsgMV07XFxuICAgICAgICBpZiAoaXNDaGFwdGVyKGl0LCBwcmUsIG5leHQpKSB7XFxuICAgICAgICAgICAgaWYgKHRmcHVzaCA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgLyp2YXIgdXJseCA9IFxcXCJ3ZWJSdWxlOi8vXFxcIiArIGl0LmhyZWYgKyBcXFwiQFxcXCIgKyBfd2ViO1xcbiAgICAgICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAganNMb2FkaW5nSW5qZWN0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWYsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5cycsXFxuICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5tNGEnLCAnLm1wMycsICcuZmx2JywgJy5hdmknLCAnLjNncCcsICcubXBlZycsICcud212JywgJy5tb3YnLCAnLnJtdmInLCAnLmdpZicsICcuanBlZycsICcucG5nJywgJy5pY28nLCAnLnN2ZyddXFxuICAgICAgICAgICAgICAgIH07Ki9cXG4gICAgICAgICAgICAgICAgdmFyIHVybHggPSAnaGlrZXI6Ly9wYWdlL3B1c2g/JnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGdldFBhZ2VUaXRsZSgpLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IGl0LnRleHQgKyAnJCcgKyBpdC5ocmVmLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImNvbnRlbnRcXFwiOiBNWV9VUkwudGl0bGUsXFxuICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgdmFyIGV4dHJheCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmLFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmICh3ZWIgPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdXJseCA9IFxcXCJ3ZWJSdWxlOi8vXFxcIiArIGl0LmhyZWYgKyBcXFwiQFxcXCIgKyBfd2ViO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGV4dHJheCA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqc0xvYWRpbmdJbmplY3Q6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWYsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLm00YScsICcubXAzJywgJy5mbHYnLCAnLmF2aScsICcuM2dwJywgJy5tcGVnJywgJy53bXYnLCAnLm1vdicsICcucm12YicsICcuZ2lmJywgJy5qcGVnJywgJy5wbmcnLCAnLmljbycsICcuc3ZnJ11cXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2ViID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybHggPSBcXFwidmlkZW86Ly9cXFwiICsgaXQuaHJlZjtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBleHRyYXggPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWYsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3ZWIgPT0gJzInKSB7XFxuICAgICAgICAgICAgICAgICAgICBsYXp5ID0gJCgnJykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9sYXp5VG9YNT9ydWxlPWRt55uS5a2QJykudmlkZW9YNSgpO1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHZhciB1cmx4ID0gaXQuaHJlZiArIGxhenlcXG4gICAgICAgICAgICAgICAgICAgIHZhciBleHRyYXggPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWYsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdCxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmx4LFxcbiAgICAgICAgICAgICAgICBwaDogdCArIFxcXCIkXFxcIiArIGl0LmhyZWYsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJheFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGlmIChkLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAvL+WMuemFjeWksei0pVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ4NV93ZWJ2aWV3X3NpbmdsZVxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcImZsb2F0JiYxMDAlXFxcIixcXG4gICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBmbG9hdFZpZGVvOiB0cnVlLFxcbiAgICAgICAgICAgICAgICBjYW5CYWNrOiB0cnVlLFxcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbXFxcIi5naWZcXFwiLCBcXFwiL2FkL1xcXCIsIFxcXCJnb29nbGVcXFwiLCBcXFwiL3NoL3RvL1xcXCIsIFxcXCIuR0lGXFxcIl1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIHRvYXN0KFxcXCJBSeWMuemFjeWksei0pe+8jOW3suS9v+eUqFg15Yqg6L29XFxcIik7XFxuICAgICAgICBsb2coXFxcIuW9k+WJjemhtemdouWcsOWdgDogXFxcIiArIHVybClcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIC8v5Li657q/6Lev5Yqg5YiG5Ymy57q/XFxuICAgICAgICBsZXQgZDIgPSBbXTtcXG4gICAgICAgIGxldCBtdGFiID0gW107XFxuXFxuICAgICAgICBkID0gdW5pcXVlKGQpXFxuICAgICAgICAvL2xvZyhCaXRUUylcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGQyLnB1c2goZFtpXSk7XFxuICAgICAgICAgICAgbXRhYi5wdXNoKGRbaV0ucGgpO1xcbiAgICAgICAgICAgIGlmIChpIDwgZC5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGRbaV07XFxuICAgICAgICAgICAgICAgIGxldCB0MSA9IHBhcnNlSW50KGNsZWFyVGV4dChpdC50aXRsZSkpO1xcbiAgICAgICAgICAgICAgICBsZXQgbmV4dCA9IGRbaSArIDFdO1xcbiAgICAgICAgICAgICAgICBsZXQgdDIgPSBwYXJzZUludChjbGVhclRleHQobmV4dC50aXRsZSkpO1xcbiAgICAgICAgICAgICAgICBpZiAodDIgLSB0MSA+IDEgfHwgdDEgLSB0MiA+IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIG10YWIucHVzaCgnIycpO1xcbiAgICAgICAgICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGxldCBwbGF5bCA9IG10YWIuam9pbignIycpLnJlcGxhY2UoLyMjIy9nLCAnJCQkJCQkJyk7XFxuXFxuXFxuICAgICAgICBsZXQgZnJvbSA9IFtdO1xcbiAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBwbGF5bC5zcGxpdCgnJCQkJykubGVuZ3RoOyBqKyspIHtcXG4gICAgICAgICAgICBmcm9tLnB1c2goXFxcIuaSreaUvuWIl+ihqFxcXCIgKyBbaiArIDFdKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBwdXNoID0gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogZ2V0UGFnZVRpdGxlKCksXFxuICAgICAgICAgICAgXFxcImZyb21cXFwiOiBmcm9tLmpvaW4oJyQkJCcpLFxcbiAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBwbGF5bC5yZXBsYWNlKC9cXFxcJi9nLCAn77yG77yGJyksXFxuICAgICAgICAgICAgXFxcImNvbnRlbnRcXFwiOiBNWV9SVUxFLnRpdGxlXFxuICAgICAgICB9KTtcXG4gICAgICAgIC8vbG9nKHB1c2gpO1xcbiAgICAgICAgXFxuICAgICAgICB2YXIgdGNvbmZpZz17XFxuICAgICAgICAgICAgbmFtZTpnZXRQYWdlVGl0bGUoKSxcXG4gICAgICAgICAgICBjb250ZW50Ok1ZX1JVTEUudGl0bGVcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGQyLnVuc2hpZnQoe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5o6o6YCB5pys6aG1PT5UVkJveFxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKHB1c2gpLmxhenlSdWxlKCh0Y29uZmlnKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBkbGlzdCA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJkdW9zZWxlY3RcXFwiKTtcXG4gICAgICAgICAgICAgICAgaWYoZGxpc3QubGVuZ3RoPjApe1xcbiAgICAgICAgICAgICAgICB2YXIgcGxheXM9ZGxpc3QubWFwKHg9PngudGl0bGUrXFxcIiRcXFwiK3gudXJsKS5qb2luKFxcXCIjXFxcIik7XFxuICAgICAgICAgICAgICAgIHZhciBkcHVzaCA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogdGNvbmZpZy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImZyb21cXFwiOiBcXFwi5pKt5pS+5YiX6KGoXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBwbGF5cyxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJjb250ZW50XFxcIjogdGNvbmZpZy5jb250ZW50XFxuICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgIC8vbG9nKGRwdXNoKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3B1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChkcHVzaCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/cHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KGlucHV0KTtcXG4gICAgICAgICAgICB9LHRjb25maWcpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgICAgICBpZDoncHVzaHMnLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgXFxuICAgICAgICBcXG4gICAgICAgIGQyLnVuc2hpZnQoe1xcbiAgICB0aXRsZTogJ+mAieaOqCcsXFxuICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICBzZXRJdGVtKCd3ZWJwdXNoJywnMCcpO1xcbiAgICAgICAgXFxuICAgICAgICB1cGRhdGVJdGVtKCdzcHVzaCcsIHtcXG4gICAgICAgICAgICB0aXRsZTogJ+WNleaOqCcsXFxuICAgICAgICB9KTtcXG4gICAgICAgIFxcbiAgICAgICAgaWYgKGZpbmRJdGVtKCdkc2VsZWN0JykuZXh0cmEubW9kZSA9PSAnb3BlbicpIHtcXG4gICAgICAgICAgICB0b2FzdCgn6YCJ5o6o5qih5byP5YWz6ZetJyk7XFxuICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcImR1b3NlbGVjdFxcXCIsIFtdKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9XFxuXFxuICAgICAgICBsZXQgSWRzID0gKGZpbmRJdGVtc0J5Q2xzKCdwbGF5cycpKS5tYXAoaXQgPT4gaXQuZXh0cmEuaWQpO1xcbiAgICAgICAgS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2xzLm1hcCgoaXQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpdC5zcGxpdCgnOicpWzBdID09PSBjb2wgPyAn4p6h77iPJyArIGl0IDogaXQ7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBsZXQgdGlwcyA9ICfor7fpgInmi6nll4XmjqLmqKHlvI8nO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJCjll4XmjqIsIDEsIHRpcHMpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0LnJlcGxhY2UoL+Keoe+4jy9nLCAnJyk7XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCfll4XmjqInLCBpbnB1dC5zcGxpdCgnOicpWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBtb2RlID0gaW5wdXQuc3BsaXQoJzonKVsxXVxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnd2ViJywgbW9kZSlcXG4gICAgICAgICAgICAgICAgICAgIGxldCBvbGRJZHMgPSAoZmluZEl0ZW1zQnlDbHMoJ3BsYXlzJykpLm1hcChpdCA9PiBpdC5leHRyYS5pZCk7XFxuICAgICAgICAgICAgICAgICAgICBvbGRJZHMuZm9yRWFjaCh4ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW9kZSA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJ3ZWJSdWxlOi8vXFxcIiArIHggKyBcXFwiQFxcXCIgKyAkLmx3ZWIoJzAnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNMb2FkaW5nSW5qZWN0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlzJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5tNGEnLCAnLm1wMycsICcuZmx2JywgJy5hdmknLCAnLjNncCcsICcubXBlZycsICcud212JywgJy5tb3YnLCAnLnJtdmInLCAnLmdpZicsICcuanBlZycsICcucG5nJywgJy5pY28nLCAnLnN2ZyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW9kZSA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJ2aWRlbzovL1xcXCIgKyB4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogeCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5cycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW9kZSA9PSAnMicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHggKyAkKCcnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2xhenlUb1g1P3J1bGU9ZG3nm5LlrZAnKS52aWRlb1g1KCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgncGFyc2UnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHN0b3JhZ2UwLmdldEl0ZW0oJ+WXheaOoicsICdXZWLll4XmjqInKSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+W3suWIh+WXheaOouaWueW8j+S4ujonICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgcGFyc2V0eXBlKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogJ3BhcnNlJyxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGQyLnVuc2hpZnQoe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPHNtYWxsPuKaoe+4jycgKyBkdXJsICsgJzwvc21hbGw+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgIHVybDogZHVybCxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgXFxuICAgICAgICBcXG4gICAgICAgIGlmKE1ZX1BBUkFNUy53ZWI9PVxcXCLlk5Tmu7TlvbHop4ZcXFwiKXtcXG4gICAgICAgICAgICBkMi51bnNoaWZ0KHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6J+WTlOa7tOW9seinhicsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgICAgIHVybDpcXFwiaGlrZXI6Ly9wYWdlL2RldGFpbHM/cnVsZT3lk5TlmIDlvbHop4YmdXJsPVxcXCIgKyBkdXJsKycjaW1tZXJzaXZlVGhlbWUjJyxcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHZhciBqc3I9SlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9ob21lQOWTlOWYgOW9seinhlxcXCIpKS5wcmVSdWxlXFxuICAgICAgICAgICAgZXZhbChqc3IpXFxuICAgICAgICB9XFxuICAgICAgICBcXG4gICAgICAgIFxcbiAgICAgICAgXFxuICAgICAgICB2YXIgZDMgPSBbXTtcXG5pZiAoZ2V0SXRlbSgnYWknLCAnMCcpID09ICcxJykge1xcblxcbiAgICBkMy5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBnZXRQYWdlVGl0bGUoKSxcXG4gICAgICAgIGltZzogJ2h0dHBzOi8vcGljMy41OGNkbi5jb20uY24vbm93YXRlci93ZWJpbS9iaWcvbl92MjgxZDYwYmQxMjdlODRjZDI4ODA3ZDUxMTQzZWFhNjFmLmdpZicsXFxuICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljX2JsdXInLFxcbiAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgIGlkOidkMycsXFxuICAgICAgICB9XFxuICAgIH0pXFxuICAgIHNldF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gICAgICAgICAgYnJlYWs7XFxuICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICB0aXRsZSA9ICdkbeebkuWtkCdcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgfVxcbiAgICBzZXRJdGVtKCfll4XmjqInLCB0aXRsZSlcXG5cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn5o6o6YCBJyxcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9zZXR0aW5nXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxuICAgIH0sIHtcXG4gICAgICAgIHRpdGxlOiBcXFwi6aG16Z2i5Yqg6L29OlxcXCIgKyBnZXRJdGVtKCdob21lJywgJ+WFsycpLFxcbiAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGdldEl0ZW0oJ2hvbWUnLCAn5YWzJykgPT0gJ+WFsycpIHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbSgnaG9tZScsICflvIAnKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oJ2hvbWUnLCAn5YWzJylcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJmbGV4X2J1dHRvblxcXCJcXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICB2YXIgd2ViID0gZ2V0SXRlbSgnd2ViJywgJzAnKVxcbiAgICAgICAgICAgIHN3aXRjaCAod2ViKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgnd2ViJywgJzEnKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgnd2ViJywgJzInKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgnd2ViJywgJzAnKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6ICdwYXJzZXQnXFxuICAgICAgICB9XFxuICAgIH0sIHtcXG4gICAgICAgIHRpdGxlOiAn5qih5p2/OicgKyAoZ2V0SXRlbSgnYWknLCAnMCcpID09ICcwJyA/ICflhbPpl60nIDogJ+W8gOWQrycpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJmbGV4X2J1dHRvblxcXCIsXFxuICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBpZiAoZ2V0SXRlbSgnYWknLCAnMCcpID09ICcwJykge1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKCdhaScsICcxJylcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKCdhaScsICcwJylcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6ICdhaW1iJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG59XFxuXFxuXFxuXFxuaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLmkJzntKJcXFwiLFxcbiAgICAgICAgdXJsOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeWFs+mUruivje+8jOWwvemHj+WwkeWtl+S4jeimgeWkmuWtl1xcXCIsXFxuICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcihcXFwic291XFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcigncGFnZScpXFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcImR1cmxcXFwiKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBhZGRMaXN0ZW5lcihcXFwib25DbG9zZVxcXCIsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgY2xlYXJNeVZhcihcXFwic291XFxcIik7XFxuICAgIH0pKTtcXG5cXG4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neKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuaQnOeJhzwvZm9udD5cXFwiLFxcbiAgICAgICAgICAgIHBpY191cmw6IGltZyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogdXJsLFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICBwYWdlVGl0bGU6bmFtZSxcXG4gICAgICAgICAgICAgICAgd2ViOndlYixcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBzZXRSZXN1bHQoZClcXG59IGVsc2Uge1xcblxcbn1cXG5cXG5pZiAoZ2V0SXRlbSgnaG9tZScsICflhbMnKSA9PSAn5byAJykge1xcbiAgICB2YXIgaHRtbCA9IHJlcXVlc3QoJ2h0dHA6Ly9zb3VwaWFuLmRlLycsIHt9KVxcblxcblxcbiAgICBmdW5jdGlvbiBzZXRMaXN0cyhpdGVtKSB7XFxuICAgICAgICB2YXIgdGl0bGUgPSBpdGVtLnNwbGl0KCctJylbMF1cXG4gICAgICAgIHZhciB0ID0gaXRlbS5zcGxpdCgnLScpWzFdXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMTAucG5nJ1xcbiAgICAgICAgfSlcXG5cXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCBgYm9keSYmLmxpc3QtaGVhZGVyOm1hdGNoZXMoJHt0fSkrKiYmYWApXFxuXFxuICAgICAgICBsaXN0Lm1hcCh4ID0+IHtcXG4gICAgICAgICAgICB2YXIgbmFtZSA9IHBkZmgoeCwgJy5wb3N0ZXItaXRlbS10aXRsZSYmVGV4dCcpXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogcGRmaCh4LCAnaW1nJiZzcmMnKSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgWyfng63pl6jnlLXlvbEt55S15b2xJywgJ+eDremXqOeUteinhuWJpy3nlLXop4bliacnLCAn54Ot6Zeo57u86Im6Lee7vOiJuicsICfng63pl6jliqjmvKst5Yqo5ryrJ10ubWFwKHggPT4ge1xcbiAgICAgICAgc2V0TGlzdHMoeClcXG4gICAgfSlcXG5cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCIxLuixjOixhlwiLFwicGF0aFwiOlwid2FuZG91XCIsXCJydWxlXCI6XCJqczpcXG5sZXQgZHVybCA9IGdldE15VmFyKFxcXCJkdXJsXFxcIiwgXFxcIlxcXCIpO1xcbmlmIChkdXJsICE9ICcnKSB7XFxuXFxuICAgIGR1cmwgPSAnaHR0cHM6Ly93d3cud2FuZG91LnBybycgKyBkdXJsLnJlcGxhY2UoJy5odG1sJywgJycpXFxuICAgIGxldCB1cmwgPSBkdXJsO1xcbiAgICBsZXQgaWQgPSB1cmw7XFxuICAgIGxldCBodG1sID0gZmV0Y2godXJsKTtcXG4gICAgdmFyIHJ1bGUgPSBNWV9SVUxFLnRpdGxlXFxuICAgIHZhciBuYW1lID0gcGRmaChodG1sLCAnLm1vdmllLWNvbnRlbnQmJnAmJ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dXJsO1xcbiAgICAgICAgICAgICAgICB1ID0gXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnU9XFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXG4gICAgICAgICAgICAgICAgdSA9IGdldEl0ZW0oJ2FpJywgJzAnKSA9PSAnMCcgPyB1IDogdSArICcjaW1tZXJzaXZlVGhlbWUjJ1xcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0LnNpdGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogdSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaXQuc2l0ZV9pY29uLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZyb206ICdob21lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgd2ViOiBpdC5zaXRlX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgIC8vYWRkSXRlbUFmdGVyKGlkLCBsaXN0KTtcXG4gICAgICAgICAgICAgICAgZCA9IGQuY29uY2F0KGxpc3QpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBz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dXQ7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSB1cmw7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhodG1sKVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRleHQgPSBwZGZoKGh0bWwsIFxcXCJib2R5JiYjX19ORVhUX0RBVEFfXyYmSHRtbFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2codGV4dCk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZXJqaSA9IEpTT04ucGFyc2UodGV4dCk7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhlcmppKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsaXN0ID0gZXJqaS5wcm9wcy5wYWdlUHJvcHMuZGF0YS5wbGF5RGF0YTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0ICYmIGxpc3QubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ZX1VSTCA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JhcFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbD9ydWxlPVxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGxpc3QubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1ID0gaXQuZGF0YV91cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnU9XFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0LnNpdGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXQuc2l0ZV9pY29uLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb206ICdob21lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZWI6IGl0LnNpdGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoaWQsIGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICB9LCBNWV9SVUxFLnRpdGxlLCB1cmwsIHMsIG5hbWUpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibW92aWVfMV9sZWZ0X3BpY1xcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuixjOixhjwvZm9udD5cXFwiLFxcbiAgICAgICAgICAgIHBpY191cmw6IGltZyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogdXJsLFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgc2V0UmVzdWx0KGQpXFxufVxcblxcblxcbmlmIChnZXRJdGVtKCdob21lJywgJ+WFsycpID09ICflvIAnKSB7XFxuICAgIHZhciBwYWdlID0gTVlfUEFHRTtcXG4gICAgbGV0IHtcXG4gICAgICAgIHNldHBhZ2VkXFxuICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS90b29sXFxcIik7XFxuXFxuICAgIHZhciBwaW5kZXggPSBzZXRwYWdlZChkLHBhZ2UsIFtcXFwi6aaW6aG1XFxcIiwgXFxcIuWIhuexu1xcXCJdLCBcXFwiIzQ2ODJCNFxcXCIpO1xcblxcblxcbiAgICAvL+mmlumhtVxcbiAgICBpZiAocGluZGV4ID09IFxcXCIwXFxcIikge1xcblxcbiAgICAgICAgdmFyIGh0bWwgPSBmZXRjaCgnaHR0cHM6Ly93d3cud2FuZG91LnByby8nKVxcbiAgICAgICAgbGV0IGpzb24gPSBKU09OLnBhcnNlKHBkZmgoaHRtbCwgXFxcImJvZHkmJiNfX05FWFRfREFUQV9fJiZIdG1sXFxcIikpO1xcblxcbiAgICAgICAgZnVuY3Rpb24gc2V0TGlzdHMoaXRlbSkge1xcbiAgICAgICAgICAgIHZhciB0aXRsZSA9IGl0ZW0uc3BsaXQoJyMnKVswXVxcbiAgICAgICAgICAgIHZhciBrZXkgPSBpdGVtLnNwbGl0KCcjJylbMV1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMTAucG5nJ1xcbiAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgdmFyIGxpc3QgPSBqc29uLnByb3BzLnBhZ2VQcm9wcy5mYWxsYmFja1trZXldLmRhdGFcXG5cXG4gICAgICAgICAgICBsaXN0Lm1hcCh4ID0+IHtcXG4gICAgICAgICAgICAgICAgdmFyIG5hbWUgPSB4LmhvdF9uYW1lXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogeC5ob3RfaW1nX3VybCxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHguaG90X3JhdGUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKChuLCB1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2R1cmwnLCB1KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJl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hcmlldHknLFxcbiAgICAgICAgICAgIGNvbnRlbnQ6IHR5cGVzXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgbmFtZTogJ+e6quW9leeJhycsXFxuICAgICAgICAgICAgaWQ6ICdkb2N1bWVudGFyeScsXFxuICAgICAgICAgICAgY29udGVudDogdHlwZXNcXG4gICAgICAgIH1dXFxuXFxuICAgICAgICB2YXIg5aSn57G7ID0gW107XFxuICAgICAgICBvanNvbi5tYXAoeCA9PiB7XFxuICAgICAgICAgICAg5aSn57G7LnB1c2goeC5uYW1lICsgXFxcIkBcXFwiICsgeC5pZCk7XFxuICAgICAgICB9KVxcbiAgICAgICAgdmFyIGluZGV4ID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcImluZGV4XFxcIiwgJzAnKTtcXG4gICAgICAgIHZhciBqID0gb2pzb25baW5kZXhdO1xcbiAgICAgICAgdmFyIGtleXMgPSBPYmplY3Qua2V5cyhqLmNvbnRlbnQpO1xcblxcbiAgICAgICAgdmFyIHRlbXAgPSB7fTtcXG4gICAgICAgIGtleXMuZm9yRWFjaCh4ID0+IHtcXG4gICAgICAgICAgICB2YXIgdHlwZSA9IHg7XFxuICAgICAgICAgICAgdmFyIGwgPSBqLmNvbnRlbnRbeF07XFxuICAgICAgICAgICAgaWYgKFsndmVyc2lvbiddLmluY2x1ZGVzKHgpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVyblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAobC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgIHZhciBucyA9IGwubWFwKChrKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbmFtZSA9IGsuc3BsaXQoJzonKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBpZCA9IGsuc3BsaXQoJzonKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25hbWUnOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1cmwnOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAndHlwZSc6IHhcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgdGVtcFt4XSA9IG5zO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuXFxuICAgICAgICB2YXIgdCA9IE9iamVjdC52YWx1ZXModGVtcCkubWFwKHggPT4geC5tYXAoeiA9PiBKU09OLnN0cmluZ2lmeSh6KSkuam9pbignIycpKVxcblxcbiAgICAgICAgdmFyIFRydWVKc29uID0ge1xcbiAgICAgICAgICAgIHR5cGU6IEFycmF5KOWkp+exuy5qb2luKCcjJykpLFxcbiAgICAgICAgICAgIGl0ZW06IHQgIT0gXFxcIlxcXCIgPyB0IDogW10sXFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhUcnVlSnNvbilcXG5cXG4gICAgICAgIC8v6ZyA5qC55o2u5a6e6ZmF5L+u5pS5XFxuICAgICAgICBjb25zdCDliIbnsbvpopzoibIgPSBnZXRSYW5nZUNvbG9ycygpO1xcbiAgICAgICAgY29uc3QgSnNvbuWkp+exuyA9ICd0eXBlJztcXG4gICAgICAgIGNvbnN0IEpzb27mi7zmjqUgPSAnaXRlbSc7XFxuICAgICAgICBjb25zdCBKc29u5ouG5YiGID0gJyMnO1xcbiAgICAgICAgY29uc3QgSnNvbuWNlemhuSA9ICdAJztcXG4gICAgICAgIGNvbnN0IEpzb27liJfooaggPSBbXFxcInRhZ1xcXCIsIFxcXCJjb3VudHJ5XFxcIiwgXFxcInllYXJcXFwiLCBcXFwic29ydFxcXCJdOyAvL+WIh+aNoua4hemZpFxcbiAgICAgICAgY29uc3Qg5o6S6ZmkID0gJyc7XFxuICAgICAgICBjb25zdCDliIbnsbvlsZXlvIAgPSAn4oioJztcXG4gICAgICAgIGNvbnN0IOWIhuexu+aKmOWPoCA9ICfiiKcnO1x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ltZzogeC5tb3ZpZV9pbWdfdXJsICsgXFxcIkBSZWZlcmVyPVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IHgubW92aWVfcmF0ZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobiwgdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZHVybCcsIHUpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUsIHgubW92aWVfdXJsKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8zX21hcnF1ZWUnXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCIyLuiMtuadr+eLkFwiLFwicGF0aFwiOlwiY3VwZm94XCIsXCJydWxlXCI6XCJqczpcXG5cXG5ldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL3h0b29scycpKS5ydWxlKVxcblxcbmlmIChzICE9IFxcXCJcXFwiKSB7XFxuICAgIGxldCB7XFxuICAgICAgICB3cmFwMSxcXG4gICAgICAgIHJlaHRtbFxcbiAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbFxcXCIpO1xcbiAgICB2YXIganNvbiA9IHNlYXJjaChzLCBzdG9yYWdlMC5nZXRNeVZhcigncGFnZScsIE1ZX1BBR0UpKVxcbiAgICBpZiAoSlNPTi5zdHJpbmdpZnkoanNvbikgIT0gXFxcInt9XFxcIikge1xcbiAgICAgICAgdmFyIGxpc3QgPSBqc29uLnJlc291cmNlcztcXG4gICAgICAgIGxpc3QubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICAvL2xvZyhpdC53ZWJzaXRlKyctJytyZWh0bWwoaXQudGV4dCkpXFxuICAgICAgICAgICAgdmFyIHU9XFxcImhpa2VyOi8vcGFnZS9wP3U9XFxcIiArIGJhc2U2NEVuY29kZShpdC51cmwpXFxuICAgICAgICAgICAgdT1nZXRJdGVtKCdhaScsJzAnKT09JzAnP3U6dSsnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogd3JhcDEoaXQud2Vic2l0ZSsnLScrcmVodG1sKGl0LnRleHQpLCBzKSxcXG4gICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgIGltZzppdC5pY29uLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBpdC53ZWJzaXRlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogcmVodG1sKGl0LnRleHQpLFxcbiAgICAgICAgICAgICAgICAgICAgd2ViOml0LndlYnNpdGUsXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgXFxuICAgIHNldFJlc3VsdChkKVxcbn0gZWxzZSB7XFxuICAgIFxcbn1cXG5cXG5pZihnZXRJdGVtKCdob21lJywn5YWzJyk9PSflvIAnKXtcXG5cXG52YXIgaHRtbCA9IGZldGNoUEMoJ2h0dHBzOi8vY3VwZm94LmFwcC8nLCB7fSlcXG5cXG5cXG5mdW5jdGlvbiBzZXRMaXN0cyhpdGVtKSB7XFxuICAgIHZhciB0aXRsZSA9IGl0ZW0uc3BsaXQoJy0nKVsw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RyYToge1xcbiAgICAgICAgICAgICAgICBpZDogaXQudXJpLFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IHQsXFxuICAgICAgICAgICAgICAgIHdlYjp3ZWIsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgc2V0UmVzdWx0KGQpXFxufSBlbHNlIHtcXG5cXG59XFxuXFxuaWYgKGdldEl0ZW0oJ2hvbWUnLCAn5YWzJykgPT0gJ+W8gCcpIHtcXG4gICAgZnVuY3Rpb24gc2V0TGlzdHMoaXRlbSkge1xcbiAgICAgICAgdmFyIHRpdGxlID0gaXRlbS5zcGxpdCgnLScpWzBdXFxuICAgICAgICB2YXIgdCA9IGl0ZW0uc3BsaXQoJy0nKVsxXVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzEwLnBuZydcXG4gICAgICAgIH0pXFxuXFxuICAgICAgICB2YXIganNvbiA9IEpTT04ucGFyc2UoZmV0Y2hQQyhgaHR0cHM6Ly93d3cucW10di5hcHAvcHJvZC1hcGkvYXBwL21vdmllL2luZGV4L3NlYXJjaEFsbE1vdmllYCkpXFxuICAgICAgIFxcblxcbiAgICAgICAgdmFyIGxpc3QgPSBqc29uLmRhdGFbdF0ucmVjb3JkcztcXG5cXG4gICAgICAgIGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgIHZhciBuYW1lID0geC50aXRsZTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiB4LmNvdmVyLFxcbiAgICAgICAgICAgICA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yxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxuICAgIH0pO1xcbn1cXG5cXG5zZXRSZXN1bHQoZClcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIng1YWlcIixcInBhdGhcIjpcIng1YWlcIixcInJ1bGVcIjpcIiQuZXhwb3J0cyA9IGZ1bmN0aW9uKHJ1bGUsIGFuY2hvcklkKSB7XFxuICAgIHJldHVybiAkLnRvU3RyaW5nKChydWxlLCBhbmNob3JJZCwgbW9iYW4pID0+IHtcXG4gICAgICAgIGlmICh3aW5kb3cuY2hlY2swID09IG51bGwpIHtcXG4gICAgICAgICAgICBmdW5jdGlvbiBjaGVjazAoKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImh0bWxcXFwiKS5pbm5lckhUTUw7XFxuICAgICAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXCJodG1sMFxcXCIsIGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLnBhcnNlTGF6eVJ1bGVBc3luYygkJCQoKS5sYXp5UnVsZSgocnVsZSwgdXJsLCBhbmNob3JJZCwgbW9iYW4pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBnZXRWYXIoXFxcImh0bWwwXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaXVybCA9ICcnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhclZhcihcXFwiaHRtbDBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coJ3VybDonICsgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLnN0YXJ0c1dpdGgoJ2h0dHBzOi8vY3VwZm94LmFwcC9wYWdlP3VybD0nKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJhc2V1cmwgPSB1cmwucmVwbGFjZSgvLit1cmw9KC4qPykmLisvZ20sICckMScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdXJsID0gYmFzZTY0RGVjb2RlKGJhc2V1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2lmcmFtZScsIGl1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ2l1cmw6JyArIGl1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl1cmwubGVuZ3RoID4gMCA/IFxcXCIxXFxcIiA6IFxcXCIwXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIHJ1bGUsIGxvY2F0aW9uLmhyZWYsIGFuY2hvcklkLCBtb2JhbiksICQkJC50b1N0cmluZygocnVsZSxtb2JhbikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZyhpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2ZiYS5sb2cocnVsZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXFxcIjBcXFwiID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jaGVja2MgPSB3aW5kb3cuY2hlY2tjICsgMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAod2luZG93LmNoZWNrYyA+IDEyMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5omn6KGM6LaF6L+HMzDnp5LvvIzml6Dms5Xop6PmnpBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsqL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KHdpbmRvdy5jaGVjazAsIDI1MCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB1cmwgPSBmYmEuZ2V0VmFyKCdpZnJhbWUnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZygnbW9iYW4nK21vYmFuKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihtb2Jhbj09JzEnKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybD11cmwrJyNpbW1lcnNpdmVUaGVtZSMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gICAgICBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyh1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6IHJ1bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+W9seeJh+ivpuaDhScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncm91cDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVSdWxlOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VzOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vcGFnZS9wP3J1bGU9JyArIHJ1bGUgKyAnJnU9JyArIHVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmRSdWxlOiBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jaGVja3VybCA9IGxvY2F0aW9uLmhyZWY7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrdTAoKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod2luZG93LmNoZWNrdXJsICE9IGxvY2F0aW9uLmhyZWYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2hhc2jlj5HnlJ/kuoblj5jljJZcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2hlY2tjID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2swKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMjAwMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoY2hlY2t1MCwgMjUwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja3UwKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSxydWxlLG1vYmFuKSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQod2luZG93LmNoZWNrMCwgMjUwKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB3aW5kb3cuY2hlY2tjID0gMDtcXG4gICAgICAgICAgICB3aW5kb3cuY2hlY2swID0gY2hlY2swO1xcbiAgICAgICAgICAgIGNoZWNrMCgpO1xcbiAgICAgICAgfVxcbiAgICB9LCBydWxlLCBhbmNob3JJZCwgZ2V0SXRlbSgnYWknLCcwJykpO1xcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIjUu6Iy25p2v6JmOXCIsXCJwYXRoXCI6XCJhaW9iYlwiLFwicnVsZVwiOlwianM6XFxubGV0IGR1cmwgPSBnZXRNeVZhcihcXFwiZHVybFxcXCIsIFxcXCJcXFwiKTtcXG5pZiAoZHVybCAhPSAnJykge1xcbiAgICBNWV9VUkwgPSBkdXJsXFxuICAgIGxvZyhkdXJsKVxcblxcbiAgICBsZXQgdXJsID0gZHVybDtcXG4gICAgbGV0IGlkID0gdXJsO1xcbiAgICB0cnkge1xcbiAgICAgICAgdmFyIGh0bWwgPSBmZXRjaCh1cmwpO1xcbiAgICB9IGNhdGNoIHtcXG4gICAgICAgIHZhciBodG1sID0gJydcXG4gICAgfVxcbiAgICB2YXIgcnVsZSA9IE1ZX1JVTEUudGl0bGVcXG4gICAgaWYgKGh0bWwgPT0gdW5kZWZpbmVkIHx8IGh0bWwgPT0gJycpIHtcXG4gICAgICAgIHRvYXN0KCfml6DmlbDmja4nKVxcbiAgICAgICAgY2xlYXJNeVZhcihcXFwic291XFxcIik7XFxuICAgICAgICBjbGVhck15VmFyKFxcXCJkdXJsXFxcIik7XFxuICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgIH0gZWxzZSB7XFxuXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBwZGZoKGh0bWwsICdoNCYmVGV4dCcpLFxcbiAgICAgICAgICAgIGltZzogcGQoaHRtbCwgJ2ltZyYmc3JjJyksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycsXFxuICAgICAgICAgICAgZGVzYzogcGRmaChodG1sLCAnYm9keSYmLnB1YlRpbWUmJlRleHQnKSxcXG4gICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogdXJsLFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG5cXG5cXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCAnLm1vdmllWnkmJmEnKVxcbiAgICAgICAgaWYgKGxpc3QgJiYgbGlzdC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgTVlfVVJMID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICBtZXJnZVxcbiAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbD9ydWxlPVxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IGxpc3QubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgJ2EmJmhyZWYnKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJ3VsJiZUZXh0Jyk7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnU9XFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG1lcmdlKHQsICfor6bmg4UnLCAxKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL3d3dy43MjU5OTguY29tL3N0YXRpYy9zZWFyY2gvaW1hZ2VzL29uTGluZS5wbmcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb206ICdob21lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBkID0gZC5jb25jYXQobGlzdClcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfml6DotYTmupAnLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgICAgICB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gICAgIH1cXG4gICAgICAgIGxldCB1cmwgPSBwZChpdCwgJ2EmJmhyZWYnKTtcXG4gICAgICAgIGxldCBkZXNjID0gcGRmYShpdCwgJ2JvZHkmJi5pbmZvJiZhJykubWFwKHggPT4gcGRmaCh4LCAnYSYmVGV4dCcpKS5qb2luKCcgJyk7XFxuICAgICAgICBsZXQgc2NvcmUgPSBwZGZoKGl0LCAnLm5vU2NvcmUmJlRleHQnKTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHdyYXAobmFtZSwgcyksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycsXFxuICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgZGVzYzogJ+ivhOWIhjonICsgc2NvcmUgKyAnXFxcXG4nICsgZGVzYyxcXG4gICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocnVsZSwgdXJsLCBzKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBjbHMgPSBmaW5kSXRlbXNCeUNscyh1cmwpO1xcbiAgICAgICAgICAgICAgICBpZiAoISFjbHMpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyh1cmwpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSB1cmw7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgJy5tb3ZpZVp5JiZhJylcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0ICYmIGxpc3QubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ZX1VSTCA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVyZ2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3Rvb2w/cnVsZT1cXFwiICsgcnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0Lm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsICdhJiZocmVmJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdCA9IHBkZmgoaXQsICd1bCYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZ1PVxcXCIgKyBiYXNlNjRFbmNvZGUodSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gZ2V0SXRlbSgnYWknLCAnMCcpID09ICcwJyA/IHUgOiB1ICsgJyNpbW1lcnNpdmVUaGVtZSMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBtZXJnZSh0LCAn6K+m5oOFJywgMSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly93d3cuNzI1OTk4LmNvbS9zdGF0aWMvc2VhcmNoL2ltYWdlcy9vbkxpbmUucG5nJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tOiAnaG9tZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCBsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5peg6LWE5rqQJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxu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yA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICBpbWcgPSBcXFwiaHR0cHM6Ly93d3cuNzI1OTk4LmNvbS9zdGF0aWMvc2VhcmNoL2ltYWdlcy9wcmVsb2FkSW1nLnBuZ1xcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCB1cmwgPSBwZCh4LCAnYSYmaHJlZicpO1xcbiAgICAgICAgICAgIGxldCBzY29yZSA9IHBkZmgoeCwgJy5ub1Njb3JlJiZUZXh0Jyk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBzY29yZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobiwgdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZHVybCcsIHUpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUsIHVybClcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBbJ+eUteW9sSMxJywgJ+eUteinhuWJpyMyJywgJ+WKqOa8qyMzJywgJ+e6quW9leeJhyM0J10ubWFwKHggPT4ge1xcblxcbiAgICAgICAgc2V0TGlzdHMoeClcXG4gICAgfSlcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCI2LueUteW9seeLl1wiLFwicGF0aFwiOlwiZHlkb2dcIixcInJ1bGVcIjpcImpzOlxcbk1ZX1VSTD0naHR0cHM6Ly93d3cuZGlhbnlpbmd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WnkmJmEnKVxcbiAgICBpZiAobGlzdCAmJiBsaXN0Lmxlbmd0aCA+IDApIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgTVlfVVJMID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgd3JhcDFcXG4gICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbD9ydWxlPVxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICBcXG4gICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsICdhJiZocmVmJyk7XFxuICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJ2xpLDAmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgbGV0IHdlYj1wZGZoKGl0LCAnbGksMSYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICB1ID0gXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnU9XFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXG4gICAgICAgICAgICAgICAgdSA9IGdldEl0ZW0oJ2FpJywgJzAnKSA9PSAnMCcgPyB1IDogdSArICcjaW1tZXJzaXZlVGhlbWUjJ1xcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHdyYXAxKHdlYisnLScrdCwgcyksXFxuICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL3d3dy43MjU5OTguY29tL3N0YXRpYy9zZWFyY2gvaW1hZ2VzL29uTGluZS5wbmcnLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTp0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdlYjp3ZWIsXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBkID0gZC5jb25jYXQobGlzdClcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBzZXRSZXN1bHQoZClcXG59XFxucyA9IGdldE15VmFyKFxcXCJzb3VcXFwiLCBcXFwiXFxcIik7XFxubGV0IHIgPSBcXFwiXFxcIjtcXG5pZiAocyAhPSBcXFwiXFxcIikge1xcbiAgICB2YXIgcGFnZSA9IE1ZX1BBR0U7XFxuICAgIHZhciB1cmwgPSBgaHR0cHM6Ly93d3cuZGlhbnlpbmdnb3UuY29tL3NvLyR7c30vcGFnZV8ke3BhZ2V9Lmh0bWxgO1xcbiAgICAvL2xvZyh1cmwpXFxuICAgIHZhciBodG1sID0gZmV0Y2godXJsKVxcblxcbiAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgJ2JvZHkmJi5lYWNoJylcXG4gICAgLy9sb2cobGlzdClcXG5cXG4gICAgbGV0IHtcXG4gICAgICAgIHdyYXBcXG4gICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3Rvb2xcXFwiKTtcXG5cXG4gICAgZm9yIChsZXQgaXQgb2YgbGlzdCkge1xcbiAgICAgICAgbGV0IG5hbWUgPSBwZGZoKGl0LCAnYSYmdGl0bGUnKTtcXG4gICAgICAgIGxldCBpbWcgPSBwZChpdCwgJ2ltZyYmZGF0YS11cmwnKTtcXG4gICAgICAgIGlmIChpbWcgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICBpbWcgPSBcXFwiaHR0cHM6Ly93d3cuZGlhbnlpbmdnb3UuY29tL1ZpZXcvaW1hZ2VzL2JsYW5rX2JnLnBuZ1xcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgdXJsID0gcGQoaXQsICdhJiZocmVmJyk7XFxuICAgICAgICBsZXQgZGVzYyA9IHBkZmEoaXQsICdib2R5JiYuaW5mbyYmYScpLm1hcCh4ID0+IHBkZmgoeCwgJ2EmJlRleHQnKSkuam9pbignICcpO1xcbiAgICAgICAgbGV0IHNjb3JlID0gcGRmaChpdCwgJy5ub1Njb3JlJiZUZXh0Jyk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB3cmFwKG5hbWUsIHMpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV92ZXJ0aWNhbF9waWMnLFxcbiAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgIGRlc2M6ICfor4TliIY6JyArIHNjb3JlICsgJ1xcXFxuJyArIGRlc2MsXFxuICAgICAgICAgICAgdXJsOiAkKHVybCkubGF6eVJ1bGUoKHJ1bGUsIHVybCwgcywgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgY2xzID0gZmluZEl0ZW1zQnlDbHModXJsKTtcXG4gICAgICAgICAgICAgICAgaWYgKCEhY2xzKSB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHModXJsKVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaChgaHR0cHM6Ly93d3cuZGlhbnlpbmdnb3UuY29tL1NwaWRlck1vdmllL3p5LyR7bmFtZX1gLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAneC1yZXF1ZXN0ZWQtd2l0aCc6ICdYTUxIdHRwUmVxdWVzdCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCAnLm1vdmllWnkmJmEnKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QgJiYgbGlzdC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVlfVVJMID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cmFwMVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbD9ydWxlPVxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGxpc3QubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgJ2EmJmhyZWYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJ2xpLDAmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB3ZWI9cGRmaChpdCwgJ2xpLDEmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaGlrZXI6Ly9wYWdlL3A/cnVsZT1cXFwiICsgcnVsZSArIFxcXCImdT1cXFwiICsgYmFzZTY0RW5jb2RlKHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGdldEl0ZW0oJ2FpJywgJzAnKSA9PSAnMCcgPyB1IDogdSArICcjaW1tZXJzaXZlVGhlbWUjJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogd3JhcDEod2ViKyctJyt0LCBzKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL3d3dy43MjU5OTguY29tL3N0YXRpYy9zZWFyY2gvaW1hZ2VzL29uTGluZS5wbmcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTp0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZWI6d2ViLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihpZCwgbGlzdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgIH0sIE1ZX1JVTEUudGl0bGUsIHVybCwgcywgbmFtZSksXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IHVybCxcXG4gICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgc2V0UmVzdWx0KGQpXFxufSBlbHNlIHtcXG5cXG59XFxuXFxuaWYgKGdldEl0ZW0oJ2hvbWUnLCAn5YWzJykgPT0gJ+W8gCcpIHtcXG4gICAgZnVuY3Rpb24gc2V0TGlzdHMoaXRlbSkge1xcbiAgICAgICAgTVlfVVJMID0gJ2h0dHBzOi8vd3d3LmRpYW55aW5nZ291LmNvbS8nO1xcbiAgICAgICAgdmFyIHRpdGxlID0gaXRlbS5zcGxpdCgnIycpWzBdXFxuICAgICAgICB2YXIga2V5ID0gaXRlbS5zcGxpdCgnIycpWzFdXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMTAucG5nJ1xcbiAgICAgICAgfSlcXG5cXG4gICAgICAgIHZhciBkYXRlID0gbmV3IERhdGUoKTtcXG4gICAgICAgIHZhciB5ZWFyID0gZGF0ZS5nZXRGdWxsWWVhcigpO1xcbiAgICAgICAgLy92YXIgaHRtbCA9IGZldGNoKGBodHRwczovL3d3dy5kaWFueWluZ2dvdS5jb20vbVJlY29tbWQvJHtrZXl9YCk7XFxuICAgICAgICB2YXIgaHRtbCA9IGZldGNoKGBodHRwczovL3d3dy5kaWFueWluZ2dvdS5jb20vc29Nb3JlLyR7a2V5fS1hbGwtYWxsLSR7eWVhcn0tYCk7XFxuXFxuICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgJ2JvZHkmJi5lYWNoJylcXG5cXG4gICAgICAgIGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgIHZhciBuYW1lID0gcGRmaCh4LCAnYSYmdGl0bGUnKVxcbiAgICAgICAgICAgIGxldCBpbWcgPSBwZCh4LCAnaW1nJiZkYXRhLXVybCcpO1xcbiAgICAgICAgICAgIGlmIChpbWcgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcImh0dHBzOi8vd3d3LmRpYW55aW5nZ291LmNvbS9WaWV3L2ltYWdlcy9ibGFua19iZy5wbmdcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgdXJsID0gcGQoeCwgJ2EmJmhyZWYnKTtcXG4gICAgICAgICAgICBsZXQgc2NvcmUgPSBwZGZoKHgsICcubm9TY29yZSYmVGV4dCcpO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgZGVzYzogc2NvcmUsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnJykubGF6eVJ1bGUoKG4sIHUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJzb3VcXFwiLCBuKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2R1cmwnLCB1KVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9L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GV0IHtcXG4gICAgICAgICAgICAgICAgd3JhcDFcXG4gICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbD9ydWxlPVxcXCIgKyBydWxlKTtcXG5cXG4gICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsICdhJiZocmVmJyk7XFxuICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJy52aWRlb19kb3dubG9hZF9saW5rX25hbWVfdGV4dCYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICBsZXQgd2ViID0gcGRmaChpdCwgJy5yZXNvdXJjZV93ZWJzaXRlX25hbWUmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgbGV0IGltZyA9IHBkKGl0LCAnLnZpZGVvX2xhYmVscyYmaW1nJiZzcmMnKTtcXG5cXG4gICAgICAgICAgICAgICAgdSA9IFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZ1PVxcXCIgKyBiYXNlNjRFbmNvZGUodSk7XFxuICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB3cmFwMSh3ZWIgKyAnLScgKyB0LCBzKSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICA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RfdGl0bGUmJlRleHQnKTtcXG4gICAgICAgIGxldCBpbWcgPSBwZChpdCwgJ2ltZyYmc3JjJyk7XFxuICAgICAgICBpZiAoaW1nID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgaW1nID0gXFxcIlxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgdXJsID0gcGQoaXQsICdhJiZocmVmJyk7XFxuICAgICAgICBsZXQgZGVzYyA9IHBkZmEoaXQsICdib2R5JiYuc2VhcmNoX3Jlc3VsdF9pdGVtJiYuc2VhcmNoX3Jlc3VsdF9zdWJfaW5mb19saW5lJiYudmlkZW9fYWN0b3InKS5tYXAoeCA9PiBwZGZoKHgsICdzcGFuJiZUZXh0JykpLmpvaW4oJyAnKTtcXG4gICAgICAgIGxldCBzY29yZSA9IHBkZmgoaXQsICcuc2VhcmNoX3ZpZGVvX2ltZ19wb2ludCYmVGV4dCcpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogd3JhcChuYW1lLCBzKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJyxcXG4gICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICBkZXNjOiAn6K+E5YiGOicgKyBzY29yZSArICdcXFxcbuS4u+a8lDonICsgZGVzYyxcXG4gICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocnVsZSwgdXJsLCBzLCBuYW1lKSA9PiB7XFxuXFxuICAgICAgICAgICAgICAgIHZhciBjbHMgPSBmaW5kSXRlbXNCeUNscyh1cmwpO1xcbiAgICAgICAgICAgICAgICBpZiAoISFjbHMpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyh1cmwpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSB1cmw7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBQQ19VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsICdib2R5JiYudmlkZW9fZG93bmxvYWRfbGlua19pdGVtJylcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0ICYmIGxpc3QubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ZX1VSTCA9IHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyYXAxXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS90b29sP3J1bGU9XFxcIiArIHJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwZGZoKGl0LCAnYSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHQgPSBwZGZoKGl0LCAnLnZpZGVvX2Rvd25sb2FkX2xpbmtfbmFtZV90ZXh0JiZUZXh0Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgd2ViID0gcGRmaChpdCwgJy5yZXNvdXJjZV93ZWJzaXRlX25hbWUmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbWcgPSBwZChpdCwgJy52aWRlb19sYWJlbHMmJmltZyYmc3JjJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnU9XFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHdyYXAxKHdlYiArICctJyArIHQsIHMpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2ViOiB3ZWIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCBsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgfSwgTVlfUlVMRS50aXRsZSwgdXJsLCBzLCBuYW1lKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogdXJsLFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBzZXRSZXN1bHQoZClcXG59IGVsc2Uge1xcblxcbn1cXG5cXG5pZiAoZ2V0SXRlbSgnaG9tZScsICflhbMnKSA9PSAn5byAJykge1xcbiAgICBsZXQgaHRtbCA9IGZldGNoKCdodHRwczovL3d3dy50YnNkeS5jb20vJywge1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogUENfVUFcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIGZ1bmN0aW9uIHNldExpc3RzKGl0ZW0pIHtcXG4gICAgICAgIE1ZX1VSTCA9ICdodHRwczovL3d3dy50YnNkeS5jb20vJztcXG4gICAgICAgIHZhciB0aXRsZSA9IGl0ZW0ubmFtZTtcXG4gICAgICAgIHZhciBrZXkgPSBpdGVtLnNlbGVjdDtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICBpbWc6IGl0ZW0uaW1nLFxcbiAgICAgICAgfSlcXG5cXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCBgYm9keSYmLmNvbnRhaW5lcl9tYWluX2hvdF8ke2tleX0mJi5ob3RfcmVzb3VyY2Vfb25lYClcXG5cXG4gICAgICAgIGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgIHZhciBuYW1lID0gcGRmaCh4LCAnLnJlc291cmNlX25hbWUmJlRleHQnKVxcbiAgICAgICAgICAgIGxldCBpbWcgPSBwZCh4LCAnLnJlc291cmNlX3Bvc3RlcnMmJmRhdGEtdXJsJyk7XFxuICAgICAgICAgICAgaWYgKGltZyA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICBpbWcgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHVybCA9IHBkKHgsICdhJiZocmVmJyk7XFxuXFxuICAgICAgICAgICAgbGV0IHNjb3JlID0gcGRmaCh4LCAnLnVwZGF0ZV90aXB8fC5yZXNvdXJjZV9zY29yZXx8aW1nJiZUZXh0Jyk7XFxuXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBzY29yZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobiwgdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZHVybCcsIHUpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUsIHVybClcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBbe1xcbiAgICAgICAgbmFtZTogJ+eDremXqOeUteinhuWJpycsXFxuICAgICAgICBzZWxlY3Q6ICd0dnMnLFxcbiAgICAgICAgaW1nOiAnaHR0cHM6Ly93d3cudGJzZHkuY29tL2ltZy9tcnN3L3dlYi9pbmRleC9pbmRleF90di5zdmcnLFxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiAn54Ot6Zeo55S15b2xJyxcXG4gICAgICAgIHNlbGVjdDogJ21vdmllcycsXFxuICAgICAgICBpbWc6ICdodHRwczovL3d3dy50YnNkeS5jb20vaW1nL21yc3cvd2ViL2luZGV4L2luZGV4X212LnN2ZydcXG4gICAgfSwge1xcbiAgICAgICAgbmFtZTogJ+eDremXqOWKqOa8qycsXFxuICAgICAgICBzZWxlY3Q6ICdhbmltZXMnLFxcbiAgICAgICAgaW1nOiAnaHR0cHM6Ly93d3cudGJzZHkuY29tL2ltZy9tcnN3L3dlYi9pbmRleC9pbmRleF9zaG93LnN2ZydcXG4gICAgfSwge1xcbiAgICAgICAgbmFtZTogJ+eDremXqOe7vOiJuicsXFxuICAgICAgICBzZWxlY3Q6ICd2YXJpZXR5cycsXFxuICAgICAgICBpbWc6ICdodHRwczovL3d3dy50YnNkeS5jb20vaW1nL21yc3cvd2ViL2luZGV4L2luZGV4X3JlY29yZHMuc3ZnJ1xcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiAn54Ot6Zeo57qq5b2V54mHJyxcXG4gICAgICAgIHNlbGVjdDogJ2RvY3VtZW50YXJ5cycsXFxuICAgICAgICBpbWc6ICdodHRwczovL3d3dy50YnNkeS5jb20vaW1nL21yc3cvd2ViL2luZGV4L2luZGV4X3JlY29yZHMuc3ZnJyxcXG4gICAgfV0ubWFwKHggPT4ge1xcblxcbiAgICAgICAgc2V0TGlzdHMoeClcXG4gICAgfSlcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3Z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rCoHRpdGxlLFxcbsKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqB1cmw6wqAkKGl0ZW0rJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcynCoD0+wqB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9iaj1KU09OLnBhcnNlKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB1cmw9b2JqWyd1cmwnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0eXBlPW9ialsndHlwZSddXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxuwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdwqA9wqBwYXJhbXMua2V5LnRvU3RyaW5nKClcXG5cXG7CoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqBwdXRWYXIoTVlfUlVMRS50aXRsZSzCoEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKVxcbsKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoHB1dFZhcihNWV9SVUxFLnVybCzCoHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlIT0nJz90cnVlOmZhbHNlKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGtleT10eXBlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZT11cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoa2V5LHZhbHVlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG7CoMKgwqDCoMKgwqDCoMKgwqDCoMKgwq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Jykge1xcXFxuICAgICAgICAgICAgICAgIHVybCA9IHVuZXNjYXBlKGJhc2U2NERlY29kZSh1cmwpKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmICgvbTN1OHxtcDQvLnRlc3QodXJsKSkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiB1cmxcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd2aWRlbzovLycgKyBpbnB1dFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gJ3ZpZGVvOi8vJyArIGlucHV0XFxcXG4gICAgICAgIH1cXFxcbiAgICB9KVxcXFxuXFxcXG4gICAgdHJ5IHtcXFxcbiAgICAgICAgbG9nKHVybClcXFxcbiAgICAgICAgTVlfVVJMID0gJ2hpa2VyOi8vZW1wdHkjIycgKyB1cmxcXFxcbiAgICAgICAgcmVxdWlyZShjb25maWcu6Ieq5Yqo5Yy56YWNKTtcXFxcbiAgICAgICAg6Ieq5Yqo5LqM57qnKGxhenkpO1xcXFxuICAgICAgICBwdXRNeVZhcignYm0nLCAnMScpXFxcXG4gICAgfSBjYXRjaCB7XFxcXG4gICAgICAgIHB1dE15VmFyKCdibScsICcwJylcXFxcbiAgICB9XFxcXG59XFxcXG5cXFxcblxcXFxubG9nKCfmqKHmnb86JyArIGdldE15VmFyKCdibScsICcwJykpXFxcXG5cXFxcbmlmIChnZXRNeVZhcignYm0nLCAnMCcpID09ICcwJykge1xcXFxuXFxcXG4gICAgdmFyIGQgPSBbXTtcXFxcbiAgICBNWV9VUkwgPSB1cmxcXFxcblxcXFxuICAgIGZ1bmN0aW9uIGdldFRpdGxlKGh0bWwsIHMpIHtcXFxcbiAgICAgICAgdmFyIHRpdGxlID0gJyc7XFxcXG4gICAgICAgIHZhciB0aXRsZXMgPSBwZGZhKGh0bWwsIHMpO1xcXFxuICAgICAgICAvL2xvZyh0aXRsZXMpO1xcXFxuICAgICAgICBpZiAodGl0bGVzLmxlbmd0aCA9PSAwKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gdGl0bGVcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBmb3IgKGxldCB4IG9mIHRpdGxlcykge1xcXFxuICAgICAgICAgICAgaWYgKHguaW5jbHVkZXMoJzxmb250JykpIHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHBkZmgoeCwgJ2gxLS1mb250JiZUZXh0Jyk7XFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHguaW5jbHVkZXMoJzxzcGFuJykpIHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHBkZmgoeCwgJ2gxLS1zcGFuJiZUZXh0Jyk7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlID0gcGRmaCh4LCAnVGV4dCcpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHRpdGxlICE9ICcnKSB7XFxcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiB0aXRsZVxcXFxuICAgIH1cXFxcblxcXFxuICAgIGlmIChodG1sID09IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgaHRtbCA9IGZldGNoUEModXJsKVxcXFxuICAgIH1cXFxcblxcXFxuICAgIGxldCBhbGlzdCA9IHBkZmEoaHRtbCwgXFxcXFxcXCJib2R5JiZhXFxcXFxcXCIpO1xcXFxuICAgIC8qaWYoaHRtbC5zZWFyY2goL3dpbmRvdy5sb2NhdGlvbi5ocmVmLykhPS0xJiZhbGlzdC5sZW5ndGg9PTApe1xcXFxuICAgICAgICBNWV9VUk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ICAgICB9XFxcXG4gICAgICAgIHJldHVybiBpdDtcXFxcbiAgICB9XFxcXG5cXFxcbiAgICBmdW5jdGlvbiBpc0NoYXB0ZXIwKGl0LCBicm90aGVyKSB7XFxcXG4gICAgICAgIC8qaWYgKGRlYnVnKSB7XFxcXG4gICAgICAgICAgICBsb2coe1xcXFxuICAgICAgICAgICAgICAgIGl0OiBpdCxcXFxcbiAgICAgICAgICAgICAgICBicm90aGVyOiBicm90aGVyXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSovXFxcXG4gICAgICAgIGl0ID0gZ2V0Q2hhcHRlck51bShpdCk7XFxcXG4gICAgICAgIC8vaWYgKGRlYnVnKSBsb2coaXQpO1xcXFxuICAgICAgICBpZiAoaXQgPCAwKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgYnJvdGhlciA9IGdldENoYXB0ZXJOdW0oYnJvdGhlcik7XFxcXG4gICAgICAgIC8vaWYgKGRlYnVnKSBsb2coYnJvdGhlcik7XFxcXG4gICAgICAgIGlmIChicm90aGVyIDwgMCkge1xcXFxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiBpdCAtIGJyb3RoZXIgPCAyICYmIGl0IC0gYnJvdGhlciA+IC0yO1xcXFxuICAgIH1cXFxcblxcXFxuICAgIGxldCB0ZnB1c2ggPSBnZXRJdGVtKCd3ZWJwdXNoJywgJzAnKTtcXFxcblxcXFxuICAgIGxldCBfd2ViID0gJC50b1N0cmluZygodGZwdXNoKSA9PiB7XFxcXG4gICAgICAgIGxldCB1cmxzID0gX2dldFVybHMoKTtcXFxcbiAgICAgICAgbGV0IHJlZyA9IC9cXFxcXFxcXC5odG1sfFxcXFxcXFxcLmNzc3xcXFxcXFxcXC5qcy87XFxcXG4gICAgICAgIGZvciAobGV0IGsgaW4gdXJscykge1xcXFxuICAgICAgICAg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AgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LCB0ZnB1c2gpO1xcXFxuXFxcXG4gICAgZnVuY3Rpb24gX193ZWIobW9kZSkge1xcXFxuICAgICAgICByZXR1cm4gJC50b1N0cmluZygodGZwdXNoKSA9PiB7XFxcXG4gICAgICAgICAgICBsZXQgdXJscyA9IF9nZXRVcmxzKCk7XFxcXG4gICAgICAgICAgICBsZXQgcmVnID0gL1xcXFxcXFxcLmh0bWx8XFxcXFxcXFwuY3NzfFxcXFxcXFxcLmpzLztcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGsgaW4gdXJscykge1xcXFxuICAgICAgICAgICAgICAgIGlmICghcmVnLnRlc3QodXJsc1trXSkgJiYgdXJsc1trXS5tYXRjaCgvXFxcXFxcXFwubXA0fFxcXFxcXFxcLm0zdTgvKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLmxvZyh1cmxzW2tdKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gZnlfYnJpZGdlX2FwcC5nZXRIZWFkZXJVcmwodXJsc1trXS5yZXBsYWNlKC8uKj91cmw9LywgXFxcXFxcXCJcXFxcXFxcIikpICsgXFxcXFxcXCIjaWdub3JlSW1nPXRydWUjXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ZnB1c2ggPT0gJzAnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnlfYnJpZGdlX2FwcC5nZXRIZWFkZXJVcmwodXJsc1trXS5yZXBsYWNlKC8uKj91cmw9LywgXFxcXFxcXCJcXFxcXFxcIikpICsgXFxcXFxcXCIjaWdub3JlSW1nPXRydWUjXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheSA9IGZ5X2JyaWRnZV9hcHAuZ2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IGFycltpXTtcXFxcbiAgICAgICAgbGV0IHQgPSBpdC50ZXh0O1xcXFxuICAgICAgICBpZiAoIWl0LmhyZWYgfHwgaXQuaHJlZiA9PSBcXFxcXFxcIlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsZXQgcHJlID0gaSA9PSAwID8gbnVsbCA6IGFycltpIC0gMV07XFxcXG4gICAgICAgIGxldCBuZXh0ID0gaSA9PSAoYXJyLmxlbmd0aCAtIDEpID8gbnVsbCA6IGFycltpICsgMV07XFxcXG4gICAgICAgIGlmIChpc0NoYXB0ZXIoaXQsIHByZSwgbmV4dCkpIHtcXFxcbiAgICAgICAgICAgIGlmICh0ZnB1c2ggPT0gJzEnKSB7XFxcXG4gICAgICAgICAgICAgICAgLyp2YXIgdXJseCA9IFxcXFxcXFwid2ViUnVsZTovL1xcXFxcXFwiICsgaXQuaHJlZiArIFxcXFxcXFwiQFxcXFxcXFwiICsgX3dlYjtcXFxcbiAgICAgICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICBqc0xvYWRpbmdJbmplY3Q6IHRydWUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmLFxcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5cycsXFxcXG4gICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLm00YScsICcubXAzJywgJy5mbHYnLCAnLmF2aScsICcuM2dwJywgJy5tcGVnJywgJy53bXYnLCAnLm1vdicsICcucm12YicsICcuZ2lmJywgJy5qcGVnJywgJy5wbmcnLCAnLmljbycsICcuc3ZnJ11cXFxcbiAgICAgICAgICAgICAgICB9OyovXFxcXG4gICAgICAgICAgICAgICAgdmFyIHVybHggPSAnaGlrZXI6Ly9wYWdlL3B1c2g/JnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibmFtZVxcXFxcXFwiOiBnZXRQYWdlVGl0bGUoKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ1cmxcXFxcXFxcIjogaXQudGV4dCArICckJyArIGl0LmhyZWYsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiY29udGVudFxcXFxcXFwiOiBNWV9VUkwudGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgfSkpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBleHRyYXggPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmLFxcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5cycsXFxcXG4gICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHdlYiA9PSAnMCcpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybHggPSBcXFxcXFxcIndlYlJ1bGU6Ly9cXFxcXFxcIiArIGl0LmhyZWYgKyBcXFxcXFxcIkBcXFxcXFxcIiArIF93ZWI7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBleHRyYXggPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqc0xvYWRpbmdJbmplY3Q6IHRydWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaXQuaHJlZixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlzJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLm00YScsICcubXAzJywgJy5mbHYnLCAnLmF2aScsICcuM2dwJywgJy5tcGVnJywgJy53bXYnLCAnLm1vdicsICcucm12YicsICcuZ2lmJywgJy5qcGVnJywgJy5wbmcnLCAnLmljbycsICcuc3ZnJ11cXFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHdlYiA9PSAnMScpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybHggPSBcXFxcXFxcInZpZGVvOi8vXFxcXFxcXCIgKyBpdC5ocmVmO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWYsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5cycsXFxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3ZWIgPT0gJzInKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxhenkgPSAkKCcnKS5sYXp5UnVsZSgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvbGF6eVRvWDU/cnVsZT1kbeebkuWtkCcpLnZpZGVvWDUoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybHggPSBpdC5ocmVmICsgbGF6eVxcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGl0LmhyZWYsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5cycsXFxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdCxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybHgsXFxcXG4gICAgICAgICAgICAgICAgcGg6IHQgKyBcXFxcXFxcIiRcXFxcXFxcIiArIGl0LmhyZWYsXFxcXG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FxcIiArIHVybClcXFxcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIC8v5Li657q/6Lev5Yqg5YiG5Ymy57q/XFxcXG4gICAgICAgIGxldCBkMiA9IFtdO1xcXFxuICAgICAgICBsZXQgbXRhYiA9IFtdO1xcXFxuXFxcXG4gICAgICAgIGQgPSB1bmlxdWUoZClcXFxcbiAgICAgICAgLy9sb2coQml0VFMpXFxcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZC5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgZDIucHVzaChkW2ldKTtcXFxcbiAgICAgICAgICAgIG10YWIucHVzaChkW2ldLnBoKTtcXFxcbiAgICAgICAgICAgIGlmIChpIDwgZC5sZW5ndGggLSAxKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gZFtpXTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdDEgPSBwYXJzZUludChjbGVhclRleHQoaXQudGl0bGUpKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgbmV4dCA9IGRbaSArIDFdO1xcXFxuICAgICAgICAgICAgICAgIGxldCB0MiA9IHBhcnNlSW50KGNsZWFyVGV4dChuZXh0LnRpdGxlKSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHQyIC0gdDEgPiAxIHx8IHQxIC0gdDIgPiAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIG10YWIucHVzaCgnIycpO1xcXFxuICAgICAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJpZ19ibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZDIucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJiaWdfYmxhbmtfYmxvY2tcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcblxcXFxuICAgICAgICBsZXQgcGxheWwgPSBtdGFiLmpvaW4oJyMnKS5yZXBsYWNlKC8jIyMvZywgJyQkJCQkJCcpO1xcXFxuXFxcXG5cXFxcbiAgICAgICAgbGV0IGZyb20gPSBbXTtcXFxcbiAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBwbGF5bC5zcGxpdCgnJCQkJykubGVuZ3RoOyBqKyspIHtcXFxcbiAgICAgICAgICAgIGZyb20ucHVzaChcXFxcXFxcIuaSreaUvuWIl+ihqFxcXFxcXFwiICsgW2ogKyAxXSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGV0IHB1c2ggPSBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICBcXFxcXFxcIm5hbWVcXFxcXFxcIjogZ2V0UGFnZVRpdGxlKCksXFxcXG4gICAgICAgICAgICBcXFxcXFxcImZyb21cXFxcXFxcIjogZnJvbS5qb2luKCckJCQnKSxcXFxcbiAgICAgICAgICAgIFxcXFxcXFwidXJsXFxcXFxcXCI6IHBsYXlsLnJlcGxhY2UoL1xcXFxcXFxcJi9nLCAn77yG77yGJyksXFxcXG4gICAgICAgICAgICBcXFxcXFxcImNvbnRlbnRcXFxcXFxcIjogTVlfUlVMRS50aXRsZVxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgLy9sb2cocHVzaCk7XFxcXG4gICAgICAgIFxcXFxuICAgICAgICB2YXIgdGNvbmZpZz17XFxcXG4gICAgICAgICAgICBuYW1lOmdldFBhZ2VUaXRsZSgpLFxcXFxuICAgICAgICAgICAgY29udGVudDpNWV9SVUxFLnRpdGxlXFxcXG4gICAgICAgIH1cXFxcblxcXFxuICAgICAgICBkMi51bnNoaWZ0KHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuaOqOmAgeacrOmhtT0+VFZCb3hcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJChwdXNoKS5sYXp5UnVsZSgodGNvbmZpZykgPT4ge1xcXFxuICAgICAgICAgICAgICAgIHZhciBkbGlzdCA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXFxcXFwiZHVvc2VsZWN0XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGlmKGRsaXN0Lmxlbmd0aD4wKXtcXFxcbiAgICAgICAgICAgICAgICB2YXIgcGxheXM9ZGxpc3QubWFwKHg9PngudGl0bGUrXFxcXFxcXCIkXFxcXFxcXCIreC51cmwpLmpvaW4oXFxcXFxcXCIjXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBkcHVzaCA9IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJuYW1lXFxcXFxcXCI6IHRjb25maWcubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJmcm9tXFxcXFxcXCI6IFxcXFxcXFwi5pKt5pS+5YiX6KGoXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidXJsXFxcXFxcXCI6IHBsYXlzLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImNvbnRlbnRcXFxcXFxcIjogdGNvbmZpZy5jb250ZW50XFxcXG4gICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAvL2xvZyhkcHVzaClcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdX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xmaW5kSXRlbSgnZHNlbGVjdCcpLmV4dHJhLm1vZGUgPT0gJ29wZW4nKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/ljZXmjqh86YCJ5o6o5qih5byP5byA5ZCv5peg5rOV5L+u5pS5J1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBsZXQgYWxsX2NvbHMgPSBpbmZcXFxcbiAgICAgICAgICAgICAgICBsZXQgY29sID0gc3RvcmFnZTAuZ2V0SXRlbSgn5ZeF5o6iJywgJ1dlYuWXheaOoicpO1xcXFxuICAgICAgICAgICAgICAgIGxldCDll4XmjqIgPSBhbGxfY29scy5tYXAoKGl0KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpdC5zcGxpdCgnOicpWzBdID09PSBjb2wgPyAn4p6h77iPJyArIGl0IDogaXQ7XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHRpcHMgPSAn6K+36YCJ5oup5ZeF5o6i5qih5byPJztcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJCjll4XmjqIsIDEsIHRpcHMpLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQucmVwbGFjZSgv4p6h77iPL2csICcnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgn5ZeF5o6iJywgaW5wdXQuc3BsaXQoJzonKVswXSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBtb2RlID0gaW5wdXQuc3BsaXQoJzonKVsxXVxcXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCd3ZWInLCBtb2RlKVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgb2xkSWRzID0gKGZpbmRJdGVtc0J5Q2xzKCdwbGF5cycpKS5tYXAoaXQgPT4gaXQuZXh0cmEuaWQpO1xcXFxuICAgICAgICAgICAgICAgICAgICBvbGRJZHMuZm9yRWFjaCh4ID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtb2RlID09ICcwJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oeCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwid2ViUnVsZTovL1xcXFxcXFwiICsgeCArIFxcXFxcXFwiQFxcXFxcXFwiICsgJC5sd2ViKCcwJyksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc0xvYWRpbmdJbmplY3Q6IHRydWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogeCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlzJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLm00YScsICcubXAzJywgJy5mbHYnLCAnLmF2aScsICcuM2dwJywgJy5tcGVnJywgJy53bXYnLCAnLm1vdicsICcucm12YicsICcuZ2lmJywgJy5qcGVnJywgJy5wbmcnLCAnLmljbycsICcuc3ZnJ11cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1vZGUgPT0gJzEnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJ2aWRlbzovL1xcXFxcXFwiICsgeCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB4LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW9kZSA9PSAnMicpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHgsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB4ICsgJCgnJykubGF6eVJ1bGUoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2xhenlUb1g1P3J1bGU9ZG3nm5LlrZAnKS52aWRlb1g1KCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHgsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5cycsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgncGFyc2UnLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogc3RvcmFnZTAuZ2V0SXRlbSgn5ZeF5o6iJywgJ1dlYuWXheaOoicpLFxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5YiH5ZeF5o6i5pa55byP5Li6OicgKyBpbnB1dDtcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICB9LCBwYXJzZXR5cGUpLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBpZDogJ3BhcnNlJyxcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG5cXFxcbiAgICAgICAgZDIudW5zaGlmdCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxzbWFsbD7imqHvuI8nICsgZHVybCArICc8L3NtYWxsPicsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcXFxuICAgICAgICAgICAgdXJsOiBkdXJsLFxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgXFxcXG4gICAgICAgIFxcXFxuICAgICAgICBpZihNWV9QQVJBTVMud2ViPT1cXFxcXFxcIuWTlOa7tOW9seinhlxcXFxcXFwiKXtcXFxcbiAgICAgICAgICAgIGQyLnVuc2hpZnQoe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiflk5Tmu7TlvbHop4YnLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXG4gICAgICAgICAgICAgICAgdXJsOlxcXFxcXFwiaGlrZXI6Ly9wYWdlL2RldGFpbHM/cnVsZT3lk5TlmIDlvbHop4YmdXJsPVxcXFxcXFwiICsgZHVybCsnI2ltbWVyc2l2ZVRoZW1lIycsXFxcXG4gICAgICA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4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fNScsXFxcXG4gICAgICAgICAgICBpbWc6IGltZ3NbaV0sXFxcXG4gICAgICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKChpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ3BhZ2VfaW5kZXgnLCBpKVxcXFxuICAgICAgICAgICAgICAgIC8vY2xlYXJNeVZhcignc291JylcXFxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdwYWdlJylcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouaIkOWKnydcXFxcbiAgICAgICAgICAgIH0sIGkpLFxcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG5cXFxcbiAgICB2YXIgd2ViID0gZ2V0SXRlbSgnd2ViJywgJzAnKVxcXFxuICAgIC8vbG9nKHdlYilcXFxcbiAgICB2YXIgdGl0bGUgPSAnJ1xcXFxuICAgIHN3aXRjaCAod2ViKSB7XFxcXG4gICAgICAgIGNhc2UgJzAnOlxcXFxuICAgICAgICAgICAgdGl0bGUgPSAnV2Vi5ZeF5o6iJ1xcXFxuICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgIGNhc2UgJzEnOlxcXFxuICAgICAgICAgICAgdGl0bGUgPSAn6KeG6aKR5ZeF5o6iJ1xcXFxuICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgIGNhc2UgJzInOlxcXFxuICAgICAgICAgICAgdGl0bGUgPSAnZG3nm5LlrZAnXFxcXG4gICAgICAgICAgICBicmVhaztcXFxcbiAgICB9XFxcXG4gICAgc2V0SXRlbSgn5ZeF5o6iJywgdGl0bGUpXFxcXG5cXFxcbiAgICBkLnB1c2goe1xcXFxuIC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BicmVhaztcXFxcbiAgICAgICAgICAgICAgICBjYXNlICcxJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgnd2ViJywgJzInKVxcXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICBjYXNlICcyJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgnd2ViJywgJzAnKVxcXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgIH0pLFxcXFxuICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJmbGV4X2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgaWQ6ICdwYXJzZXQnXFxcXG4gICAgICAgIH1cXFxcbiAgICB9LCB7XFxcXG4gICAgICAgIHRpdGxlOiAn5qih5p2/OicgKyAoZ2V0SXRlbSgnYWknLCAnMCcpID09ICcwJyA/ICflhbPpl60nIDogJ+W8gOWQrycpLFxcXFxuICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJmbGV4X2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKCgpID0+IHtcXFxcbiAgICAgICAgICAgIGlmIChnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnKSB7XFxcXG4gICAgICAgICAgICAgICAgc2V0SXRlbSgnYWknLCAnMScpXFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oJ2FpJywgJzAnKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXF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9IGl0ZW0uc3BsaXQoJy0nKVsxXVxcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMTAucG5nJ1xcXFxuICAgICAgICB9KVxcXFxuXFxcXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCBgYm9keSYmLmxpc3QtaGVhZGVyOm1hdGNoZXMoJHt0fSkrKiYmYWApXFxcXG5cXFxcbiAgICAgICAgbGlzdC5tYXAoeCA9PiB7XFxcXG4gICAgICAgICAgICB2YXIgbmFtZSA9IHBkZmgoeCwgJy5wb3N0ZXItaXRlbS10aXRsZSYmVGV4dCcpXFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcXFxuICAgICAgICAgICAgICAgIGltZzogcGRmaCh4LCAnaW1nJiZzcmMnKSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKChuKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwic291XFxcXFxcXCIsIG4pXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUpXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcblxcXFxuICAgIFsn54Ot6Zeo55S15b2xLeeUteW9sScsICfng63pl6jnlLXop4bliact55S16KeG5YmnJywgJ+eDremXqOe7vOiJui3nu7zoibonLCAn54Ot6Zeo5Yqo5ryrLeWKqOa8qyddLm1hcCh4ID0+I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FxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJhdmF0YXJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBpdC5zaXRlX2ljb24sXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmcm9tOiAnaG9tZScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IG5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3ZWI6IGl0LnNpdGVfbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcXFxuICAgICAgICAgICAgICAgIC8vYWRkSXRlbUFmdGVyKGlkLCBsaXN0KTtcXFxcbiAgICAgICAgICAgICAgICBkID0gZC5jb25jYXQobGlzdCk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIHNldFJlc3VsdChkKVxcXFxufVxcXFxuXFxcXG5sZXQgciA9IFxcXFxcXFwiXFxcXFxcXCI7XFxcXG5pZiAocyAhPSBcXFxcXFxcIlxcXFxcXFwiKSB7XFxcXG5cXFxcbiAgICBqc29uID0gXFxcXFxcXCJodHRwczovL2FwaS54aWFtbS5jYzo5ODk3L21vdmllL2dldHNlYXJjaGxpc3Qva2V5d29yZHMvXFxcXFxcXCIgK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0IGh0bWwgPSBmZXRjaCh1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhodG1sKVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dCA9IHBkZmgoaHRtbCwgXFxcXFxcXCJib2R5JiYjX19ORVhUX0RBVEFfXyYmSHRtbFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9sb2codGV4dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBlcmppID0gSlNPTi5wYXJzZSh0ZXh0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coZXJqaSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsaXN0ID0gZXJqaS5wcm9wcy5wYWdlUHJvcHMuZGF0YS5wbGF5RGF0YTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdCAmJiBsaXN0Lmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVlfVVJMID0gXFxcXFxcXCJcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cmFwXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS90b29sP3J1bGU9XFxcXFxcXCIgKyBydWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IGl0LmRhdGFfdXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcXFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXFxcXFwiICsgcnVsZSArIFxcXFxcXFwiJnU9XFxcXFxcXCIgKyBiYXNlNjRFbmNvZGUodSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC5zaXRlX25hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJhdmF0YXJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXQuc2l0ZV9pY29uLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogaWQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbTogJ2hvbWUnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZWI6IGl0LnNpdGVfbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICA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ICAgICB0aXRsZTogbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiB4LmhvdF9pbWdfdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiB4LmhvdF9yYXRlLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKChuLCB1KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcInNvdVxcXFxcXFwiLCBuKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2R1cmwnLCB1KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxuICAgICAgICAgICAgICAgICAgICB9LCBuYW1lLCB4LmhvdF91cmwpXFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH1cXFxcblxcXFxuICAgICAgICBbJ+eDremXqOeUteW9sSNpbmRleC1nZXRNb3ZpZUxpc3QtbW92aWUnLCAn54Ot6Zeo5Ymn6ZuGI2luZGV4LWdldFR2TGlzdC10di0yOCddLm1hcCh4ID0+IHtcXFxcbiAgICAgICAgICAgIHNldExpc3RzKHgpXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxuICAgIGlmIChwaW5kZXggPT0gXFxcXFxcXCIxXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgXFxcXG4gICAgICAgIHZhciB0eXBlcyA9IHtcXFxcbiAgICAgICAgICAgIFxcXFxcXFwidGFnXFxcXFxcXCI6IFtcXFxcXFxcIuexu+WeizowXFxcXFxcXCIsIFxcXFxcXFwi5Zac5YmnOjFcXFxcXFxcIiwgXFxcXFxcXCLniLHmg4U6MlxcXFxcXFwiLCBcXFxcXFxcIuWlh+W5uzo0XFxcXFxcXCIsIFxcXFx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yMDE5OjRcXFxcXFxcIiwgXFxcXFxcXCIyMDEw5bm05LujOjVcXFxcXFxcIiwgXFxcXFxcXCIyMDAw5bm05LujOjZcXFxcXFxcIiwgXFxcXFxcXCI5MOW5tOS7ozo3XFxcXFxcXCIsIFxcXFxcXFwiODDlubTku6M6OFxcXFxcXFwiLCBcXFxcXFxcIjcw5bm05LujOjlcXFxcXFxcIiwgXFxcXFxcXCI2MOW5tOS7ozoxMFxcXFxcXFwiLCBcXFxcXFxcIuabtOaXqToxMVxcXFxcXFwiXSxcXFxcbiAgICAgICAgICAgIFxcXFxcXFwic29ydFxcXFxcXFwiOiBbXFxcXFxcXCLnu7zlkIjmjpLluo86MVxcXFxcXFwiLCBcXFxcXFxcIui/keacn+eDreW6pjoyXFxcXFxcXCIsIFxcXFxcXFwi6auY5YiG5LyY5YWIOjNcXFxcXFxcIl1cXFxcbiAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgIHZhciBvanNvbiA9IFt7XFxcXG4gICAgICAgICAgICBuYW1lOiAn55S15b2xJyxcXFxcbiAgICAgICAgICAgIGlkOiAnbW92aWUnLFxcXFxuICAgICAgICAgICAgY29udGVudDogdHlwZXNcXFxcbiAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgbmFtZTogJ+eUteinhuWJpycsXFxcXG4gICAgICAgICAgICBpZDogJ3R2JyxcXFxcbiAgICAgICAgICAgIGNvbnRlbnQ6IHR5cGVzXFxcXG4gICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgIG5hbWU6ICfliqjmvKsnLFxcXFxuICAgICAgICAgICAgaWQ6ICdhbmltZScsXFxcXG4gICAgICAgICAgICBjb250ZW50OiB0eXBlc1xcXFxuICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICBuYW1lOiAn57u86Im6JyxcXFxcbiAgICAgICAgICAgIGlkOiAndmFyaWV0eScsXFxcXG4gICAgICAgICAgICBjb250ZW50OiB0eXBlc1xcXFxuICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICBuYW1lOiAn57qq5b2V54mHJyxcXFxcbiAgICAgICAgICAgIGlkOiAnZG9jdW1lbnRhcnknLFxcXFxuICAgICAgICAgICAgY29udGVudDogdHlwZXNcXFxcbiAgICAgICAgfV1cXFxcblxcXFxuICAgICAgICB2YXIg5aSn57G7ID0gW107XFxcXG4gICAgICAgIG9qc29uLm1hcCh4ID0+IHtcXFxcbiAgICAgICAgICAgIOWkp+exuy5wdXNoKHgubmFtZSArIFxcXFxcXFwiQFxcXFxcXFwiICsgeC5pZCk7XFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIHZhciBpbmRleCA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXFxcXFwiaW5kZXhcXFxcXFxcIiwgJzAnKTtcXFxcbiAgICAgICAgdmFyIGogPSBvanNvbltpbmRleF07XFxcXG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMoai5jb250ZW50KTtcXFxcblxcXFxuICAgICAgICB2YXIgdGVtcCA9IHt9O1xcXFxuICAgICAgICBrZXlzLmZvckVhY2goeCA9PiB7XFxcXG4gICAgICAgICAgICB2YXIgdHlwZSA9IHg7XFxcXG4gICAgICAgICAgICB2YXIgbCA9IGouY29udGVudFt4XTtcXFxcbiAgICAgICAgICAgIGlmIChbJ3ZlcnNpb24nXS5pbmNsdWRlcyh4KSkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVyblxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKGwubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgIHZhciBucyA9IGwubWFwKChrKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBuYW1lID0gay5zcGxpdCgnOicpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgaWQgPSBrLnNwbGl0KCc6JylbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnbmFtZSc6IG5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G4gICAgICAgXFxcXG5cXFxcbiAgICAgICAgdmFyIGxpc3QgPSBqc29uLmRhdGFbdF0ucmVjb3JkcztcXFxcblxcXFxuICAgICAgICBsaXN0Lm1hcCh4ID0+IHtcXFxcbiAgICAgICAgICAgIHZhciBuYW1lID0geC50aXRsZTtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxcXG4gICAgICAgICAgICAgICAgaW1nOiB4LmNvdmVyLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6IHgucmF0ZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKChuKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwic291XFxcXFxcXCIsIG4pXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUpXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcblxcXFxuICAgIFsn54Ot5pKt55S15b2xLWxpc3RIb3RNb3ZpZScsICfng63mkq3nlLXop4bliactbGlzdEhvdFR2JywgJ+eDreaSreWKqOa8qy1saXN0SG90Q29taWMnLCAn54Ot5pKt57u86Im6LWxpc3RIb3RWYXJpZXR5J10ubWFwKHggPT4ge1xcXFxuICAgICAgICBzZXRMaXN0cyh4KVxcXFxuICAgIH0pXFxcXG59XFxcIn0se1xcXCJjb2xfdHlwZVxcXCI6XFxcIm1vdmllXzNcXFwiLFxcXCJuYW1lXFxcIjpcXFwi5Ye95pWwMlxcXCIsXFxcInBhdGhcXFwiOlxcXCJ6dG9vbHNcXFwiLFxcXCJydWxlXFxcIjpcXFwianM6XFxcXG4vL3VybOino+aekFxcXFxuZnVuY3Rpb24gdXJsUGFy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XFxcXFxcImR1b3NlbGVjdFxcXFxcXFwiKSA6IFtdO1xcXFxuICAgICAgICBpZiAoZHVvc2VsZWN0LmZpbmRJbmRleCh4ID0+IHgudXJsID09PSBkYXRhdXJsKSA9PSAtMSkge1xcXFxuICAgICAgICAgICAgZHVvc2VsZWN0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBkYXRhdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBkYXRhdXJsXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgZHVvc2VsZWN0ID0gdW5pcXVlKGR1b3NlbGVjdClcXFxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oZGF0YXVybCwge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBg4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjojRkY1NzMzXFxcXFxcXCI+YCArIGRhdGF0aXRsZVxcXFxuICAgICAgICAgICAgICAgIC8vdGl0bGU6YOKAmOKAmGArZGF0YXRpdGxlK2DigJnigJlgXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIHJlbW92ZUJ5VmFsdWUoYXJyLCB2YWwpIHtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoYXJyW2ldWyd1cmwnXSA9PSB2YWwpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5zcGxpY2UoaSwgMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJlbW92ZUJ5VmFsdWUoZHVvc2VsZWN0L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xuICAgICAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXFxcXFwiaHRtbDBcXFxcXFxcIiwgaHRtbCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5wYXJzZUxhenlSdWxlQXN5bmMoJCQkKCkubGF6eVJ1bGUoKHJ1bGUsIHVybCwgYW5jaG9ySWQsIG1vYmFuKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gZ2V0VmFyKFxcXFxcXFwiaHRtbDBcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGl1cmwgPSAnJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhclZhcihcXFxcXFxcImh0bWwwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKCd1cmw6JyArIHVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLnN0YXJ0c1dpdGgoJ2h0dHBzOi8vY3VwZm94LmFwcC9wYWdlP3VybD0nKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYmFzZXVybCA9IHVybC5yZXBsYWNlKC8uK3VybD0oLio/KSYuKy9nbSwgJyQxJylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXVybCA9IGJhc2U2NERlY29kZShiYXNldXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2lmcmFtZScsIGl1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnaXVybDonICsgaXVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl1cmwubGVuZ3RoID4gMCA/IFxcXFxcXFwiMVxcXFxcXFwiIDogXFxcXFxcXCIwXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHJ1bGUsIGxvY2F0aW9uLmhyZWYsIGFuY2hvcklkLCBtb2JhbiksICQkJC50b1N0cmluZygocnVsZSxtb2JhbikgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9mYmEubG9nKGlucHV0KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9mYmEubG9nKHJ1bGUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXFxcXFxcXCIwXFxcXFxcXCIgPT0gaW5wdXQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2hlY2tjID0gd2luZG93LmNoZWNrYyArIDE7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAod2luZG93LmNoZWNrYyA+IDEyMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXFxcXFwi5omn6KGM6LaF6L+HMzDnp5LvvIzml6Dms5Xop6PmnpBcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsqL1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQod2luZG93LmNoZWNrMCwgMjUwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL31cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVybCA9IGZiYS5nZXRWYXIoJ2lmcmFtZScpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coJ21vYmFuJyttb2JhbilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihtb2Jhbj09JzEnKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsPXVybCsnI2ltbWVyc2l2ZVRoZW1lIydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ICAgICAgXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyh1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiBydWxlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+W9seeJh+ivpuaDhScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVSdWxlOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlczogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9wYWdlL3A/cnVsZT0nICsgcnVsZSArICcmdT0nICsgdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5kUnVsZTogXFxcXFxcXCJcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2hlY2t1cmwgPSBsb2NhdGlvbi5ocmVmO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2t1MCgpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdpbmRvdy5jaGVja3VybCAhPSBsb2NhdGlvbi5ocmVmKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2hhc2jlj5HnlJ/kuoblj5jljJZcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmNoZWNrYyA9IDA7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2swKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAyMDAwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoY2hlY2t1MCwgMjUwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja3UwKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0scnVsZSxtb2JhbikpO1xcXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhlLnRvU3RyaW5nKCkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KHdpbmRvdy5jaGVjazAsIDI1MCk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgd2luZG93LmN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ICAgdGl0bGU6IHBkZmgoaHRtbCwgJ2g0JiZUZXh0JyksXFxcXG4gICAgICAgICAgICBpbWc6IHBkKGh0bWwsICdpbWcmJnNyYycpLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycsXFxcXG4gICAgICAgICAgICBkZXNjOiBwZGZoKGh0bWwsICdib2R5JiYucHViVGltZSYmVGV4dCcpLFxcXFxuICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGlkOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuXFxcXG5cXFxcbiAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsICcubW92aWVaeSYmYScpXFxcXG4gICAgICAgIGlmIChsaXN0ICYmIGxpc3QubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBNWV9VUkwgPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIGxldCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIG1lcmdlXFxcXG4gICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS90b29sP3J1bGU9XFxcXFxcXCIgKyBydWxlKTtcXFxcbiAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsICdhJiZocmVmJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJ3VsJiZUZXh0Jyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBcXFxcXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcXFxcXCIgKyBydWxlICsgXFxcXFxcXCImdT1cXFxcXFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdSA9IGdldEl0ZW0oJ2FpJywgJzAnKSA9PSAnMCcgPyB1IDogdSArICcjaW1tZXJzaXZlVGhlbWUjJ1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG1lcmdlKHQsICfor6bmg4UnLCAxKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vd3d3LjcyNTk5OC5jb20vc3RhdGljL3NlYXJjaC9pbWFnZXMvb25MaW5lLnBuZycsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJhdmF0YXJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IHVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tOiAnaG9tZScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICBkID0gZC5jb25jYXQobGlzdClcXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfml6DotY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IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IGlucHV0O1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSB1cmw7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gZmV0Y2godXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsICcubW92aWVaeSYmYScpXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0ICYmIGxpc3QubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNWV9VUkwgPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lcmdlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS90b29sP3J1bGU9XFxcXFxcXCIgKyBydWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsICdhJiZocmVmJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJ3VsJiZUZXh0Jyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFxcXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcXFxcXCIgKyBydWxlICsgXFxcXFxcXCImdT1cXFxcXFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGdldEl0ZW0oJ2FpJywgJzAnKSA9PSAnMCcgPyB1IDogdSArICcjaW1tZXJzaXZlVGhlbWUjJ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG1lcmdlKHQsICfor6bmg4UnLCAxKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vd3d3LjcyNTk5OC5jb20vc3RhdGljL3NlYXJjaC9pbWFnZXMvb25MaW5lLnBuZycsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJhdmF0YXJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IHVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tOiAnaG9tZScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoaWQsIGxpc3QpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfml6DotYTmupAnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0sIE1ZX1JVTEUudGl0bGUsIHVybCwgcyksXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGlkOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcblxcXFxuICAgIHNldFJlc3VsdChkKVxcXFxufSBlbHNlIHtcXFxcblxcXFxufVxcXFxuXFxcXG5pZiAoZ2V0SXRlbSgnaG9tZScsICflhbMnKSA9PSAn5byAJykge1xcXFxuICAgIGZ1bmN0aW9uIHNldExpc3RzKGl0ZW0pIHtcXFxcbiAgICAgICAgTVlfVVJMID0gJ2h0dHBzOi8vd3d3LjcyNTk5OC5jb20vJztcXFxcbiAgICAgICAgdmFyIHRpdGxlID0gaXRlbS5zcGxpdCgnIycpWzBdXFxcXG4gICAgICAgIHZhciBrZXkgPSBpdGVtLnNwbGl0KCcjJylb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gICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL3Rvb2w/cnVsZT1cXFxcXFxcIiArIHJ1bGUpO1xcXFxuICAgICAgICAgICAgXFxcXG4gICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgJ2EmJmhyZWYnKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdCA9IHBkZmgoaXQsICdsaSwwJiZUZXh0Jyk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHdlYj1wZGZoKGl0LCAnbGksMSYmVGV4dCcpO1xcXFxuICAgICAgICAgICAgICAgIHUgPSBcXFxcXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcXFxcXCIgKyBydWxlICsgXFxcXFxcXCImdT1cXFxcXFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXFxcbiAgICAgICAgICAgICAgICB1ID0gZ2V0SXRlbSgnYWknLCAnMCcpID09ICcwJyA/IHUgOiB1ICsgJyNpbW1lcnNpdmVUaGVtZSMnXFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHdyYXAxKHdlYisnLScrdCwgcyksXFxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vd3d3LjcyNTk5OC5jb20vc3RhdGljL3NlYXJjaC9pbWFnZXMvb25MaW5lLnBuZycsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImF2YXRhclxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFx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2ltZyYmZGF0YS11cmwnKTtcXFxcbiAgICAgICAgaWYgKGltZyA9PSBcXFxcXFxcIlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICBpbWcgPSBcXFxcXFxcImh0dHBzOi8vd3d3LmRpYW55aW5nZ291LmNvbS9WaWV3L2ltYWdlcy9ibGFua19iZy5wbmdcXFxcXFxcIjtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsZXQgdXJsID0gcGQoaXQsICdhJiZocmVmJyk7XFxcXG4gICAgICAgIGxldCBkZXNjID0gcGRmYShpdCwgJ2JvZHkmJi5pbmZvJiZhJykubWFwKHggPT4gcGRmaCh4LCAnYSYmVGV4dCcpKS5qb2luKCcgJyk7XFxcXG4gICAgICAgIGxldCBzY29yZSA9IHBkZmgoaXQsICcubm9TY29yZSYmVGV4dCcpO1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IHdyYXAobmFtZSwgcyksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJyxcXFxcbiAgICAgICAgICAgIGltZzogaW1nLFxcXFxuICAgICAgICAgICAgZGVzYzogJ+ivhOWIhjonICsgc2NvcmUgKyAnXFxcXFxcXFxuJyArIGRlc2MsXFxcXG4gICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocnVsZSwgdXJsLCBzLCBuYW1lKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGNscyA9IGZpbmRJdGVtc0J5Q2xzKHVybCk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKCEhY2xzKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyh1cmwpXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IGlucHV0O1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSB1cmw7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gZmV0Y2goYGh0dHBzOi8vd3d3LmRpYW55aW5nZ291LmNvbS9TcGlkZXJNb3ZpZS96eS8ke25hbWV9YCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICd4LXJlcXVlc3RlZC13aXRoJzogJ1hNTEh0dHBSZXF1ZXN0J1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsICcubW92aWVaeSYmYScpXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0ICYmIGxpc3QubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNWV9VUkwgPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyYXAxXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS90b29sP3J1bGU9XFxcXFxcXCIgKyBydWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsICdhJiZocmVmJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJ2xpLDAmJlRleHQnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHdlYj1wZGZoKGl0LCAnbGksMSYmVGV4dCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcXFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXFxcXFwiICsgcnVsZSArIFxcXFxcXFwiJnU9XFxcXFxcXCIgKyBiYXNlNjRFbmNvZGUodSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB3cmFwMSh3ZWIrJy0nK3QsIHMpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly93d3cuNzI1OTk4LmNvbS9zdGF0aWMvc2VhcmNoL2ltYWdlcy9vbkxpbmUucG5nJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImF2YXRhclxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTp0LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdlYjp3ZWIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoaWQsIGxpc3QpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSwgTVlfUlVMRS50aXRsZSwgdXJsLCBzLCBuYW1lKSxcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgaWQ6IHVybCxcXFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxuXFxcXG4gICAgc2V0UmVzdWx0KGQpXFxcXG59IGVsc2Uge1xcXFxuXFxcXG59XFxcXG5cXFxcbmlmIChnZXRJdGVtKCdob21lJywgJ+WFsycpID09ICflvIAnKSB7XFxcXG4gICAgZnVuY3Rpb24gc2V0TGlzdHMoaXRlbSkge1xcXFxuICAgICAgICBNWV9VUkwgPSAnaHR0cHM6Ly93d3cuZGlhbnlpbmdnb3UuY29tLyc7XFxcXG4gICAgICAgIHZhciB0aXRsZSA9IGl0ZW0uc3BsaXQoJyMnKVswXVxcXFxuICAgICAgICB2YXIga2V5ID0gaXRlbS5zcGxpdCgnIycpWzFdXFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG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aCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxcXG4gICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogc2NvcmUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobiwgdSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcInNvdVxcXFxcXFwiLCBuKVxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZHVybCcsIHUpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUsIHVybClcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxuXFxcXG4gICAgZnVuY3Rpb24gaG9tZSgpIHtcXFxcbiAgICAgICAgWyfnlLXlvbEjbW92aWUnLCAn55S16KeG5YmnI3R2JywgJ+e6quW9leeJhyNkb2MnLCAn5Yqo5ryrI2NvbWljJ10ubWFwKHggPT4ge1xcXFxuXFxcXG4gICAgICAgICAgICBzZXRMaXN0cyh4KVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcbiAgICBcXFxcbiAgICB2YXIgcGFnZT1NWV9QQUdFO1xcXFxuICAgIGxldCB0cnVlX3VybCA9IGdldE15VmFyKE1ZX1JVTEUudXJsLCBNWV9VUkwpO1xcXFxuICAgIGlmKHBhZ2U+MSl7XFxcXG4gICAgICAgIC8vbG9nKHRydWVfdXJsKVxcXFxuICAgICAgICB0cnVlX3VybD10cnVlX3VybCtgL3BhZ2VfJHtwYWdlfS5odG1sYFxcXFxuICAgICAgICAvL2xvZyh0cnVlX3VybClcXFxcbiAgICB9XFxcXG4gICAgdmFyIGh0bWwgPWZldGNoKHRydWVfdXJ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gICAgICAgICAgICAgICByZXR1cm4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogd3JhcDEod2ViICsgJy0nICsgdCwgcyksXFxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJhdmF0YXJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiB0LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgd2ViOiB3ZWIsXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGQgPSBkLmNvbmNhdChsaXN0KVxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBzZXRSZXN1bHQoZClcXFxcbn1cXFxcbnMgPSBnZXRNeVZhcihcXFxcXFxcInNvdVxcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbmxldCByID0gXFxcXFxcXCJcXFxcXFxcIjtcXFxcbmlmIChzICE9IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICB2YXIgcGFnZSA9IE1ZX1BBR0U7XFxcXG4gICAgTVlfVVJMID0gYGh0dHBzOi8vd3d3LnRic2R5LmNvbS9zZWFyY2guaHRtbD9rZXl3b3JkPSR7c30mcGFnZWQ9JHtwYWdlfSZjYXRlZ29yeT1gO1xcXFxuICAgIC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HtcXFxcbiAgICAgICAgICAgIHRpdGxlOiB3cmFwKG5hbWUsIHMpLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycsXFxcXG4gICAgICAgICAgICBpbWc6IGltZyxcXFxcbiAgICAgICAgICAgIGRlc2M6ICfor4TliIY6JyArIHNjb3JlICsgJ1xcXFxcXFxcbuS4u+a8lDonICsgZGVzYyxcXFxcbiAgICAgICAgICAgIHVybDogJCh1cmwpLmxhenlSdWxlKChydWxlLCB1cmwsIHMsIG5hbWUpID0+IHtcXFxcblxcXFxuICAgICAgICAgICAgICAgIHZhciBjbHMgPSBmaW5kSXRlbXNCeUNscyh1cmwpO1xcXFxuICAgICAgICAgICAgICAgIGlmICghIWNscykge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHModXJsKVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBpbnB1dDtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gdXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKHVybCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBQQ19VQVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgJ2JvZHkmJi52aWRlb19kb3dubG9hZF9saW5rX2l0ZW0nKVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdCAmJiBsaXN0Lmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVlfVVJMID0gdXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyYXAxXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS90b29sP3J1bGU9XFxcXFxcXCIgKyBydWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsICdhJiZocmVmJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJy52aWRlb19kb3dubG9hZF9saW5rX25hbWVfdGV4dCYmVGV4dCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgd2ViID0gcGRmaChpdCwgJy5yZXNvdXJjZV93ZWJzaXRlX25hbWUmJlRleHQnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGltZyA9IHBkKGl0LCAnLnZpZGVvX2xhYmVscyYmaW1nJiZzcmMnKTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcXFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXFxcXFwiICsgcnVsZSArIFxcXFxcXFwiJnU9XFxcXFxcXCIgKyBiYXNlNjRFbmNvZGUodSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB3cmFwMSh3ZWIgKyAnLScgKyB0LCBzKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYXZhdGFyXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiB0LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdlYjogd2ViLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCBsaXN0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcb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+IHtcXFxcbiAgICAgICAgICAgIHZhciBuYW1lID0gcGRmaCh4LCAnLnJlc291cmNlX25hbWUmJlRleHQnKVxcXFxuICAgICAgICAgICAgbGV0IGltZyA9IHBkKHgsICcucmVzb3VyY2VfcG9zdGVycyYmZGF0YS11cmwnKTtcXFxcbiAgICAgICAgICAgIGlmIChpbWcgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIGltZyA9IFxcXFxcXFwiXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBsZXQgdXJsID0gcGQoeCwgJ2EmJmhyZWYnKTtcXFxcblxcXFxuICAgICAgICAgICAgbGV0IHNjb3JlID0gcGRmaCh4LCAnLnVwZGF0ZV90aXB8fC5yZXNvdXJjZV9zY29yZXx8aW1nJiZUZXh0Jyk7XFxcXG5cXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxcXG4gICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogc2NvcmUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobiwgdSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcInNvdVxcXFxcXFwiLCBuKVxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZHVybCcsIHUpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUsIHVybClcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxuXFxcXG4gICAgW3tcXFxcbiAgICAgICAgbmFtZTogJ+eDremXqOeUteinhuWJpycsXFxc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