Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_全网@base64://LyoKLy8gQG1hdGNoICAgICAgICAqOi8vKi5tZ3R2LmNvbS8qCi8vIEBtYXRjaCAgICAgICAgKjovL3R2LnNvaHUuY29tLyoKLy8gQG1hdGNoICAgICAgICAqOi8vZmlsbS5zb2h1LmNvbS8qCi8vIEBtYXRjaCAgICAgICAgKjovLyouMTkwNS5jb20vKgovLyBAbWF0Y2ggICAgICAgICo6Ly8qLmJpbGliaWxpLmNvbS8qCi8vIEBtYXRjaCAgICAgICAgKjovLyoucHB0di5jb20vKgovLyBAbWF0Y2ggICAgICAgICo6Ly9pdGVtLnRhb2Jhby5jb20vKgovLyBAbWF0Y2ggICAgICAgICo6Ly9zLnRhb2Jhby5jb20vKgovLyBAbWF0Y2ggICAgICAgICo6Ly9jaGFvc2hpLmRldGFpbC50bWFsbC5jb20vKgovLyBAbWF0Y2ggICAgICAgICo6Ly9kZXRhaWwudG1hbGwuY29tLyoKLy8gQG1hdGNoICAgICAgICAqOi8vZGV0YWlsLnRtYWxsLmhrLyoKLy8gQG1hdGNoICAgICAgICAqOi8vaXRlbS5qZC5jb20vKgovLyBAbWF0Y2ggICAgICAgICo6Ly8qLnlpeWFvamQuY29tLyoKLy8gQG1hdGNoICAgICAgICAqOi8vbnBjaXRlbS5qZC5oay8qCi8vIEBtYXRjaCAgICAgICAgKjovLyoubGlhbmd4aW55YW8uY29tLyoKLy8gQG1hdGNoICAgICAgICAqOi8vbXVzaWMuMTYzLmNvbS8qCi8vIEBtYXRjaCAgICAgICAgKjovL3kucXEuY29tLyoKLy8gQG1hdGNoICAgICAgICAqOi8vKi5rdWdvdS5jb20vKgovLyBAbWF0Y2ggICAgICAgICo6Ly8qLmt1d28uY24vKgovLyBAbWF0Y2ggICAgICAgICo6Ly8qLnhpbWFsYXlhLmNvbS8qCi8vIEBtYXRjaCAgICAgICAgKjovLyouemhpaHUuY29tLyoKL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sibmFtZSI6IkLnq5kxIiwidXJsIjoiaHR0cHM6Ly9qeC5qc29ucGxheWVyLmNvbS9wbGF5ZXIvP3VybD0ifSwKICAgICAgICAgICAgeyJuYW1lIjoi54ix6LGGIiwidXJsIjoiaHR0cHM6Ly9qeC5haWRvdWVyLm5ldC8/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiJDSG9rIiwidXJsIjoiaHR0cHM6Ly93d3cuZ2FpNC5jb20vP3VybD0ifSwKICAgICAgICAgICAgeyJuYW1lIjoiT0siLCJ1cmwiOiJodHRwczovL29ranguY2MvP3VybD0ifSwKICAgICAgICAgICAgeyJuYW1lIjoiUkRISyIsInVybCI6Imh0dHBzOi8vangucmRoay5uZXQvP3Y9In0sCiAgICAgICAgICAgIHsibmFtZSI6IuS6uuS6uui/tyIsInVybCI6Imh0dHBzOi8vanguYmxiby5jYzo0NDMzLz91cmw9In0sCiAgICAgICAgICAgIHsibmFtZSI6IuaAneWPpDMiLCJ1cmwiOiJodHRwczovL2pzYXAuYXR0YWtpZHMuY29tLz91cmw9In0sCiAgICAgICAgICAgIHsibmFtZSI6IuWQrOS5kCIsInVybCI6Imh0dHBzOi8vanguZGo2dS5jb20vP3VybD0ifSwKICAgICAgICBdOwogCiAgICAgICAgbGV0IHVzZVdlYiA9IFsnbS5iaWxpYmlsaS5jb20nLCd5b3VrdS5jb20nLCd3d3cueW91a3UuY29tJywnbS55b3VrdS5jb20nLCdtLnYucXEuY29tJywnbS5pcWl5aS5jb20nLCdtLm1ndHYuY29tJywnbS50di5zb2h1LmNvbScsJ20uMTkwNS5jb20nLCdtLnBwdHYuY29tJywnbS5sZS5jb20nXTsKIAogICAgICAgIGlmKHVzZVdlYi5pbmRleE9mKGxvY2F0aW9uLmhvc3QpID09IC0xKXsKICAgICAgICAgICAgY29uc29sZS5sb2coJ+S4jeaYr+W6lOeUqOe9keermScpO3JldHVybjsKICAgICAgICB9CiAKICAgICAgICBmdW5jdGlvbiBzZXRDb29raWUoY25hbWUsY3ZhbHVlLGV4ZGF5cyl7CiAKICAgICAgICAgICAgdmFyIGQgPSBuZXcgRGF0ZSgpOwogCiAgICAgICAgICAgIGQuc2V0VGltZShkLmdldFRpbWUoKSsoZXhkYXlzKjI0KjYwKjYwKjEwMDApKTsKIAogICAgICAgICAgICB2YXIgZXhwaXJlcyA9ICJleHBpcmVzPSIrZC50b0dNVFN0cmluZygpOwogCiAgICAgICAgICAgIGRvY3VtZW50LmNvb2tpZSA9IGNuYW1lKyI9IitjdmFsdWUrIjsgIitleHBpcmVzOwogICAgICAgIH0KIAogICAgICAgIGZ1bmN0aW9uIGdldENvb2tpZShjbmFtZSl7CiAgICAgICAgICAgIHZhciBuYW1lID0gY25hbWUgKyAiPSI7CiAgICAgICAgICAgIHZhciBjYSA9IGRvY3VtZW50LmNvb2tpZS5zcGxpdCgnOycpOwogICAgICAgICAgICBmb3IodmFyIGk9MDsgaTxjYS5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgdmFyIGMgPSBjYVtpXS50cmltKCk7CiAgICAgICAgICAgICAgICBpZiAoYy5pbmRleE9mKG5hbWUpPT0wKSB7IHJldHVybiBjLnN1YnN0cmluZyhuYW1lLmxlbmd0aCxjLmxlbmd0aCk7IH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gIiI7CiAgICAgICAgfQogCiAgICAgICAgZnVuY3Rpb24gY3JlYXRlRWxlbWVudChkb20sZG9tSWQpewogCiAgICAgICAgICAgIHZhciByb290RWxlbWVudCA9IGRvY3VtZW50LmJvZHk7CiAKICAgICAgICAgICAgdmFyIG5ld0VsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KGRvbSk7CiAKICAgICAgICAgICAgbmV3RWxlbWVudC5pZCA9IGRvbUlkOwogCiAgICAgICAgICAgIHZhciBuZXdFbGVtZW50SHRtbENvbnRlbnQgPSBkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZSgnJyk7CiAKICAgICAgICAgICAgcm9vdEV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9tLnN0eWxlLm9wYWNpdHkgPSAnMCc7CiAKICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7IGRvY3VtZW50LmJvZHkucmVtb3ZlQ2hpbGQodG9hc3REb20pIH0sIGQgKiAxMDAwKTsKIAogICAgICAgICAgICB9LCBkdXJhdGlvbik7CiAKICAgICAgICB9CiAKICAgICAgICBmdW5jdGlvbiBwbGF5VmlkZW9GdW5jKCl7CiAgICAgICAgICAgIC8vY3NzCiAgICAgICAgICAgIGxldCBwbGF5VmlkZW9TdHlsZSA9IGAKICAgICAgICAgICAgLnpobV9wbGF5X3ZpZG9lX2ljb257CiAgICAgICAgICAgICAgICBwYWRkaW5nLXRvcDoycHg7Y3Vyc29yOnBvaW50ZXI7CiAgICAgICAgICAgICAgICB6LWluZGV4Ojk5OTk5OTk7CiAgICAgICAgICAgICAgICBkaXNwbGF5OmJsb2NrOwogICAgICAgICAgICAgICAgcG9zaXRpb246Zml4ZWQ7bGV0OjBweDt0b3A6MzYwcHg7dGV4dC1hbGlnbjpjZW50ZXI7b3ZlcmZsb3c6dmlzaWJsZTsKICAgICAgICAgICAgfQogICAgICAgICAgICAuemhtX3BsYXlfdmlkZW9fd3JhcHsKICAgICAgICAgICAgICAgIHBvc2l0aW9uOmZpeGVkO2xlZnQ6NDBweDt0b3A6MzYwcHg7CiAgICAgICAgICAgICAgICB6LWluZGV4Ojk5OTk5OTk7CiAgICAgICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuOwogICAgICAgICAgICAgICAgd2lkdGg6MzAwcHg7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX2xpbmV7CiAgICAgICAgICAgICAgICB3aWR0aDozMjBweDsKICAgICAgICAgICAgICAgIGhlaWdodDozMTZweDsKICAgICAgICAgICAgICAgIG92ZXJmbG93LXk6c2Nyb2xsOwogICAgICAgICAgICAgICAgb3ZlcmZsb3cteDpoaWRkZW47CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVfbGluZV91bHsKICAgICAgICAgICAgICAgIHdpZHRoOjMwMHB4OwogICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDsKICAgICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogZmxleC1zdGFydDsKICAgICAgICAgICAgICAgIGZsZXgtZmxvdzogcm93IHdyYXA7CiAgICAgICAgICAgICAgICBsaXN0LXN0eWxlOiBub25lOwogICAgICAgICAgICAgICAgcGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICBtYXJnaW46MHB4OwogCiAgICAgICAgICAgIH0KICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGl7CiAgICAgICAgICAgICAgICBwYWRkaW5nOjRweCAwcHg7CiAgICAgICAgICAgICAgICBtYXJnaW46MnB4OwogICAgICAgICAgICAgICAgd2lkdGg6MzAlOwogICAgICAgICAgICAgICAgY29sb3I6I0ZGRjsKICAgICAgICAgICAgICAgIHRleHQtYWxpZ246Y2VudGVyOwogICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZjI0NDQzOwogICAgICAgICAgICAgICAgYm94LXNoYWRvdzowcHggMHB4IDEwcHggI2ZmZjsKICAgICAgICAgICAgICAgIGZvbnQtc2l6ZToxNHB4OwogICAgICAgICAgICB9CiAgICAgICAgICAgIC56aG1fcGxheV92aWRlb19saW5lX3VsX2xpOmhvdmVyewogICAgICAgICAgICAgICAgY29sb3I6IzI2MDAzMzsKICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2ZjYzBjMAogICAgICAgICAgICB9CiAgICAgICAgICAgIC56aG1fbGluZV9zZWxlY3RlZHsKICAgICAgICAgICAgICAgIGNvbG9yOiMyNjAwMzM7CiAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiNmY2MwYzAKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIC56aG1fcGxheV92aWRlb19qeHsKICAgICAgICAgIC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AogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIjai1wbGF5ZXIiLG5vZGVUeXBlOidpZCcsbWF0Y2g6L21cLmxlXC5jb21cL3ZwbGF5LyxhcmVhQ2xhc3NOYW1lOidqdWppJ30sCiAKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIiwgbm9kZToiI3BsYXllciIsbm9kZVR5cGU6J2lkJyxtYXRjaDovcGxheVwudHVkb3VcLmNvbVwvdl9zaG93XC9pZF8vfSwKIAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIjcHB0dl9wbGF5cGFnZV9ib3giLG5vZGVUeXBlOidpZCcsbWF0Y2g6L3ZcLnBwdHZcLmNvbVwvc2hvd1wvL30sCiAKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIiwgbm9kZToiI3BsYXllciIsbm9kZVR5cGU6J2lkJyxtYXRjaDovdmlwXC4xOTA1LmNvbVwvcGxheVwvL30sCiAKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIiwgbm9kZToiI3ZvZFBsYXllciIsbm9kZVR5cGU6J2lkJyxtYXRjaDovd3d3XC4xOTA1LmNvbVwvdm9kXC9wbGF5XC8vfSwKICAgICAgICAgICAgXTsKIAogICAgICAgICAgICAvL+WIm+W7umxvZ29faWNvbgogICAgICAgICAgICBjcmVhdGVFbGVtZW50KCdkaXYnLCd6aG1JY29uJyk7CiAKICAgICAgICAgICAgbGV0IHpobVBsYXkgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnemhtSWNvbicpOwogCiAgICAgICAgICAgIHpobVBsYXkuaW5uZXJIVE1MID0gcGxheVdyYXBIdG1sOwogCiAgICAgICAgICAgIGxldCBqeFZpZGVvV2ViID0ganhWaWRlb0RhdGEuZmlsdGVyKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICByZXR1cm4gbG9jYXRpb24uaHJlZi5tYXRjaChpdGVtLm1hdGNoKTsKIAogICAgICAgICAgICB9KQogCiAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aG1sb2dvJykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgIGxldCBqeFZpZGVvV2ViID0ganhWaWRlb0RhdGEuZmlsdGVyKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxvY2F0aW9uLmhyZWYubWF0Y2goaXRlbS5tYXRjaCk7CiAKICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgIGlmKGp4VmlkZW9XZWIubGVuZ3RoID09IDApewogCiAgICAgICAgICAgICAgICAgICAgdG9hc3QoJ+ivt+WcqOinhumikeaSreaUvumhteeCueWHu+WbvuaghycpOwogCiAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgIHZhciB7ZnVuY05hbWUsbWF0Y2g6bm93TWF0Y2gsbm9kZTpub3dOb2RlLG5hbWU6bm93TmFtZX0gPSBqeFZpZGVvV2ViWzBdOwogCiAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlMaW5lRGl2ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnpobV9wbGF5X3ZpZGVvX3dyYXAnKTsKIAogICAgICAgICAgICAgICAgICAgIGxldCBwbGF5U2hvdyA9IHBsYXlMaW5lRGl2LnN0eWxlLmRpc3BsYXk7CiAKICAgICAgICAgICAgICAgICAgICBwbGF5U2hvdyA9PSAnbm9uZSc/IHBsYXlMaW5lRGl2LnN0eWxlLmRpc3BsYXkgPSAnYmxvY2snOnBsYXlMaW5lRGl2LnN0eWxlLmRpc3BsYXkgPSAnbm9uZSc7CiAKICAgICAgICAgICAgICAgICAgICB2YXIgcGxheUxpbmVUZCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5wbGF5TGluZVRkJyk7CiAKICAgICAgICAgICAgICAgICAgICBwbGF5TGluZVRkLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheUxpbmVUZC5mb3JFYWNoKGZ1bmN0aW9uKGUpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5zZXRBdHRyaWJ1dGUoJ2NsYXNzJywncGxheUxpbmVUZCB6aG1fcGxheV92aWRlb19saW5lX3VsX2xpJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEF0dHJpYnV0ZSgnY2xhc3MnLCdwbGF5TGluZVRkIHpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGkgemhtX2xpbmVfc2VsZWN0ZWQnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0Q29va2llKCdwbGF5TGluZUFjdGlvbicsdGhpcy5nZXRBdHRyaWJ1dGUoJ3VybCcpLDMwKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vd1dlYk5vZGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKG5vd05vZGUpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihub3dXZWJOb2RlKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vd1dlYk5vZGUuaW5uZXJIVE1MID0gcGxheUp4SHRtbDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwbGF5SWZyYW1lID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3BsYXlJZnJhbWUnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlJZnJhbWUuc3JjPSBpdGVtLmdldEF0dHJpYnV0ZSgndXJsJykrbG9jYXRpb24uaHJlZjsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn6KeG6aKR572R56uZ57uT54K55LiN5a2Y5ZyoJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9TZWxlY3QgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuJytqeFZpZGVvV2ViWzBdLmFyZWFDbGFzc05hbWUpOwogCiAgICAgICAgICAgICAgICAgICAgdmlkZW9TZWxlY3QuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKGUpewogCiAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYXRpb24uaHJlZj1sb2NhdGlvbi5ocmVmOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0sMTAwMCkKIAogICAgICAgICAgICAgICAgICAgIH0pOwogCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgbGV0IHRpbWVyID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgbGV0IGp4VmlkZW9XZWIgPSBqeFZpZGVvRGF0YS5maWx0ZXIoZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICByZXR1cm4gbG9jYXRpb24uaHJlZi5tYXRjaChpdGVtLm1hdGNoKTsKIAogICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgaWYoanhWaWRlb1dlYi5sZW5ndGg+MCl7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9TZWxlY3QgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuJytqeFZpZGVvV2ViWzBdLmFyZWFDbGFzc05hbWUpOwogCiAgICAgICAgICAgICAgICAgICAgaWYodmlkZW9TZWxlY3QpewogCiAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvU2VsZWN0LmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbihlKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZyhlLnRhcmdldC5wYXJlbnROb2RlLmhyZWYpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmPWxvY2F0aW9uLmhyZWY7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sMTAwMCkKIAogICAgICAgICAgICAgICAgICAgICAgICB9KTsKIAogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgIH0sMTAwMCkKIAogICAgICAgIH0KIAogICAgICAgIHBsYXlWaWRlb0Z1bmMoKTsKIAogICAgfWVsc2V7CiAgICAgICAgLyotLWNvbmZpZy0tKi8KICAgICAgICB2YXIgQ29uZmlnID17CiAKICAgICAgICBjb3Vwb25Vcmw6d2luZG93LmxvY2F0aW9uLmhyZWYsCiAKICAgICAgICBjb3Vwb25Ib3N0OndpbmRvdy5sb2NhdGlvbi5ob3N0LAogCiAgICAgICAgd2ViVXJsOidodHRwOi8vbXVzaWMubGl1emhpamluLmNuLycsCiAKICAgICAgICBpY29uVmlwVG9wOjM2MCwKIAogICAgICAgIGljb25WaXBQb3NpdGlvbiA6ICdsZWZ0JywKIAogICAgICAgIGljb25WaXBXaWR0aCA6IDQwLAogCiAgICAgICAgY291cG9uVG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KICAgICAgICAgICAgc2VsZWN0ZWRMZWZ0LAogICAgICAgICAgICBzZWxlY3RlZFJpZ2h0LAogICAgICAgICAgICB2aWRlb1BsYXlMaW5lQWRkLAogICAgICAgICAgICBkeVZpZGVvRG93bmxvYWQsCiAgICAgICAgICAgIGtzVmlkZW9Eb3dubG9hZCwKICAgICAgICAgICAgeGlndWFWaWRlb0Rvd25sb2FkLAogICAgICAgICAgICBiaWxpVmlkZW9Eb3dubG9hZCwKICAgICAgICAgICAgeW91dHViZVZpZGVvRG93bmxvYWQKICAgICAgICB9ID0gQ29uZmlnOwogICAgICAgIC8qLS1sYW5nLS0qLwogICAgICAgIHZhciBsYW5nID0gewogICAgICAgICAgICBzZXQ6J+iuvue9ricsCiAgICAgICAgICAgIGljb25Qb3NpdGlvbjon5Zu+5qCH5L2N572uJywKICAgICAgICAgICAgcGxheVZpZGVvOifop4bpopHop6PmnpAnLAogICAgICAgICAgICBwbGF5TXVzaWM6J+mfs+S5kOS4i+i9vScsCiAgICAgICAgICAgIHpoTmljZTon55+l5LmO5aKe5by6JywKICAgICAgICAgICAgdmlkZW9Eb3dubG9hZDon6KeG6aKR5LiL6L29JywKICAgICAgICAgICAgYmFpZHVEb3dubG9hZDon55m+5bqm5LiL6L29JywKICAgICAgICAgICAgaWNvbkhlaWdodDon5Zu+5qCH6auY5bqmJywKICAgICAgICAgICAgaWNvbldpZHRoOiflm77moIflpKflsI8nLAogICAgICAgICAgICBpY29uTGluZTon5rC05bmz5L2N572uJywKICAgICAgICAgICAgaWNvbldhaXRUaW1lOifnrYnlvoXml7bpl7QnLAogICAgICAgICAgICBpY29uTGVmdDon6Z2g5bemJywKICAgICAgICAgICAgaWNvblJpZ2h0OifpnaDlj7MnLAogICAgICAgICAgICB0aXBJY29uSGVpZ2h0Oifpu5jorqQzNjAs5bu66K6uMX41MDAnLAogICAgICAgICAgICB0aXBJY29uV2lkdGg6J+m7mOiupDQwLOW7uuiurjIwfjUwJywKICAgICAgICAgICAgdGlwSWNvbk9wYWNpdHk6J+ivt+Whq+WGmTAtMTAw55qE5pW05pWwJywKICAgICAgICAgICAgdGlwRXJyb3JJY29uSGVpZ2h0Oic85Zu+5qCH5L2N572uPuS4reeahDzlm77moIfpq5jluqY+5bqU5Li6MTAwMOS7peWGheato+aVtOaVsO+8jOW7uuiurjF+NTAwJywKICAgICAgICAgICAgdGlwRXJyb3JJY29uV2lkdGg6Jzzlm77moIfkvY3nva4+5Lit55qEPOWbvuagh+Wkp+Wwjz7lupTkuLoxMDDku6XlhoXmraPmlbTmlbDvvIzlu7rorq4yMH41MCcsCiAgICAgICAgICAgIHRpcEVycm9ySWNvbk9wYWNpdHk6J+Whq+WGmeaVsOWtl+S4jeato+ehricsCiAgICAgICAgICAgIHNldFBsYXlWaWRlbzon6Kej5p6Q6K6+572uJywKICAgICAgICAgICAgcGxheVZpZGVvTGluZUFkZDon56uZ5aSW6Kej5p6QJywKICAgICAgICAgICAgdGlwUGxheVZpZGVvTGluZUFkZDon6K+35aGr5YWl57q/6Lev5ZCN56ew5ZKM5Zyw5Z2A77yM5Lit6Ze055So5Y2K6KeS6YCX5Y+36ZqU5byA77yM5q+P57q/6Lev5LiA6KGM44CCJywKICAgICAgICAgICAgemhTZXQ6J+efpeS5juiuvue9ricsCiAgICAgICAgICAgIHpoVmlkZW9DbG9zZTon5bGP6JS96KeG6aKRJywKICAgICAgICAgICAgemhWaWRlb0Rvd25sb2FkOifop4bpopHkuIvovb0nLAogICAgICAgICAgICB6aEFEQ2xvc2U6J+Wxj+iUveW5v+WRiicsCiAgICAgICAgICAgIHpoQ2xvc2VMZWZ0OiflhbPpl63kvqfovrnmoI8nLAogICAgICAgICAgICB6aENoYW5nZUxpbms6J+mTvuaOpeebtOaOpei3s+i9rCcsCiAgICAgICAgICAgIHNwZWNpYWxDb2x1bW46J+agh+iusOaWh+eroCcsCiAgICAgICAgICAgIHZpZGVvVGl0bGU6J+agh+iusOinhumikScsCiAgICAgICAgICAgIHpoS2V5d29yZENsb3NlOiflsY/olL3lhbPplK7or40nLAogICAgICAgICAgICB0aXBLZXl3b3JkOifor7fovpPlhaXlhbPplK7or40s55SoIiwi5Y+36ZqU5byAJywKICAgICAgICAgICAgYXV0aG9yTmFtZUNsb3NlOiflsY/olL3nlKjmiLcnLAogICAgICAgICAgICB0aXBBdXRob3JOYW1lOifor7fovpPlhaXnlKjmiLflkI0s55SoIiwi5Y+36ZqU5byAJywKICAgICAgICAgICAgeWFueHVhbkNsb3NlOiflsY/olL3nm5DpgIknLAogICAgICAgICAgICBkeVZpZGVvRG93bmxvYWQ6J+aKlumfs+S4i+i9vScsCiAgICAgICAgICAgIGtzVmlkZW9Eb3dubG9hZDon5b+r5omL5LiL6L29JywKICAgICAgICAgICAgeGlndWFWaWRlb0Rvd25sb2FkOifopb/nk5zkuIvovb0nLAogICAgICAgICAgICBiaWxpVmlkZW9Eb3dubG9hZDonQuermSAoYmlsaWJpbGkpIOS4i+i9vScsCiAgICAgICAgICAgIHlvdXR1YmVWaWRlb0Rvd25sb2FkOid5b3V0dWJl5LiL6L29JywKICAgICAgICB9OwogCiAgICAgICAgLyotLWRhdGFzLS0qLwogICAgICAgIHZhciBkYXRhcyA9IHsKIAogICAgICAgICAgICBnZXRDb3Vwb246W3tpc09wZW46MjIsd2ViOlsKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToiY291cG9uIixuYW1lOiJ0YW9iYW8iLG5vZGU6Ii5KX0xpbmtBZGQiLG1hdGNoOi9pdGVtXC50YW9iYW9cLmNvbS99LAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJjb3Vwb24iLG5hbWU6InRtYWxsQ2Fvc2hpIixub2RlOiIjSl9MaW5rQnV5IixtYXRjaDovXmh0dHBzPzpcL1wvY2hhb3NoaS5kZXRhaWwudG1hbGwuY29tXC8vfSwKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToiY291cG9uIixuYW1lOiJ0bWFsbENhb3NoaSIsbm9kZToiLkFjdGlvbnMtLWxlZnRCdXR0b25zLS0xTTNLa0Y3IixtYXRjaDovXmh0dHBzPzpcL1wvY2hhb3NoaS5kZXRhaWwudG1hbGwuY29tXC8vfSwKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToiY291cG9uIixuYW1lOiJ0bWFsbCIsbm9kZToiLkJhc2ljQ29udGVudC0tYWN0aW9ucy0tMWNvOHN4OCIsbWF0Y2g6L15odHRwcz86XC9cL2RldGFpbFwudG1hbGxcLmNvbS99LAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJjb3Vwb24iLG5hbWU6InRtYWxsIixub2RlOiIjSl9MaW5rQnV5IixtYXRjaDovXmh0dHBzPzpcL1wvZGV0YWlsXC50bWFsbFwuY29tL30sCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6ImNvdXBvbiIsbmFtZToidG1hbGxPdGhlciIsbm9kZToiLnRtLW1zZy1ib3giLG1hdGNoOi9eaHR0cHM/OlwvXC9kZXRhaWxcLnRtYWxsXC5jb20vfSwKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToiY291cG9uIixuYW1lOiJ0bWFsbCIsbm9kZToiI0pfTGlua0J1eSIsbWF0Y2g6L15odHRwcz86XC9cL2RldGFpbFwudG1hbGxcLmhrL30sCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6ImNvdXBvbiIsbmFtZToiamQiLG5vZGU6IiNjaG9vc2UtYnRucyIsbWF0Y2g6L2l0ZW1cLmpkXC5jb20vfSwKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToiY291cG9uIixuYW1lOiJqZCIsbm9kZToiI2Nob29zZS1idG5zIixtYXRjaDovXC55aXlhb2pkXC5jb20vfSwKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToiY291cG9uIixuYW1lOiJqZCIsbm9kZToiI2Nob29zZS1idG5zIixtYXRjaDovbnBjaXRlbVwuamRcLmhrL30sCiAgICAgICAgICAgIF19XSwKICAgICAgICAgICAganhWaWRlbzpbe2lzT3BlbjpHTV9nZXRWYWx1ZSgnbW92aW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3d1wuYmlsaWJpbGlcLmNvbS99LAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBtYXRjaDovXmh0dHBzPzpcL1wvbVwuYmlsaWJpbGlcLmNvbS99LAogCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6InBsYXlWaWRlbyIsIG5vZGU6Ii52aWRlby1hcmVhIixub2RlVHlwZTonY2xhc3MnLG1hdGNoOi9tXC5tZ3R2XC5jb21cL2IvfSwKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIiwgbWF0Y2g6L21ndHZcLmNvbS8sYXJlYUNsYXNzTmFtZTonZXBpc29kZS1pdGVtcyBjbGVhcmZpeCd9LAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIueC1jb3Zlci1wbGF5YnRuLXdyYXAiLG5vZGVUeXBlOidjbGFzcycsbWF0Y2g6Ly50dlwuc29odVwuY29tL30sCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6InBsYXlWaWRlbyIsIG5vZGU6Ii54LWNvdmVyLXBsYXlidG4td3JhcCIsbm9kZVR5cGU6J2NsYXNzJyxtYXRjaDovbVwudHZcLnNvaHVcLmNvbS99LAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIjcGxheWVyV3JhcCIsbm9kZVR5cGU6J2lkJyxtYXRjaDovZmlsbVwuc29odVwuY29tL30sCiAKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIiwgbWF0Y2g6L3R1ZG91XC5jb20vfSwKIAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLG1hdGNoOi9sZVwuY29tL30sCiAKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIixtYXRjaDovcHB0dlwuY29tL30sCiAKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheVZpZGVvIixtYXRjaDovMTkwNVwuY29tL30sCiAKICAgICAgICAgICAgXX1dLAogCiAgICAgICAgICAgIGp4TXVzaWM6W3tpc09wZW46R01fZ2V0VmFsdWUoJ211c2ljTGlzdCcsJzIyJyksd2ViOlsKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheU11c2ljIixuYW1lOiduZXRlYXNlJyxtYXRjaDovXmh0dHBzPzpcL1wvbXVzaWNcLjE2M1wuY29tLyx0aXA6J+ivt+WcqOmfs+S5kOWNleabsumhteeCueWHu+Wbvuagh+S4i+i9vSd9LAogCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6InBsYXlNdXNpYyIsbmFtZToncXEnLG1hdGNoOi9eaHR0cHM/OlwvXC95XC5xcVwuY29tLyx0aXA6J+ivt+eCueWHu+aSreaUvumcgOimgeS4i+i9veeahOatjOabsu+8jOWcqOaSreaUvumhteeCueWHu+Wbvuagh+S4i+i9vSd9LAogCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6InBsYXlNdXNpYyIsbmFtZTona3Vnb3UnLG1hdGNoOi9rdWdvdVwuY29tLyx0aXA6J+ivt+eCueWHu+aSreaUvumcgOimgeS4i+i9veeahOatjOabsu+8jOeEtuWQjuWcqOe9kemhteS4i+aWueaSreaUvuWZqOWGheeCueWHuyLkuIvovb0iJ30sCiAKICAgICAgICAgICAgICAgIHtmdW5jTmFtZToicGxheU11c2ljIixuYW1lOidrdXdvJyxtYXRjaDova3V3b1wuY24vLHRpcDon6K+354K55Ye75pKt5pS+6ZyA6KaB5LiL6L2955qE5q2M5puy77yM54S25ZCO5Zyo572R6aG15LiL5pa55pKt5pS+5Zmo5YaF54K55Ye7IuS4i+i9vSInfSwKIAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5TXVzaWMiLG5hbWU6J3hpbWFsYXlhJyxtYXRjaDovXmh0dHBzPzpcL1wvd3d3XC54aW1hbGF5YVwuY29tLyx0aXA6J+ivt+eCueWHu+aSreaUvumcgOimgeS4i+i9veeahOatjOabsu+8jOeEtuWQjuWcqOe9kemhteS4i+aWueaSreaUvuWZqOWGheeCueWHuyLkuIvovb0iJ30KICAgICAgICAgICAgXX1dLAogCiAgICAgICAgICAgIHBsYXlMaW5lOlsKICAgICAgICAgICAgICAgIHsibmFtZSI6Iue6r+WHgDEiLCJ1cmwiOiJodHRwczovL2ltMTkwNy50b3AvP2p4PSIsIm1vYmlsZSI6MX0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiJC56uZMSIsInVybCI6Imh0dHBzOi8vanguanNvbnBsYXllci5jb20vcGxheWVyLz91cmw9IiwibW9iaWxlIjoxfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IueIseixhiIsInVybCI6Imh0dHBzOi8vanguYWlkb3Vlci5uZXQvP3VybD0iLCJtb2JpbGUiOjF9LAogICAgICAgICAgICAgICAgeyJuYW1lIjoiQkwiLCJ1cmwiOiJodHRwczovL3ZpcC5ibGppZXguY29tLz92PSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiLlhrDosYYiLCJ1cmwiOiJodHRwczovL2FwaS5xaWFucWkubmV0L3ZpcC8/dXJsPSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiLnmb7ln58iLCJ1cmwiOiJodHRwczovL2p4LjYxOGcuY29tLz91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IkNLIiwidXJsIjoiaHR0cHM6Ly93d3cuY2twbGF5ZXIudmlwL2ppZXhpLz91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IkNIb2siLCJ1cmwiOiJodHRwczovL3d3dy5nYWk0LmNvbS8/dXJsPSIsIm1vYmlsZSI6MX0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiJja21vdiIsInVybCI6Imh0dHBzOi8vd3d3LmNrbW92LnZpcC9hcGkucGhwP3VybD0iLCJtb2JpbGUiOjB9LAogICAgICAgICAgICAgICAgeyJuYW1lIjoiSDgiLCJ1cmwiOiJodHRwczovL3d3dy5oOGp4LmNvbS9qaWV4aS5waHA/dXJsPSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiJKWSIsInVybCI6Imh0dHBzOi8vangucGxheWVyankuY29tLz91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6Iuino+aekCIsInVybCI6Imh0dHBzOi8vY2ttb3YuY2N5ampkLmNvbS9ja21vdi8/dXJsPSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiLop6PmnpBsYSIsInVybCI6Imh0dHBzOi8vYXBpLmppZXhpLmxhLz91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IuiAgeadvyIsInVybCI6Imh0dHBzOi8vdmlwLmxhb2JhbmRxLmNvbS9qaWV4aS5waHA/dXJsPSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiJNQU8iLCJ1cmwiOiJodHRwczovL3d3dy5tdG9zei5jb20vbTN1OC5waHA/dXJsPSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiJNM1U4IiwidXJsIjoiaHR0cHM6Ly9qeC5tM3U4LnR2L2ppZXhpLz91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IuivuuiuryIsInVybCI6Imh0dHBzOi8vd3d3Lm54Zmx2LmNvbS8/dXJsPSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiJPSyIsInVybCI6Imh0dHBzOi8vb2tqeC5jYy8/dXJsPSIsIm1vYmlsZSI6MX0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiJQTSIsInVybCI6Imh0dHBzOi8vd3d3LnBsYXltM3U4LmNuL2ppZXhpLnBocD91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IuebmOWPpCIsInVybCI6Imh0dHBzOi8vd3d3LnBhbmd1amlleGkuY2MvamlleGkucGhwP3VybD0iLCJtb2JpbGUiOjB9LAogICAgICAgICAgICAgICAgeyJuYW1lIjoi5LiD5ZOlIiwidXJsIjoiaHR0cHM6Ly9qeC5ubnh2LmNuL3R2LnBocD91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IlJESEsiLCJ1cmwiOiJodHRwczovL2p4LnJkaGsubmV0Lz92PSIsIm1vYmlsZSI6MX0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiLkurrkurrov7ciLCJ1cmwiOiJodHRwczovL2p4LmJsYm8uY2M6NDQzMy8/dXJsPSIsIm1vYmlsZSI6MX0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiLmgJ3kupEiLCJ1cmwiOiJodHRwczovL2p4LmFwMnAuY24vP3VybD0iLCJtb2JpbGUiOjB9LAogICAgICAgICAgICAgICAgeyJuYW1lIjoi5oCd5Y+kMyIsInVybCI6Imh0dHBzOi8vanNhcC5hdHRha2lkcy5jb20vP3VybD0iLCJtb2JpbGUiOjF9LAogICAgICAgICAgICAgICAgeyJuYW1lIjoi5ZCs5LmQIiwidXJsIjoiaHR0cHM6Ly9qeC5kajZ1LmNvbS8/dXJsPSIsIm1vYmlsZSI6MX0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiLnu7TlpJoiLCJ1cmwiOiJodHRwczovL2p4Lml2aXRvLmNuLz91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IuiZvuexsyIsInVybCI6Imh0dHBzOi8vangueG1mbHYuY29tLz91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IuS6keerryIsInVybCI6Imh0dHBzOi8vc2IuNWdzZW8ubmV0Lz91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IuS6keaekCIsInVybCI6Imh0dHBzOi8vangueXBhcnNlLmNvbS9pbmRleC5waHA/dXJsPSIsIm1vYmlsZSI6MH0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiIwNTIzIiwidXJsIjoiaHR0cHM6Ly9nby55aDA1MjMuY24veS5jeT91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IjE35LqRIiwidXJsIjoiaHR0cHM6Ly93d3cuMTcxN3l1bi5jb20vangvdHkucGhwP3VybD0iLCJtb2JpbGUiOjB9LAogICAgICAgICAgICAgICAgeyJuYW1lIjoiMTgwIiwidXJsIjoiaHR0cHM6Ly9qeC4wMDAxODAudG9wL2p4Lz91cmw9IiwibW9iaWxlIjowfSwKICAgICAgICAgICAgICAgIHsibmFtZSI6IjRLIiwidXJsIjoiaHR0cHM6Ly9qeC40a2R2LmNvbS8/dXJsPSIsIm1vYmlsZSI6MX0sCiAgICAgICAgICAgICAgICB7Im5hbWUiOiI4MDkwIiwidXJsIjoiaHR0cHM6Ly93d3cuODA5MGcuY24vP3VybD0iLCJtb2JpbGUiOjB9CiAgICAgICAgICAgIF0sCiAKICAgICAgICAgICAgemhOaWNlOlt7aXNPcGVuOkdNX2dldFZhbHVlKCd6aGlodUxpc3QnLCcyMicpLHdlYjpbCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6J3poTmljZScsbWF0Y2g6L15odHRwcz86XC9cL1thLXpdK1wuemhpaHVcLmNvbS99CiAgICAgICAgICAgIF19XSwKICAgICAgICAgICAgdGFvYmFvOlt7aXNPcGVuOkdNX2dldFZhbHVlKCd0YW9iYW8nLCcyMicpLHdlYjpbCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6J3Rhb2Jhb1NlYXJjaCcsbWF0Y2g6L15odHRwcz86XC9cL3NcLnRhb2Jhb1wuY29tXC9zZWFyY2hcPy4rL30KICAgICAgICAgICAgXX1dLAogCiAgICAgICAgICAgIHZpZGVvRG93bmxvYWQ6W3tpc09wZW46R01f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6J0wnfSwKICAgICAgICAgICAgXSwKIAogICAgICAgICAgICBkb3dubG9hZE9wdGlvbjpbe25hbWU6J+ebtOaOpeS4i+i9vScsaWQ6J3RvRG93bmxvYWQnfSx7bmFtZTon5aSN5Yi26ZO+5o6lJyxpZDondG9Db3B5J30se25hbWU6J+aJk+W8gOaWh+S7ticsaWQ6J3RvTGluayd9XQogCiAgICAgICAgfQogCiAgICAgICAgdmFyIHtnZXRDb3Vwb24sanhWaWRlbyxqeE11c2ljLHBsYXlMaW5lLHpoTmljZSx0YW9iYW8sdmlkZW9Eb3dubG9hZCxrZXlDb2RlLGRvd25sb2FkT3B0aW9uLGJhaWR1fSA9IGRhdGFzOwogCiAgICAgICAgLyotLUNsYXNzLS0qLwogICAgICAgIGNsYXNzIEJhc2VDbGFzc3sKIAogICAgICAgICAgICBjb25zdHJ1Y3RvcigpewogCiAgICAgICAgICAgICAgICBpZihHTV9nZXRWYWx1ZSgnaWNvblBvc2l0aW9uU2V0UGFnZScpICE9IDApewogCiAgICAgICAgICAgICAgICAgICAgaWNvblZpcFRvcCA9IEdNX2dldFZhbHVlKCdpY29uVG9wJykgfHwgR01fZ2V0VmFsdWUoJ2ljb25Ub3AnKSA9PSAwP0dNX2dldFZhbHVlKCdpY29uVG9wJyk6aWNvblZpcFRvcDsKIAogICAgICAgICAgICAgICAgICAgIGljb25WaXBQb3NpdGlvbiA9IEdNX2dldFZhbHVlKCdpY29uUG9zaXRpb24nKT9HTV9nZXRWYWx1ZSgnaWNvblBvc2l0aW9uJyk6aWNvblZpcFBvc2l0aW9uOwogCiAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWRMZWZ0ID0gaWNvblZpcFBvc2l0aW9uPT0nbGVmdCc/J3NlbGVjdGVkJzonJzsKIAogICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkUmlnaHQgPSBpY29uVmlwUG9zaXRpb249PSdyaWdodCc/J3NlbGVjdGVkJzonJzsKIAogICAgICAgICAgICAgICAgICAgIGljb25WaXBXaWR0aCA9IEdNX2dldFZhbHVlKCdpY29uV2lkdGgnKT9HTV9nZXRWYWx1ZSgnaWNvbldpZHRoJyk6aWNvblZpcFdpZHRoOwogCiAgICAgICAgICAgICAgICAgICAgaWNvbldhaXRUaW1lID0gR01fZ2V0VmFsdWUoJ2ljb25XYWl0VGltZScpP0dNX2dldFZhbHVlKCdpY29uV2FpdFRpbWUnKSoxMDAwOmljb25XYWl0VGltZTsKIAogICAgICAgICAgICAgICAgICAgIGljb25WaXBPcGFjaXR5ID0gR01fZ2V0VmFsdWUoJ2ljb25PcGFjaXR5JykgfHwgR01fZ2V0VmFsdWUoJ2ljb25PcGFjaXR5JykgPT0gMD9HTV9nZXRWYWx1ZSgnaWNvbk9wYWNpdHknKTppY29uVmlwT3BhY2l0eTsKIAogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICBHTV9yZWdpc3Rlck1lbnVDb21tYW5kKCLorr7nva4iLCAoKSA9PiB0aGlzLm1lbnVTZXQoKSk7CiAKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIG1lbnVTZXQoKXsKIAogICAgICAgICAgICAgICAgdmFyIF90aGlzID0gdGhpczsKIAogICAgICAgICAgICAgICAgbGV0IG1lbnVTZXRTdHlsZSA9IGAKICAgICAgICAgICAgICAgICAgICAgICAgLnpobU1hc2t7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6LWluZGV4Ojk5OTk5OTk5OTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IzAwMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBmaXhlZDt0b3A6IDA7cmlnaHQ6IDA7Ym90dG9tOiAwO2xlZnQ6IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGFjaXR5OjAuODsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAud3JhcC1ib3h7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6LWluZGV4OjEwMDAwMDAwMDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjpmaXhlZDs7dG9wOiA1MCU7bGVmdDogNTAlO3RyYW5zZm9ybTogdHJhbnNsYXRlKC01MCUsIC0yMDBweCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogMzAwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogIzU1NTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmZmY7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiA1cHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdmVyZmxvdzpoaWRkZW47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb250OjE2cHggbnVtRm9udCxQaW5nRmFuZ1NDLVJlZ3VsYXIsVGFob21hLE1pY3Jvc29mdCBZYWhlaSxzYW5zLXNlcmlmICFpbXBvcnRhbnQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXdlaWdodDo0MDAgIWltcG9ydGFudDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuc2V0V3JhcEhlYWR7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiNmMjQ0NDM7aGVpZ2h0OjQwcHg7Y29sb3I6I2ZmZjt0ZXh0LWFsaWduOmNlbnRlcjtsaW5lLWhlaWdodDo0MHB4OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRXcmFwTGl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW46MHB4O3BhZGRpbmc6MHB4OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRXcmFwTGkgbGl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmZmOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWJvdHRvbToxcHggc29saWQgI2VlZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHggIWltcG9ydGFudDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6MTJweCAyMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjthbGlnbi1pdGVtczogY2VudGVyOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC1zdHlsZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRXcmFwTGlDb250ZW50ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDtqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47YWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuc2V0V3JhcFNhdmV7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjphYnNvbHV0ZTt0b3A6LTJweDtyaWdodDoxMHB4O2ZvbnQtc2l6ZToyNHB4O2N1cnNvcjpwb2ludGVyCiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLmljb25TZXRGb290ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246YWJzb2x1dGU7Ym90dG9tOjBweDtwYWRkaW5nOjEwcHggMjBweDt3aWR0aDoxMDAlOwogICAgICAgICAgICAgICAgICAgICAgICB6LWluZGV4OjEwMDAwMDAwMDk7YmFja2dyb3VuZDojZmVmOWVmOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC5pY29uU2V0Rm9vdExpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luOjBweDtwYWRkaW5nOjBweDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIC5pY29uU2V0Rm9vdExpIGxpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogaW5saW5lLWZsZXg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOjBweCAycHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47YWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTJweDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuaWNvblNldEZvb3RMaSBsaSBhewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6IzU1NTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuaWNvblNldEZvb3RMaSBhOmhvdmVyIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmZTZkNzM7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLmljb25TZXRQYWdlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgei1pbmRleDoxMDAwMDAwMDAxOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246YWJzb2x1dGU7dG9wOjBweDtsZWZ0OjMwMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZDojZmZmOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6MzAwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6MTAwJTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuaWNvblNldFVsSGVhZHsKICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLmljb25TZXRQYWdlSGVhZHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b206MXB4IHNvbGlkICNjY2M7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6NDBweDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OjQwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2ZlNmQ3MzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmZmY7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDE1cHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLmljb25TZXRQYWdlTGl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW46MHB4O3BhZGRpbmc6MHB4OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC5pY29uU2V0UGFnZUxpIGxpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC1zdHlsZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6OHB4IDIwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItYm90dG9tOjFweCBzb2xpZCAjZWVlOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aGlodVNldFBhZ2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6LWluZGV4OjEwMDAwMDAwMDI7cG9zaXRpb246YWJzb2x1dGU7dG9wOjBweDtsZWZ0OjMwMHB4O2JhY2tncm91bmQ6I2ZmZjt3aWR0aDozMDBweDtoZWlnaHQ6MTAwJTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuaWNvblNldFBhZ2VJbnB1dHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXggIWltcG9ydGFudDtqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47YWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuemhpaHVTZXRQYWdlTGl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW46MHB4O3BhZGRpbmc6MHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OjMwMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3cteTogc2Nyb2xsOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAuemhpaHVTZXRQYWdlQ29udGVudHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXggIWltcG9ydGFudDtqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47YWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIC5jaXJjdWxhcnsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiA0MHB4O2hlaWdodDogMjBweDtib3JkZXItcmFkaXVzOiAxNnB4O3RyYW5zaXRpb246IC4zcztjdXJzb3I6IHBvaW50ZXI7Ym94LXNoYWRvdzogMCAwIDNweCAjOTk5IGluc2V0OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC5yb3VuZC1idXR0b257CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogMjBweDtoZWlnaHQ6IDIwcHg7O2JvcmRlci1yYWRpdXM6IDUwJTtib3gtc2hhZG93OiAwIDFweCA1cHggcmdiYSgwLDAsMCwuNSk7dHJhbnNpdGlvbjogLjNzO3Bvc2l0aW9uOiByZWxhdGl2ZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuYmFja3sKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcjogc29saWQgI0ZGRjsgYm9yZGVyLXdpZHRoOiAwIDNweCAzcHggMDsgZGlzcGxheTogaW5saW5lLWJsb2NrOyBwYWRkaW5nOiAzcHg7dHJhbnNmb3JtOiByb3RhdGUoMTM1ZGVnKTsgIC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoMTM1ZGVnKTttYXJnaW4tbGVmdDoxMHB4O2N1cnNvcjpwb2ludGVyOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50by1yaWdodHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbi1sZWZ0OjIwcHg7IGRpc3BsYXk6IGlubGluZS1ibG9jazsgcGFkZGluZzogM3B4O3RyYW5zZm9ybTogcm90YXRlKC00NWRlZyk7IC13ZWJraXQtdHJhbnNmb3JtOiByb3RhdGUoLTQ1ZGVnKTtjdXJzb3I6cG9pbnRlcjsKIAogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC5pY29uU2V0U2F2ZXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZToyNHB4O2N1cnNvcjpwb2ludGVyO21hcmdpbi1yaWdodDo1cHg7bWFyZ2luLWJvdHRvbTo0cHg7Y29sb3I6I0ZGRjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgei1pbmRleDoxMDAwMDAwMDAzOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246YWJzb2x1dGU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6MHB4O2xlZnQ6MzAwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kOiNmZmY7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDozMDBweDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDoxMDAlOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aG1fc2V0X3BhZ2VfaGVhZGVyewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWJvdHRvbToxcHggc29saWQgI2NjYzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDo0MHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6NDBweDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZmU2ZDczOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6I2ZmZjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTVweDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlX2NvbnRlbnR7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4ICFpbXBvcnRhbnQ7anVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO2FsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnpobV9zZXRfcGFnZV9saXN0ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luOjBweDtwYWRkaW5nOjBweDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogMjgwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdmVyZmxvdy15OiBzY3JvbGw7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlX2xpc3Q6Oi13ZWJraXQtc2Nyb2xsYmFyIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8q5rua5Yqo5p2h5pW05L2T5qC35byPKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoIDogMHB4OyAgLyrpq5jlrr3liIbliKvlr7nlupTmqKrnq5bmu5rliqjmnaHnmoTlsLrlr7gqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnpobV9zZXRfcGFnZV9saXN0Ojotd2Via2l0LXNjcm9sbGJhci10aHVtYiB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKua7muWKqOadoemHjOmdouWwj+aWueWdlyovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzICAgOiAycHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmU2ZDczOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aG1fc2V0X3BhZ2VfbGlzdDo6LXdlYmtpdC1zY3JvbGxiYXItdHJhY2sgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLyrmu5rliqjmnaHph4zpnaLovajpgZMqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdyAgIDogaW5zZXQgMCAwIDVweCByZ2JhKDAsIDAsIDAsIDAuMik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kICAgOiAjZWRlZGVkOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogMTBweDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlX2xpc3QgbGl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKmJvcmRlci1ib3R0b206MXB4IHNvbGlkICNjY2M7Ki8KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6MTJweCAyMHB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTpibG9jazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b206MXB4IHNvbGlkICNlZWU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgbGk6bGFzdC1jaGlsZHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b206bm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuemhtX3Njcm9sbHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93LXk6IHNjcm9sbCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aG1fc2Nyb2xsOjotd2Via2l0LXNjcm9sbGJhciB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKua7muWKqOadoeaVtOS9k+agt+W8jyovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA6IDBweDsgIC8q6auY5a695YiG5Yir5a+55bqU5qiq56uW5rua5Yqo5p2h55qE5bC65a+4Ki8KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogMXB4OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aG1fc2Nyb2xsOjotd2Via2l0LXNjcm9sbGJhci10aHVtYiB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKua7muWKqOadoemHjOmdouWwj+aWueWdlyovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzICAgOiAycHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmU2ZDczOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC56aG1fc2Nyb2xsOjotd2Via2l0LXNjcm9sbGJhci10cmFjayB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKua7muWKqOadoemHjOmdoui9qOmBkyovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3gtc2hhZG93ICAgOiBpbnNldCAwIDAgNXB4IHJnYmEoMCwgMCwgMCwgMC4yKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQgICA6ICNlZGVkZWQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiAxMHB4OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC8qLWZvcm0tKi8KICAgICAgICAgICAgICAgICAgICAgICAgOnJvb3QgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLS1iYXNlLWNvbG9yOiAjNDM0YTU2OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLS13aGl0ZS1jb2xvci1wcmltYXJ5OiAjZjdmOGY4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLS13aGl0ZS1jb2xvci1zZWNvbmRhcnk6ICNmZWZlZmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLWdyYXktY29sb3ItcHJpbWFyeTogI2MyYzJjMjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0tZ3JheS1jb2xvci1zZWNvbmRhcnk6ICNjMmMyYzI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLWdyYXktY29sb3ItdGVydGlhcnk6ICM2NzZmNzk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLWFjdGl2ZS1jb2xvcjogIzIyN2M5ZDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0tdmFsaWQtY29sb3I6ICNjMmMyYzI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLWludmFsaWQtY29sb3I6ICNmNzJmNDc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLWludmFsaWQtaWNvbjogdXJsKCJkYXRhOmltYWdlL3N2Zyt4bWw7Y2hhcnNldD11dGY4LCUzQ3N2ZyUyMHhtbG5zJTNEJTIyaHR0cCUzQSUyRiUyRnd3dy53My5vcmclMkYyMDAwJTJGc3ZnJTIyJTIwd2lkdGglM0QlMjIyNCUyMiUyMGhlaWdodCUzRCUyMjI0JTIyJTIwdmlld0JveCUzRCUyMjAlMjAwJTIwMjQlMjAyNCUyMiUzRSUyMCUzQ3BhdGglMjBkJTNEJTIyTTEzLjQxJTIwMTJsNC4zLTQuMjlhMSUyMDElMjAwJTIwMSUyMDAtMS40Mi0xLjQyTDEyJTIwMTAuNTlsLTQuMjktNC4zYTElMjAxJTIwMCUyMDAlMjAwLTEuNDIlMjAxLjQybDQuMyUyMDQuMjktNC4zJTIwNC4yOWExJTIwMSUyMDAlMjAwJTIwMCUyMDAlMjAxLjQyJTIwMSUyMDElMjAwJTIwMCUyMDAlMjAxLjQyJTIwMGw0LjI5LTQuMyUyMDQuMjklMjA0LjNhMSUyMDElMjAwJTIwMCUyMDAlMjAxLjQyJTIwMCUyMDElMjAxJTIwMCUyMDAlMjAwJTIwMC0xLjQyeiUyMiUyMGZpbGwlM0QlMjIlMjNmNzJmNDclMjIlMjAlMkYlM0UlM0MlMkZzdmclM0UiKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dCB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDE2cHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByaWdodDowcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6LWluZGV4OiAwOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC13ZWJraXQtYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC1tb3otYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcjogMXB4IHNvbGlkIHZhcigtLWdyYXktY29sb3ItcHJpbWFyeSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiAzcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDEuN2VtOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDEuNzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiAycHggMWVtOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uOiBiYWNrZ3JvdW5kLWNvbG9yIDAuM3M7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDo1NSU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MTRweDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keTotbXMtaW5wdXQtcGxhY2Vob2xkZXIgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6IHZhcigtLWdyYXktY29sb3Itc2Vjb25kYXJ5KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keTo6LW1vei1wbGFjZWhvbGRlciB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogdmFyKC0tZ3JheS1jb2xvci1zZWNvbmRhcnkpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5OjpwbGFjZWhvbGRlciB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogdmFyKC0tZ3JheS1jb2xvci1zZWNvbmRhcnkpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICosIDo6YWZ0ZXIsIDo6YmVmb3JlIHsKICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNpemluZzogaW5pdGlhbCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5W2RhdGEtaXMtdmFsaWRdIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmctcmlnaHQ6IDFlbTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keVtkYXRhLWlzLXZhbGlkPXRydWVdIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tdmFsaWQtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5W2RhdGEtaXMtdmFsaWQ9ZmFsc2VdIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0taW52YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3gtc2hhZG93OiBpbnNldCAwIDAgMCAxcHggdmFyKC0taW52YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnRleHQtaW5wdXRfX2JvZHk6Zm9jdXMgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1hY3RpdmUtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4IHZhcigtLWFjdGl2ZS1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRsaW5lOiBub25lOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5Oi13ZWJraXQtYXV0b2ZpbGwgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbi1kZWxheTogOTk5OXM7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtd2Via2l0LXRyYW5zaXRpb24tcHJvcGVydHk6IGJhY2tncm91bmQtY29sb3I7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uLXByb3BlcnR5OiBiYWNrZ3JvdW5kLWNvbG9yOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X192YWxpZGF0b3IgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1wb3NpdGlvbjogcmlnaHQgMC41ZW0gY2VudGVyOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1yZXBlYXQ6IG5vLXJlcGVhdDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtc2l6ZTogMS41ZW07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDEwMCU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDEwMCU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6LWluZGV4OiAtMTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keVtkYXRhLWlzLXZhbGlkPWZhbHNlXSArIC50ZXh0LWlucHV0X192YWxpZGF0b3IgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1pbWFnZTogdmFyKC0taW52YWxpZC1pY29uKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0LWJveCB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3gtc2l6aW5nOiBpbmhlcml0OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNnB4OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbjogYmFja2dyb3VuZC1jb2xvciAwLjVzIGVhc2Utb3V0OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6OTBweDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0LWJveDo6YWZ0ZXIgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1ncmF5LWNvbG9yLXNlY29uZGFyeSkgdHJhbnNwYXJlbnQgdHJhbnNwYXJlbnQgdHJhbnNwYXJlbnQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItc3R5bGU6IHNvbGlkOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLXdpZHRoOiA2cHggNHB4IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3R0b206IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAiIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjogYXV0byAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlci1ldmVudHM6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByaWdodDogLTcycHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHotaW5kZXg6IDE7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdC1ib3hfX2JvZHkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNpemluZzogaW5oZXJpdDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC13ZWJraXQtYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC1tb3otYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcjogMXB4IHNvbGlkIHZhcigtLWdyYXktY29sb3ItcHJpbWFyeSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiAzcHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3I6IHBvaW50ZXI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDEuN2VtOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDEuNzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmctbGVmdDogMWVtOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZy1yaWdodDogY2FsYygxZW0gKyAxNnB4KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAxNDAlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOjE0cHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nLXRvcDoycHg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nLWJvdHRvbToycHg7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdC1ib3hfX2JvZHlbZGF0YS1pcy12YWxpZD10cnVlXSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6IHZhcigtLXZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS12YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdC1ib3hfX2JvZHlbZGF0YS1pcy12YWxpZD1mYWxzZV0gewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1pbnZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS1pbnZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0LWJveF9fYm9keS5mb2N1cy12aXNpYmxlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tYWN0aXZlLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS1hY3RpdmUtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0bGluZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAuc2VsZWN0LWJveF9fYm9keTotd2Via2l0LWF1dG9maWxsIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb24tZGVsYXk6IDk5OTlzOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLXdlYmtpdC10cmFuc2l0aW9uLXByb3BlcnR5OiBiYWNrZ3JvdW5kLWNvbG9yOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbi1wcm9wZXJ0eTogYmFja2dyb3VuZC1jb2xvcjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dGFyZWFfX2JvZHkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgLXdlYmtpdC1hcHBlYXJhbmNlOiBub25lOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLW1vei1hcHBlYXJhbmNlOiBub25lOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyOiAxcHggc29saWQgdmFyKC0tZ3JheS1jb2xvci1wcmltYXJ5KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3gtc2l6aW5nOiBib3JkZXItYm94OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9udDogaW5oZXJpdDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXR0ZXItc3BhY2luZzogaW5oZXJpdDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiAxZW07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNpemU6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IDA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uOiBiYWNrZ3JvdW5kLWNvbG9yIDAuNXMgZWFzZS1vdXQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgLnRleHRhcmVhX19ib2R5Om9ubHktY2hpbGQgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzaXplOiB2ZXJ0aWNhbDsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dGFyZWFfX2JvZHk6Zm9jdXMgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1hY3RpdmUtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4IHZhcigtLWFjdGl2ZS1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRsaW5lOiBub25lOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0YXJlYV9fYm9keVtkYXRhLWlzLXZhbGlkPXRydWVdIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tdmFsaWQtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4IHZhcigtLXZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAudGV4dGFyZWFfX2JvZHlbZGF0YS1pcy12YWxpZD1mYWxzZV0gewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1pbnZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS1pbnZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0YXJlYSAuX2R1bW15LWJveCB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXI6IDFweCBzb2xpZDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW4taGVpZ2h0OiAyNDBweDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdmVyZmxvdy13cmFwOiBicmVhay13b3JkOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogMWVtOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlzaWJpbGl0eTogaGlkZGVuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpdGUtc3BhY2U6IHByZS13cmFwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgd29yZC13cmFwOiBicmVhay13b3JkOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIC50b0xlZnRNb3ZlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbmltYXRpb246bW92ZVRvTGVmdCAwLjVzIGluZmluaXRlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLXdlYmtpdC1hbmltYXRpb246bW92ZVRvTGVmdCAwLjVzIGluZmluaXRlOyAvKlNhZmFyaSBhbmQgQ2hyb21lKi8KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi1pdGVyYXRpb24tY291bnQ6MTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi1maWxsLW1vZGU6IGZvcndhcmRzOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgQGtleWZyYW1lcyBtb3ZlVG9MZWZ0ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSB7bGVmdDoyMDBweDt9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB7bGVmdDowcHg7fQogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgQC13ZWJraXQta2V5ZnJhbWVzIG1vdmVUb0xlZnQgLypTYWZhcmkgYW5kIENocm9tZSovewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSB7bGVmdDoyMDBweDt9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB7bGVmdDowcHg7fQogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgLnRvUmlnaHRNb3ZlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbmltYXRpb246bW92ZVRvUmlnaHQgMnMgaW5maW5pdGU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjptb3ZlVG9SaWdodCAycyBpbmZpbml0ZTsgLypTYWZhcmkgYW5kIENocm9tZSovCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24taXRlcmF0aW9uLWNvdW50OjE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24tZmlsbC1tb2RlOiBmb3J3YXJkczsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBAa2V5ZnJhbWVzIG1vdmVUb1JpZ2h0ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSB7bGVmdDowcHg7fQogICAgICAgICAgICAgICAgICAgICAgICAgICAgdG8ge2xlZnQ6MjAwMHB4O30KICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBtb3ZlVG9SaWdodCAvKlNhZmFyaSBhbmQgQ2hyb21lKi97CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tIHtsZWZ0OjBweDt9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB7bGVmdDoyMDBweDt9CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBgOwogCiAgICAgICAgICAgICAgICBkb21TdHlsZSAuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUobWVudVNldFN0eWxlKSk7CiAKICAgICAgICAgICAgICAgIGRvbUhlYWQuYXBwZW5kQ2hpbGQoZG9tU3R5bGUpOwogCiAgICAgICAgICAgICAgICB2YXIgc2V0TGlzdEpzb249IFsKICAgICAgICAgICAgICAgICAgICB7J2xpc3ROYW1lJzpsYW5nLmljb25Qb3NpdGlvbiwnc2V0TGlzdElEJzonaWNvblBvc2l0aW9uU2V0UGFnZScsJ3NldFBhZ2VJRCc6J21vdmllSWNvblNldFBhZ2UnLCd0YWtlUGxhY2UnOicwcHgnfSwKICAgICAgICAgICAgICAgICAgICB7J2xpc3ROYW1lJzpsYW5nLnBsYXlWaWRlbywnc2V0TGlzdElEJzonbW92aWVMaXN0Jywnc2V0UGFnZUlEJzonbW92aWVWaWRlb1NldFBhZ2UnLCd0YWtlUGxhY2UnOicwcHgnfSwKICAgICAgICAgICAgICAgICAgICB7J2xpc3ROYW1lJzpsYW5nLnBsYXlNdXNpYywnc2V0TGlzdElEJzonbXVzaWNMaXN0Jywnc2V0UGFnZUlEJzonJywndGFrZVBsYWNlJzonMHB4J30sCiAgICAgICAgICAgICAgICAgICAgeydsaXN0TmFtZSc6bGFuZy56aE5pY2UsJ3NldExpc3RJRCc6J3poaWh1TGlzdCcsJ3NldFBhZ2VJRCc6J3po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hbWUnOmxhbmcuc3BlY2lhbENvbHVtbiwnb3B0aW9uSUQnOidzcGVjaWFsQ29sdW1uJywnZGVmYXVsdCc6MjJ9LAogICAgICAgICAgICAgICAgICAgIHsnb3B0aW9uTmFtZSc6bGFuZy52aWRlb1RpdGxlLCdvcHRpb25JRCc6J3ZpZGVvVGl0bGUnLCdkZWZhdWx0JzoyMn0sCiAgICAgICAgICAgICAgICAgICAgeydvcHRpb25OYW1lJzpsYW5nLnpoS2V5d29yZENsb3NlLCdvcHRpb25JRCc6J3JlbW92ZUtleXdvcmQnLCdkZWZhdWx0JzonMCd9LAogICAgICAgICAgICAgICAgICAgIHsnb3B0aW9uTmFtZSc6bGFuZy5hdXRob3JOYW1lQ2xvc2UsJ29wdGlvbklEJzoncmVtb3ZlQXV0aG9yTmFtZScsJ2RlZmF1bHQnOicwJ30sCiAgICAgICAgICAgICAgICAgICAgeydvcHRpb25OYW1lJzpsYW5nLnlhbnh1YW5DbG9zZSwnb3B0aW9uSUQnOidyZW1vdmVZYW54dWFuJywnZGVmYXVsdCc6JzAnfQogICAgICAgICAgICAgICAgXTsKIAogICAgICAgICAgICAgICAgdmFyIHBsYXlWaWRlb09wdGlvbkpzb24gPXsKICAgICAgICAgICAgICAgICAgICAnb3B0aW9uTmFtZSc6bGFuZy5wbGF5VmlkZW9MaW5lQWRkLAogICAgICAgICAgICAgICAgICAgICdvcHRpb25JRCc6J3ZpZGVvUGxheUxpbmVBZGQnLAogICAgICAgICAgICAgICAgICAgICdkZWZhdWx0Jzp2aWRlb1BsYXlMaW5lQWRkLAogICAgICAgICAgICAgICAgICAgICd0ZXh0YXJlYSc6J3ZpZGVvUGxheUxpbmVBZGRUZXh0YXJlYScsCiAgICAgICAgICAgICAgICAgICAgJ3RleHRhcmVhSWQnOidwbGF5VmlkZW9MaW5lVGV4dGFyZWEnLAogICAgICAgICAgICAgICAgICAgICd0aXAnOgpg57qv5YeAMSxodHRwczovL2ltMTkwNy50b3AvP2p4PQpC56uZMSxod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vRG93bmxvYWRTZXRQYWdlJz4iOwogCiAgICAgICAgICAgICAgICBzZXRIdG1sICs9Ijx1bCBjbGFzcz0naWNvblNldFVsSGVhZCc+PGxpIGNsYXNzPSd6aG1fc2V0X3BhZ2VfaGVhZGVyJz48c3BhbiBjbGFzcz0nYmFjayc+PC9zcGFuPjxzcGFuPiIrbGFuZy52aWRlb0Rvd25sb2FkKyI8L3NwYW4+PHNwYW4gIGNsYXNzPSdpY29uU2V0U2F2ZSc+w5c8L2xpPjwvdWw+IjsKIAogICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8dWwgY2xhc3M9J3pobV9zZXRfcGFnZV9saXN0Jz4iOwogCiAgICAgICAgICAgICAgICBmb3IobGV0IGk9MDtpPHZpZGVvRG93bmxvYWRPcHRpb25Kc29uLmxlbmd0aDtpKyspewogCiAgICAgICAgICAgICAgICAgICAgbGV0IGJhY2tDb2xvcixzd2l0Y2hCYWNrQ29ybG9yLGRpc3BsYXk7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgb3B0aW9uVmFsdWUgPSBHTV9nZXRWYWx1ZSh2aWRlb0Rvd25sb2FkT3B0aW9uSnNvbltpXS5vcHRpb25JRCx2aWRlb0Rvd25sb2FkT3B0aW9uSnNvbltpXS5kZWZhdWx0KTsKIAogICAgICAgICAgICAgICAgICAgIGlmKG9wdGlvblZhbHVlICE9ICcyMicpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tDb2xvciA9ICcjZmZmJzsKIAogICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hCYWNrQ29ybG9yID0gJyNGRkYnOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXkgPSAnbm9uZSc7CiAKICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICBiYWNrQ29sb3IgPSAnI2ZlNmQ3Myc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoQmFja0NvcmxvciA9ICcjRkZFNUU1JzsKIAogICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5ID0gJ2Jsb2NrJzsKIAogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGxpPiI7CiAKICAgICAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjxkaXYgY2xhc3M9J3pobV9zZXRfcGFnZV9jb250ZW50Jz4iOwogCiAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSAiPHNwYW4+Iit2aWRlb0Rvd25sb2FkT3B0aW9uSnNvbltpXS5vcHRpb25OYW1lKyI8L3NwYW4+IjsKIAogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBjbGFzcz0nY2lyY3VsYXInIHN0eWxlPSdiYWNrZ3JvdW5kLWNvbG9yOiIrc3dpdGNoQmFja0NvcmxvcisiJyBpZD0nIit2aWRlb0Rvd25sb2FkT3B0aW9uSnNvbltpXS5vcHRpb25JRCsiJz4iOwogCiAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8ZGl2IGNsYXNzPSdyb3VuZC1idXR0b24nIHN0eWxlPSdiYWNrZ3JvdW5kOiAiK2JhY2tDb2xvcisiOyBsZWZ0OiAiK29wdGlvblZhbHVlKyJweDsnPjwvZGl2PiI7CiAKICAgICAgICAgICAgICAgICAgICBzZXRIdG1sICs9ICI8L2Rpdj48L2Rpdj4iOwogCiAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSAiPC9saT4iOwogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjwvdWw+IgogCiAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjwvZGl2PiIKIAogICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8ZGl2IGNsYXNzPSd6aG1fc2V0X3BhZ2UnIGlkPSdtb3ZpZVZpZGVvU2V0UGFnZSc+IjsKIAogICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8dWwgY2xhc3M9J2ljb25TZXRVbEhlYWQnPjxsaSBjbGFzcz0nemhtX3NldF9wYWdlX2hlYWRlcic+PHNwYW4gY2xhc3M9J2JhY2snPjwvc3Bhbj48c3Bhbj4iK2xhbmcuc2V0UGxheVZpZGVvKyI8L3NwYW4+PHNwYW4gIGNsYXNzPSdpY29uU2V0U2F2ZSc+w5c8L2xpPjwvdWw+IjsKIAogICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8dWwgY2xhc3M9J3pobV9zZXRfcGFnZV9saXN0JyBzdHlsZT0nb3ZlcmZsb3cteTp1bnNldCc+IjsKIAogICAgICAgICAgICAgICAgICAgIGxldCBiYWNrQ29sb3Isc3dpdGNoQmFja0NvcmxvcixkaXNwbGF5OwogCiAgICAgICAgICAgICAgICAgICAgbGV0IG9wdGlvblZhbHVlID0gR01fZ2V0VmFsdWUocGxheVZpZGVvT3B0aW9uSnNvbi5vcHRpb25JRCxwbGF5VmlkZW9PcHRpb25Kc29uLmRlZmF1bHQpOwogCiAgICAgICAgICAgICAgICAgICAgaWYob3B0aW9uVmFsdWUgIT0gJzIyJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgYmFja0NvbG9yID0gJyNmZmYnOwogCiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaEJhY2tDb3Jsb3IgPSAnI0ZGRic7CiAKICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICBiYWNrQ29sb3IgPSAnI2ZlNmQ3Myc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoQmFja0NvcmxvciA9ICcjRkZFNUU1JzsKIAogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGxpPiI7CiAKICAgICAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjxkaXYgY2xhc3M9J3pobV9zZXRfcGFnZV9jb250ZW50Jz4iOwogCiAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPS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zdHlsZT0nd2lkdGg6MjUwcHg7Zm9udC1zaXplOjEycHg7cGFkZGluZzo0cHg7cmVzaXplOm5vbmU7JyBpZD0nIitwbGF5VmlkZW9PcHRpb25Kc29uLnRleHRhcmVhSWQrIic+IitHTV9nZXRWYWx1ZShwbGF5VmlkZW9PcHRpb25Kc29uLnZhbHVlTmFtZSxwbGF5VmlkZW9PcHRpb25Kc29uLnRpcCkrIjwvdGV4dGFyZWE+IjsKIAogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPC9kaXY+PC9kaXY+PC9saT4iOwogCiAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8L3VsPiIKIAogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPC9kaXY+IgogCiAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8ZGl2IGNsYXNzPSd6aGlodVNldFBhZ2UnIGlkPSd6aGlodUljb25TZXRQYWdlJz4iOwogCiAgICAgICAgICAgICAgICAgICAgc2V0SHRtbCArPSI8dWwgY2xhc3M9J2ljb25TZXRVbEhlYWQnPjxsaSBjbGFzcz0naWNvblNldFBhZ2VIZWFkJz48c3BhbiBjbGFzcz0nYmFjayc+PC9zcGFuPjxzcGFuPiIrbGFuZy56aFNldCsiPC9zcGFuPjxzcGFuICBjbGFzcz0naWNvblNldFNhdmUnPsOXPC9saT48L3VsPiI7CiAKICAgICAgICAgICAgICAgICAgICBzZXRIdG1sICs9Ijx1bCBjbGFzcz0nemhtX3NldF9wYWdlX2xpc3QnIHN0eWxlPSdoZWlnaHQ6MzAwcHgnPiI7CiAKICAgICAgICAgICAgICAgIGZvcih2YXIgb3B0aW9uTj0wO29wdGlvbk48emhpaHVPcHRpb25Kc29uLmxlbmd0aDtvcHRpb25OKyspewogCiAgICAgICAgICAgICAgICAgICAgbGV0IGJhY2tDb2xvcixzd2l0Y2hCYWNrQ29ybG9yOwogCiAgICAgICAgICAgICAgICAgICAgbGV0IG9wdGlvblZhbHVlID0gR01fZ2V0VmFsdWUoemhpaHVPcHRpb25Kc29uW29wdGlvbk5dLm9wdGlvbklELHpoaWh1T3B0aW9uSnNvbltvcHRpb25OXS5kZWZhdWx0KTsKIAogICAgICAgICAgICAgICAgICAgIGlmKG9wdGlvblZhbHVlICE9ICcyMicpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tDb2xvciA9ICcjZmZmJzsKIAogICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hCYWNrQ29ybG9yID0gJyNGRkYnOwogCiAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgYmFja0NvbG9yID0gJyNmZTZkNzMnOwogCiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaEJhY2tDb3Jsb3IgPSAnI0ZGRTVFNSc7CiAKICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjxsaSA+PGRpdiBjbGFzcz0nemhpaHVTZXRQYWdlQ29udGVudCc+PHNwYW4+Iit6aGlodU9wdGlvbkpzb25bb3B0aW9uTl0ub3B0aW9uTmFtZSsiPC9zcGFuPiI7CiAKICAgICAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjxkaXYgY2xhc3M9J2NpcmN1bGFyJyBzdHlsZT0nYmFja2dyb3VuZC1jb2xvcjogIitzd2l0Y2hCYWNrQ29ybG9yKyI7JyBpZD0iK3poaWh1T3B0aW9uSnNvbltvcHRpb25OXS5vcHRpb25JRCsiPjxkaXYgY2xhc3M9J3JvdW5kLWJ1dHRvbicgc3R5bGU9J2JhY2tncm91bmQ6ICIrYmFja0NvbG9yKyI7bGVmdDogIitvcHRpb25WYWx1ZSsicHg7Jz48L2Rpdj48L2Rpdj48L2Rpdj4iOwogCiAgICAgICAgICAgICAgICAgICAgaWYoemhpaHVPcHRpb25Kc29uW29wdGlvbk5dLm9wdGlvbklEID09ICdyZW1vdmVLZXl3b3JkJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGtleXdvcmRTaG93OwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKEdNX2dldFZhbHVlKCdyZW1vdmVLZXl3b3JkJywnMCcpID09ICcyMicpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXl3b3JkU2hvdyA9ICdibG9jayc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXl3b3JkU2hvdyA9ICdub25lJzsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBzdHlsZT0nbWFyZ2luLXRvcDoxMHB4O2Rpc3BsYXk6IitrZXl3b3JkU2hvdysiO3BhZGRpbmc6NXB4IDBweDsnIGlkPSd6aGlodUtleXdvcmQnPjxzcGFuIGNsYXNzPSd0ZXh0LWlucHV0Jz48aW5wdXQgdmFsdWU9JyIrR01fZ2V0VmFsdWUoJ2lucHV0WmhLZXl3b3JkJywnJykrIicgaWQ9J2lucHV0WmhLZXl3b3JkJyBjbGFzcz0ndGV4dC1pbnB1dF9fYm9keScgcGxhY2Vob2xkZXI9JyIrbGFuZy50aXBLZXl3b3JkKyInIHN0eWxlPSd3aWR0aDo4OCUnPjxzcGFuPjwvZGl2PiI7CiAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgaWYoemhpaHVPcHRpb25Kc29uW29wdGlvbk5dLm9wdGlvbklEID09ICdyZW1vdmVBdXRob3JOYW1lJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF1dGhvck5hbWVTaG93OwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKEdNX2dldFZhbHVlKCdyZW1vdmVBdXRob3JOYW1lJywnMCcpID09ICcyMicpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRob3JOYW1lU2hvdyA9ICdibG9jayc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXRob3JOYW1lU2hvdyA9ICdub25lJzsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBzdHlsZT0nbWFyZ2luLXRvcDoxMHB4O2Rpc3BsYXk6IithdXRob3JOYW1lU2hvdysiO3BhZGRpbmc6NXB4IDBweDsnIGlkPSd6aGlodUF1dGhvck5hbWUnPjxzcGFuIGNsYXNzPSd0ZXh0LWlucHV0Jz48aW5wdXQgdmFsdWU9JyIrR01fZ2V0VmFsdWUoJ2lucHV0WmhBdXRob3JOYW1lJywnJykrIicgaWQ9J2lucHV0WmhBdXRob3JOYW1lJyBjbGFzcz0ndGV4dC1pbnB1dF9fYm9keScgcGxhY2Vob2xkZXI9JyIrbGFuZy50aXBBdXRob3JOYW1lKyInIHN0eWxlPSd3aWR0aDo4OCUnPjxzcGFuPjwvZGl2PiI7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPC9saT4iOwogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjwvdWw+IgogCiAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjwvZGl2PiI7CiAKICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPHVsIGNsYXNzPSdpY29uU2V0VWxIZWFkJz48bGkgY2xhc3M9J2ljb25TZXRQYWdlSGVhZCc+PHNwYW4+PC9zcGFuPjxzcGFuPiIrbGFuZy5zZXQrIjwvc3Bhbj48c3BhbiBjbGFzcz0naWNvblNldFNhdmUnPsOXPC9zcGFuPjwvbGk+PC91bD4iOwogCiAgICAgICAgICAgICAgICBzZXRIdG1sICs9Ijx1bCBjbGFzcz0nc2V0V3JhcExpJz4iOwogCiAgICAgICAgICAgICAgICBmb3IodmFyIHNldE49MDtzZXROPHNldExpc3RKc29uLmxlbmd0aDtzZXROKyspewogCiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3RWYWx1ZSA9IEdNX2dldFZhbHVlKHNldExpc3RKc29uW3NldE5dLnNldExpc3RJRCwnMjInKTsKIAogICAgICAgICAgICAgICAgICAgIGxldCBiYWNrQ29sb3IsYXJyb3dDb2xvcixzd2l0Y2hCYWNrQ29ybG9yOwogCiAgICAgICAgICAgICAgICAgICAgaWYobGlzdFZhbHVlICE9IDIyKXsKICAgICAgICAgICAgICAgICAgICAgICAgYmFja0NvbG9yID0gJyNmZmYnOwogICAgICAgICAgICAgICAgICAgICAgICBhcnJvd0NvbG9yPSAnI0VFRSc7CiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaEJhY2tDb3Jsb3IgPSAnI0ZGRic7CiAKICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKICAgICAgICAgICAgICAgICAgICAgICAgYmFja0NvbG9yID0gJyNmZTZkNzMnOwogICAgICAgICAgICAgICAgICAgICAgICBhcnJvd0NvbG9yID0gJyNDQ0MnOwogICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2hCYWNrQ29ybG9yID0gJyNGRkU1RTUnOwogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIGlmKHNldExpc3RKc29uW3NldE5dLnNldFBhZ2VJRCA9PSAnJyl7CiAgICAgICAgICAgICAgICAgICAgICAgIGFycm93Q29sb3IgPSAnI0VFRSc7CiAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICBzZXRIdG1sICs9IjxsaT48c3Bhbj4iK3NldExpc3RKc29uW3NldE5dLmxpc3ROYW1lKyI8L3NwYW4+IjsKIAogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBjbGFzcz0nc2V0V3JhcExpQ29udGVudCc+IjsKIAogICAgICAgICAgICAgICAgICAgIHNldEh0bWwgKz0iPGRpdiBjbGFzcz0nY2lyY3VsYXInIGlkPSciK3NldExpc3RKc29uW3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GVjdG9yKCcjc2V0TWFzaycpKSByZXR1cm47CiAKICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlRWxlbWVudCgnZGl2JywnemhtTWVudScpOwogCiAgICAgICAgICAgICAgICBsZXQgemhtTWVudSA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCd6aG1NZW51Jyk7CiAKICAgICAgICAgICAgICAgIHpobU1lbnUuaW5uZXJIVE1MID0gc2V0SHRtbDsKIAogICAgICAgICAgICAgICAgbGV0IHRpbWVyWmhtSWNvbiA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICBpZiAoZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobU1lbnUnKSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lclpobUljb24pOyAvLyDlj5bmtojlrprml7blmagKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgY2lyY3VsYXIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuY2lyY3VsYXInKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBjaXJjdWxhci5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgZnVuY3Rpb24oX2UpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJ1dHRvblN0eWxlID0gaXRlbS5jaGlsZHJlblswXS5zdHlsZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsZWZ0ID0gYnV0dG9uU3R5bGUubGVmdDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgPSBwYXJzZUludChsZWZ0KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaXN0TGVmdFZhbHVlOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYobGVmdD09MCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnV0dG9uU3R5bGUubGVmdCA9ICcyMnB4JzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidXR0b25TdHlsZS5iYWNrZ3JvdW5kID0gJyNmZTZkNzMnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uc3R5bGUuYmFja2dyb3VuZD0nI2ZmRTVFNSc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXRlbS5uZXh0U2libGluZyAmJiBpdGVtLm5leHRTaWJsaW5nLmdldEF0dHJpYnV0ZSgnZGF0YScpKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5uZXh0U2libGluZy5zZXRBdHRyaWJ1dGUoJ3N0eWxlJywnYm9yZGVyOiBzb2xpZCAjY2NjO2JvcmRlci13aWR0aDogMCAzcHggM3B4IDA7JykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RMZWZ0VmFsdWUgPSAyMjsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1dHRvblN0eWxlLmxlZnQgPSAnMHB4JzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidXR0b25TdHlsZS5iYWNrZ3JvdW5kID0gJyNmZmYnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uc3R5bGUuYmFja2dyb3VuZD0nI2ZmZic7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXRlbS5uZXh0U2libGluZyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0ubmV4dFNpYmxpbmcuc2V0QXR0cmlidXRlKCdzdHlsZScsJ2JvcmRlcjogc29saWQgI0VFRTtib3JkZXItd2lkdGg6IDAgM3B4IDNweCAwOycpCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RMZWZ0VmFsdWUgPSAwOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzZXRMaXN0SUQgPSBpdGVtLmlkOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2V0TGlzdElEID09ICdyZW1vdmVLZXl3b3JkJyAmJiBsaXN0TGVmdFZhbHVlPT0yMil7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3poaWh1S2V5d29yZCcpLnN0eWxlLmRpc3BsYXk9J2Jsb2NrJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2RvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aG1UYWtlUGxhY2UnKS5zdHlsZT0gJ2hlaWdodDoyMjBweCc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2V0TGlzdElEID09ICdyZW1vdmVLZXl3b3JkJyAmJiBsaXN0TGVmdFZhbHVlPT0wKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhpaHVLZXl3b3JkJykuc3R5bGUuZGlzcGxheT0nbm9uZSc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9kb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtVGFrZVBsYWNlJykuc3R5bGU9ICdoZWlnaHQ6MTgwcHgnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNldExpc3RJRCA9PSAncmVtb3ZlQXV0aG9yTmFtZScgJiYgbGlzdExlZnRWYWx1ZT09MjIpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aGlodUF1dGhvck5hbWUnKS5zdHlsZS5kaXNwbGF5PSdibG9jayc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzZXRMaXN0SUQgPT0gJ3JlbW92ZUF1dGhvck5hbWUnICYmIGxpc3RMZWZ0VmFsdWU9PTApewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aGlodUF1dGhvck5hbWUnKS5zdHlsZS5kaXNwbGF5PSdub25lJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZShzZXRMaXN0SUQsbGlzdExlZnRWYWx1ZSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvUmlnaHQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcudG8tcmlnaHQnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICB0b1JpZ2h0LmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCBmdW5jdGlvbihlKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsZWZ0ID0gaXRlbS5wcmV2aW91c1NpYmxpbmcuY2hpbGRyZW5bMF0uc3R5bGUubGVmdDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgPSBwYXJzZUludChsZWZ0KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGxlZnQgIT0gMjIpIHJldHVybjsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzZXRQYWdlSUQgPSBpdGVtLmdldEF0dHJpYnV0ZSgnZGF0YScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhZ2VJZCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHNldFBhZ2VJRCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlSWQuY2xhc3NOYW1lPSdpY29uU2V0UGFnZSB0b0xlZnRNb3ZlJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8v55+l5LmO6K6+572u5pqC5L2N6auY5bqmCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzZXRQYWdlSUQ9PSd6aGlodUljb25TZXRQYWdlJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobVRha2VQbGFjZScpLnN0eWxlPSBgaGVpZ2h0OjY4cHhgOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8v5a6e5pe25Zu+5qCH6auY5bqmCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2V0UGFnZUlEID09ICdtb3ZpZUljb25TZXRQYWdlJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2ljb25Ub3AnKS52YWx1ZT1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjemhtbG9nbyIpLm9mZnNldFRvcDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b0JhY2sgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuYmFjaycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIHRvQmFjay5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgZnVuY3Rpb24oZSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFyZW50RG9tID0gaXRlbS5wYXJlbnROb2RlLnBhcmVudE5vZGUucGFyZW50Tm9kZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudERvbS5jbGFzc05hbWU9J2ljb25TZXRQYWdlIHRvUmlnaHRNb3ZlJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aG1UYWtlUGxhY2UnKS5zdHlsZT0naGVpZ2h0OjQwcHg7JwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNldFNhdmUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuaWNvblNldFNhdmUnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBzZXRTYXZlLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCgpPT57CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvblRvcCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpY29uVG9wJykudmFsdWU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvbk9wYWNpdHk9ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2ljb25PcGFjaXR5JykudmFsdWU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvblBvc2l0aW9uID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2ljb25Qb3NpdGlvbicpLnZhbHVlOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGljb25XaWR0aCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpY29uV2lkdGgnKS52YWx1ZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpY29uV2FpdFRpbWUgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWNvbldhaXRUaW1lJykudmFsdWU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheVZpZGVvTGluZVRleHQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjcGxheVZpZGVvTGluZVRleHRhcmVhJykudmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlWaWRlb0xpbmVMZWZ0ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3ZpZGVvUGxheUxpbmVBZGQnKS5jaGlsZHJlblswXS5zdHlsZS5sZWZ0OwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGlucHV0WmhLZXl3b3JkID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2lucHV0WmhLZXl3b3JkJykudmFsdWU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaW5wdXRBdXRob3JOYW1lID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2lucHV0WmhBdXRob3JOYW1lJykudmFsdWU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpY29uVG9wICE9ICcnKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighKC8oXlswLTldWzAtOV17MCwyfSQpLy50ZXN0KGljb25Ub3ApKSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsZXJ0KGxhbmcudGlwRXJyb3JJY29uSGVpZ2h0KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ2ljb25Ub3AnLGljb25Ub3ApOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGljb25PcGFjaXR5ICE9ICcnKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighKC9eKD86MHxbMS05XVswLTldP3wxMDApJC8udGVzdChpY29uT3BhY2l0eSkpKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxlcnQobGFuZy50aXBFcnJvckljb25PcGFjaXR5KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ2ljb25PcGFjaXR5JyxpY29uT3BhY2l0eSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaWNvblBvc2l0aW9uICE9ICcnKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgnaWNvblBvc2l0aW9uJyxpY29uUG9zaXRpb24pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGljb25XYWl0VGltZSAhPSAnJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ2ljb25XYWl0VGltZScsaWNvbldhaXRUaW1lKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpY29uV2lkdGggIT0nJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoISgvKF4oWzEtOV1bMC05XT8pJCkvLnRlc3QoaWNvbldpZHRoKSkpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGVydChsYW5nLnRpcEVycm9ySWNvbldpZHRoKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ2ljb25XaWR0aCcsaWNvbldpZHRoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihHTV9nZXRWYWx1ZSgndmlkZW9QbGF5TGluZUFkZCcpID09IDIyKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwbGF5VmlkZW9MaW5lVGV4dCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaW5lT2JqID0gX3RoaXMuZ2V0TGluZShwbGF5VmlkZW9MaW5lVGV4dCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGxpbmVPYmoubGVuZ3RoPjApewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ3BsYXlWaWRlb0xpbmVUZXh0JyxwbGF5VmlkZW9MaW5lVGV4dCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsZXJ0KCfnur/ot6/ovpPlhaXkuI3mraPnoa4nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCdwbGF5VmlkZW9MaW5lVGV4dCcsJycpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgncGxheVZpZGVvTGluZVRleHQnLHBsYXlWaWRlb0xpbmVUZXh0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpbnB1dFpoS2V5d29yZCAhPSAnJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ2lucHV0WmhLZXl3b3JkJyxpbnB1dFpoS2V5d29yZCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihHTV9nZXRWYWx1ZSgnaW5wdXRaaEtleXdvcmQnKSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX2RlbGV0ZVZhbHVlKCdpbnB1dFpoS2V5d29yZCcpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpbnB1dEF1dGhvck5hbWUgIT0gJycpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCdpbnB1dFpoQXV0aG9yTmFtZScsaW5wdXRBdXRob3JOYW1lKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKEdNX2dldFZhbHVlKCdpbnB1dFpoQXV0aG9yTmFtZScpKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fZGVsZXRlVmFsdWUoJ2lucHV0WmhBdXRob3JOYW1lJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpc3RvcnkuZ28oMCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpY29uVG9wJykuYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvblRvcCA9IHRoaXMudmFsdWU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoLyheWzEtOV1cZCokKS8udGVzdChpY29uVG9wKSkpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBdHRyaWJ1dGUoJ2RhdGEtaXMtdmFsaWQnLCdmYWxzZScpCiAKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEF0dHJpYnV0ZSgnZGF0YS1pcy12YWxpZCcsJ3RydWUnKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWNvbldpZHRoJykuYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvbldpZHRoID0gdGhpcy52YWx1ZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoISgvKF5bMS05XVxkKiQpLy50ZXN0KGljb25XaWR0aCkpKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0QXR0cmlidXRlKCdkYXRhLWlzLXZhbGlkJywnZmFsc2UnKQogCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBdHRyaWJ1dGUoJ2RhdGEtaXMtdmFsaWQnLCd0cnVlJykKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgIC8v6IW+6K6v6KeG6aKR5b+r5o236ZSu5Yay56qBCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNvdXBvblVybC5tYXRjaCgvdlwucXFcLmNvbVwveFwvY292ZXIvKSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhZGRMaW5lVGV4dCA9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3BsYXlWaWRlb0xpbmVUZXh0YXJlYScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRMaW5lVGV4dC5hZGRFdmVudExpc3RlbmVyKCdrZXlkb3duJyxmdW5jdGlvbihlKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdGFydFBvcyA9IGFkZExpbmVUZXh0LnNlbGVjdGlvblN0YXJ0OwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGVuZFBvcyA9IGFkZExpbmVUZXh0LnNlbGVjdGlvbkVuZDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGFydFBvcyA9PT0gdW5kZWZpbmVkIHx8IGVuZFBvcyA9PT0gdW5kZWZpbmVkKSByZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlDb2RlLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZS5rZXlDb2RlID09IGl0ZW0uY29kZSAmJiBlLnNoaWZ0S2V5PT1pdGVtLmlzU2hpZnQpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dFZhbHVlID0gYWRkTGluZVRleHQudmFsdWU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdGFydFZhbHVlID0gdGV4dFZhbHVlLnN1YnN0cmluZygwLHN0YXJ0UG9zKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGVuZFZhbHVlID0gdGV4dFZhbHVlLnN1YnN0cmluZyhzdGFydFBvcyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhbGxWYWx1ZSA9IHN0YXJ0VmFsdWUraXRlbS52YWx1ZStlbmRWYWx1ZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkTGluZVRleHQudmFsdWU9YWxsVmFsdWU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZExpbmVUZXh0LnNlbGVjdGlvblN0YXJ0ID0gc3RhcnRQb3MrMTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkTGluZVRleHQuc2VsZWN0aW9uRW5kID0gZW5kUG9zKzE7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICBjcmVhdGVFbGVtZW50KGRvbSxkb21JZCl7CiAKICAgICAgICAgICAgICAgIHZhciByb290RWxlbWVudCA9IGRvY3VtZW50LmJvZHk7CiAKICAgICAgICAgICAgICAgIHZhciBuZXdFbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChkb20pOwogCiAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmlkID0gZG9tSWQ7CiAKICAgICAgICAgICAgICAgIHZhciBuZXdFbGVtZW50SHRtbENvbnRlbnQgPSBkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZSgnJyk7CiAKICAgICAgICAgICAgICAgIHJvb3RFbGVtZW50LmFwcGVuZENoaWxkKG5ld0VsZW1lbnQpOwogCiAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmFwcGVuZENoaWxkKG5ld0VsZW1lbnRIdG1sQ29udGVudCk7CiAKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIHJlcXVlc3QobWV0aG9kLHVybCxkYXRhLGlzQ29va2llPScnKXsKIAogICAgICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTsKIAogICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLHJlamVjdCk9PnsKIAogICAgICAgICAgICAgICAgICAgIHJlcXVlc3Qub25yZWFkeXN0YXRlY2hhbmdlPWZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYocmVxdWVzdC5yZWFkeVN0YXRlPT00KXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocmVxdWVzdC5zdGF0dXM9PTIwMCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlcXVlc3QucmVzcG9uc2VUZXh0KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3QocmVxdWVzdC5zdGF0dXMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICByZXF1ZXN0Lm9wZW4obWV0aG9kLHVybCk7CiAgICAgICAgICAgICAgICAgICAgaWYoaXNDb29raWUpewogICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LndpdGhDcmVkZW50aWFscyA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIHJlcXVlc3Quc2V0UmVxdWVzdEhlYWRlcignQ29udGVudC1UeXBlJywgJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcpOwogICAgICAgICAgICAgICAgICAgIHJlcXVlc3Quc2VuZChkYXRhKTsKIAogICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICB9CiAKICAgICAgICAgICAgc2V0Q29va2llKGNuYW1lLGN2YWx1ZSxleGRheXMpewogCiAgICAgICAgICAgICAgICB2YXIgZCA9IG5ldyBEYXRlKCk7CiAKICAgICAgICAgICAgICAgIGQuc2V0VGltZShkLmdldFRpbWUoKSsoZXhkYXlzKjI0KjYwKjYwKjEwMDApKTsKIAogICAgICAgICAgICAgICAgdmFyIGV4cGlyZXMgPSAiZXhwaXJlcz0iK2QudG9HTVRTdHJpbmcoKTsKIAogICAgICAgICAgICAgICAgZG9jdW1lbnQuY29va2llID0gY25hbWUrIj0iK2N2YWx1ZSsiOyAiK2V4cGlyZXM7CiAgICAgICAgICAgIH0KIAogICAgICAgICAgICBnZXRDb29raWUoY25hbWUpewogICAgICAgICAgICAgICAgdmFyIG5hbWUgPSBjbmFtZSArICI9IjsKICAgICAgICAgICAgICAgIHZhciBjYSA9IGRvY3VtZW50LmNvb2tpZS5zcGxpdCgnOycpOwogICAgICAgICAgICAgICAgZm9yKHZhciBpPTA7IGk8Y2EubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICB2YXIgYyA9IGNhW2ldLnRyaW0oKTsKICAgICAgICAgICAgICAgICAgICBpZiAoYy5pbmRleE9mKG5hbWUpPT0wKSB7IHJldHVybiBjLnN1YnN0cmluZyhuYW1lLmxlbmd0aCxjLmxlbmd0aCk7IH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiAiIjsKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIGdldFF1ZXJ5U3RyaW5nKGUpIHsKICAgICAgICAgICAgICAgIHZhciB0ID0gbmV3IFJlZ0V4cCgiKF58JikiICsgZSArICI9KFteJl0qKSgmfCQpIik7CiAgICAgICAgICAgICAgICB2YXIgYSA9IHdpbmRvdy5sb2NhdGlvbi5zZWFyY2guc3Vic3RyKDEpLm1hdGNoKHQpOwogICAgICAgICAgICAgICAgaWYgKGEgIT0gbnVsbCkgcmV0dXJuIGFbMl07CiAgICAgICAgICAgICAgICByZXR1cm4gIiI7CiAgICAgICAgICAgIH0KIAogICAgICAgICAgICBnZXRVcmxQYXJhbXModXJsKXsKICAgICAgICAgICAgICAgIGxldCByZWcgPSAvKFtePyYrI10rKT0oW14/JisjXSspL2c7CiAgICAgICAgICAgICAgICBsZXQgb2JqPXt9OwogICAgICAgICAgICAgICAgdXJsLnJlcGxhY2UocmVnLChyZXMsJDEsJDIpPT57b2JqWyQxXT0kMn0pOwogICAgICAgICAgICAgICAgcmV0dXJuIG9iajsKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIGdldExpbmUodGV4dCl7CiAKICAgICAgICAgICAgICAgIGxldCB0ZXh0QXJyID0gdGV4dC5zcGxpdCgnXG4nKTsKIAogICAgICAgICAgICAgICAgaWYodGV4dEFyci5sZW5ndGggPiAwKXsKIAogICAgICAgICAgICAgICAgICAgIGxldCBsaW5lT2JqID0gW107CiAKICAgICAgICAgICAgICAgICAgICBsZXQgbWF0Y2ggPSAvXiguKykoaHR0cHM/OlwvXC8uKykkLzsKIAogICAgICAgICAgICAgICAgICAgIHRleHRBcnIuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gaXRlbS5yZXBsYWNlKC9ccyosKi9nLCcnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZighaXRlbSkgcmV0dXJuIHRydWU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpbmVNYXRjaCA9IGl0ZW0ubWF0Y2gobWF0Y2gpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGxpbmVNYXRjaCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVPYmoucHVzaCh7J25hbWUnOmxpbmVNYXRjaFsxXS5zdWJzdHJpbmcoMCw0KSwndXJsJzpsaW5lTWF0Y2hbMl19KTsKIAogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZU9iaj1bXTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpbmVPYmo7CiAKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogCiAgICAgICAgICAgIHN0YXRpYyBnZXRFbGVtZW50KGNzcyl7CiAKICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSxyZWplY3QpPT57CiAKICAgICAgICAgICAgICAgICAgICBsZXQgbnVtID0gMDsKIAogICAgICAgICAgICAgICAgICAgIGxldCB0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbnVtKysKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZG9tID0gZG9jdW1lbnQucXVlcnlTZWxlY3Rvcihjc3MpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRvbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGRvbSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG51bT09MjApe2NsZWFySW50ZXJ2YWwodGltZXIpO3Jlc29sdmUoZmFsc2UpO30KICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgfSwzMDApCiAKICAgICAgICAgICAgICAgICAgICB9KQogCiAKICAgICAgICAgICAgfQogCiAgICA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3V0KGZ1bmN0aW9uKCkgewogCiAgICAgICAgICAgICAgICAgICAgdmFyIGQgPSAwLjU7CiAKICAgICAgICAgICAgICAgICAgICB0b2FzdERvbS5zdHlsZS53ZWJraXRUcmFuc2l0aW9uID0gJy13ZWJraXQtdHJhbnNmb3JtICcgKyBkICsgJ3MgZWFzZS1pbiwgb3BhY2l0eSAnICsgZCArICdzIGVhc2UtaW4nOwogCiAgICAgICAgICAgICAgICAgICAgdG9hc3REb20uc3R5bGUub3BhY2l0eSA9ICcwJzsKIAogICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7IGRvY3VtZW50LmJvZHkucmVtb3ZlQ2hpbGQodG9hc3REb20pIH0sIGQgKiAxMDAwKTsKIAogICAgICAgICAgICAgICAgfSwgZHVyYXRpb24pOwogCiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy9jcmVhdGUgemhtTG9nb0ljb24KICAgICAgICAgICAgemhtTG9nbygpewogCiAgICAgICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzOwogCiAgICAgICAgICAgICAgICBsZXQgc29ydERpdiA9IGljb25WaXBQb3NpdGlvbj09J2xlZnQnPydyb3cnOidyb3ctcmV2ZXJzZSc7CiAKICAgICAgICAgICAgICAgIGxldCBwbGF5VmlkZW9TdHlsZSA9IGAKICAgICAgICAgICAgICAgIC56aG1fcGxheV92aWRvZV9pY29uewogICAgICAgICAgICAgICAgICAgcGFkZGluZy10b3A6MnB4OwogICAgICAgICAgICAgICAgICAgY3Vyc29yOnBvaW50ZXI7CiAgICAgICAgICAgICAgICAgICB6LWluZGV4Ojk5OTk5OTsKICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOmZpeGVkOyR7aWNvblZpcFBvc2l0aW9ufTo1cHg7dG9wOiR7aWNvblZpcFRvcH1weDsKICAgICAgICAgICAgICAgICAgIHRleHQtYWxpZ246Y2VudGVyOwogICAgICAgICAgICAgICAgICAgb3ZlcmZsb3c6dmlzaWJsZTsKICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6ZmxleDsKICAgICAgICAgICAgICAgICAgIGZsZXgtZGlyZWN0aW9uOiR7c29ydERpdn07CiAgICAgICAgICAgICAgICAgICB3aWR0aDphdXRvOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX3dyYXB7CiAgICAgICAgICAgICAgICAgICB6LWluZGV4Ojk5OTk5OTk7CiAgICAgICAgICAgICAgICAgICBvdmVyZmxvdzogaGlkZGVuOwogICAgICAgICAgICAgICAgICAgd2lkdGg6MzAwcHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuaWNvbkxvZ297CiAgICAgICAgICAgICAgICAgICAgb3BhY2l0eToke2ljb25WaXBPcGFjaXR5LzEwMH07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX3BsYXlfdmlkZW9fbGluZXsKICAgICAgICAgICAgICAgICAgIHdpZHRoOjMyMHB4OwogICAgICAgICAgICAgICAgICAgaGVpZ2h0OjMxNnB4OwogICAgICAgICAgICAgICAgICAgb3ZlcmZsb3cteTpzY3JvbGw7CiAgICAgICAgICAgICAgICAgICBvdmVyZmxvdy14OmhpZGRlbjsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fcGxheV92aWRlX2xpbmVfdWx7CiAgICAgICAgICAgICAgICAgICB3aWR0aDozMDBweDsKICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IGZsZXgtc3RhcnQ7CiAgICAgICAgICAgICAgICAgICBmbGV4LWZsb3c6IHJvdyB3cmFwOwogICAgICAgICAgICAgICAgICAgbGlzdC1zdHlsZTogbm9uZTsKICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6MHB4OwogICAgICAgICAgICAgICAgICAgbWFyZ2luOjBweDsKIAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGl7CiAgICAgICAgICAgICAgICAgICBwYWRkaW5nOjRweCAwcHg7CiAgICAgICAgICAgICAgICAgICBtYXJnaW46MnB4OwogICAgICAgICAgICAgICAgICAgd2lkdGg6MzAlOwogICAgICAgICAgICAgICAgICAgY29sb3I6I0ZGRjsKICAgICAgICAgICAgICAgICAgIHRleHQtYWxpZ246Y2VudGVyOwogICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZjI0NDQzOwogICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzowcHggMHB4IDEwcHggI2ZmZjsKICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZToxNHB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGk6aG92ZXJ7CiAgICAgICAgICAgICAgICAgICBjb2xvcjojMjYwMDMzOwogICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZmNjMGMwCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX2xpbmVfc2VsZWN0ZWR7CiAgICAgICAgICAgICAgICAgICBjb2xvcjojMjYwMDMzOwogICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZmNjMGMwCiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIC56aG1fcGxheV92aWRlb19qeHsKICAgICAgICAgICAgICAgICAgIHdpZHRoOjEwMCU7CiAgICAgICAgICAgICAgICAgICBoZWlnaHQ6MTAwJTsKICAgICAgICAgICAgICAgICAgIHotaW5kZXg6OTk5OTk5OwogICAgICAgICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlO3RvcDowcHg7cGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBgOwogCiAgICAgICAgICAgICAgICAgZG9tU3R5bGUgLmFwcGVuZENoaWxkKGR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gICAgICAgICB6aG1Mb2dvRHJhZyh0eXBlLHdlYil7CiAKICAgICAgICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzOwogCiAgICAgICAgICAgICAgICAgdmFyIHpobUxvZ29EcmFnPWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiN6aG1sb2dvIik7CiAKICAgICAgICAgICAgICAgICB2YXIgemhtTG9nb0ljb24gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIuaWNvbkxvZ28iKTsKIAogICAgICAgICAgICAgICAgIGlmKCF6aG1Mb2dvRHJhZyB8fCAhemhtTG9nb0ljb24pcmV0dXJuOwogCiAgICAgICAgICAgICAgICAgemhtTG9nb0RyYWcub25tb3VzZWRvd24gPSBmdW5jdGlvbihldmVudCl7CiAKICAgICAgICAgICAgICAgICAgICAgaWYoZXZlbnQud2hpY2g9PTMpcmV0dXJuIGZhbHNlOy8v5bGP6JS95Y+z6ZSuCiAKICAgICAgICAgICAgICAgICAgICAgbGV0IHNlZG93blRvcCA9IHpobUxvZ29EcmFnLm9mZnNldFRvcDsKIAogICAgICAgICAgICAgICAgICAgICBsZXQgemhtTG9nb0ljb25IZWlnaHQgPSB6aG1Mb2dvSWNvbi5vZmZzZXRIZWlnaHQ7CiAKICAgICAgICAgICAgICAgICAgICAgbGV0IGJvdHRvbVNwYWNlID0gMTA7CiAKICAgICAgICAgICAgICAgICAgICAgaWYoZXZlbnQudGFyZ2V0LmNsYXNzTmFtZSAhPSAnaWNvbkxvZ28nKXJldHVybjsKIAogICAgICAgICAgICAgICAgICAgICAvL2xldCBzaGlmdFggPSBldmVudC5jbGllbnRYIC0gemhtTG9nb0RyYWcuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCkubGVmdDsKICAgICAgICAgICAgICAgICAgICAgbGV0IHNoaWZ0eCA9IDU7CiAKICAgICAgICAgICAgICAgICAgICAgbGV0IHNoaWZ0WSA9IGV2ZW50LmNsaWVudFktemhtTG9nb0RyYWcuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCkudG9wOwogCiAgICAgICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLnN0eWxlLnBvc2l0aW9uID0gJ2ZpeGVkJzsKIAogICAgICAgICAgICAgICAgICAgICB6aG1Mb2dvRHJhZy5zdHlsZS56SW5kZXggPSA5OTk5OTk5OwogCiAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmJvZHkuYXBwZW5kKHpobUxvZ29EcmFnKTsKIAogICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBvbk1vdXNlTW92ZShldmVudCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgIC8vemhtTG9nb0RyYWcuc3R5bGUubGVmdCA9IHBhZ2VYIC0gc2hpZnRYICsgJ3B4JzsKICAgICAgICAgICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLnN0eWxlLmxlZnQgPSAnNXB4JzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhlaWdodCA9IHdpbmRvdy5pbm5lckhlaWdodCAtIHpobUxvZ29JY29uSGVpZ2h0LWJvdHRvbVNwYWNlOwogCiAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgeSA9IGV2ZW50LnBhZ2VZLXNoaWZ0WTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgeSA9IE1hdGgubWluKE1hdGgubWF4KDAsIHkpLCBoZWlnaHQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICB6aG1Mb2dvRHJhZy5zdHlsZS50b3AgPSB5KydweCc7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgLy/lnKhtb3VzZW1vdmXkuovku7bkuIrnp7vliqjlm77moIcKICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignbW91c2Vtb3ZlJyxvbk1vdXNlTW92ZSk7CiAgICAgICAgICAgICAgICAgICAgIC8v5p2+5byA5LqL5Lu2CiAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50Lm9ubW91c2V1cCA9IGZ1bmN0aW9uKGUpewogCiAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgnaWNvblRvcCcsemhtTG9nb0RyYWcub2Zmc2V0VG9wKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcignbW91c2Vtb3ZlJywgb25Nb3VzZU1vdmUpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICB6aG1Mb2dvRHJhZy5vbm1vdXNldXAgPSBudWxsOwogCiAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaGVpZ2h0ID0gemhtTG9nb0RyYWcub2Zmc2V0VG9wK3pobUxvZ29JY29uSGVpZ2h0K2JvdHRvbVNwYWNlOwogCiAgICAgICAgICAgICAgICAgICAgICAgICBpZih6aG1Mb2dvRHJhZy5vZmZzZXRUb3AgPCAwKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLnN0eWxlLnRvcCA9JzBweCc7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHdpbmRvdy5pbm5lckhlaWdodCA8IGhlaWdodCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6aG1Mb2dvRHJhZy5zdHlsZS50b3AgPXdpbmRvdy5pbm5lckhlaWdodC16aG1Mb2dvSWNvbkhlaWdodC1ib3R0b21TcGFjZSsncHgnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAvL2NsaWNr5LqL5Lu25aSE55CGCiAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2godHlwZSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd2aWRlbyc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih6aG1Mb2dvRHJhZy5vZmZzZXRUb3A9PXNlZG93blRvcCAmJiB3ZWIubGVuZ3RoID09IDAgJiYgemhtTG9nb0RyYWcub2Zmc2V0VG9wPjAgJiYgd2luZG93LmlubmVySGVpZ2h0ID4gaGVpZ2h0KXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCfor7flnKjop4bpopHmkq3mlL7pobXngrnlh7vlm77moIcnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ211c2ljJzoKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih6aG1Mb2dvRHJhZy5vZmZzZXRUb3A9PXNlZG93blRvcCAmJiBlLnRhcmdldC5jbGFzc05hbWUgPT0gJ2ljb25Mb2dvJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcignbW91c2Vtb3ZlJywgb25Nb3VzZU1vdmUpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3pobUxvZ29EcmFnLm9ubW91c2V1cCA9IG51bGw7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtdXNpY1VybERhdGEgPSBbCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge21hdGNoOi9eaHR0cHM/OlwvXC9tdXNpY1wuMTYzXC5jb21cLyNcLyg/OnNvbmd8ZGopXD9pZC99LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHttYXRjaDovXmh0dHBzPzpcL1wveVwubXVzaWNcLjE2M1wuY29tXC9tXC8oPzpzb25nfGRqKVw/aWQvfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bWF0Y2g6L15odHRwcz86XC9cL211c2ljXC4xNjNcLmNvbVwvKD86c29uZ3xkailcP2lkL30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge21hdGNoOi9eaHR0cHM/OlwvXC95XC5xcVwuY29tXC9uXC9yeXFxXC9wbGF5ZXIvfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bWF0Y2g6L2t1Z291XC5jb20vfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bWF0Y2g6L2t1d29cLmNuL30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge21hdGNoOi9eaHR0cHM/OlwvXC93d3dcLnhpbWFsYXlhXC5jb20vfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG11c2ljVXJsID0gbXVzaWNVcmxEYXRhLmZpbHRlcihmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsb2NhdGlvbi5ocmVmLm1hdGNoKGl0ZW0ubWF0Y2gpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihtdXNpY1VybC5sZW5ndGg9PTApewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KHdlYlswXS50aXApOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2god2ViWzBdLm5hbWUpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ25ldGVhc2UnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXRlYXNlRnVuKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3FxJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXFGdW4oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAna3Vnb3UnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrdWdvdUZ1bigpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdrdXdvJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga3V3b0Z1bigpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd4aW1hbGF5YSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhpbWFsYXlhRnVuKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBuZXRlYXNlRnVuKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0gX3RoaXMuZ2V0VXJsUGFyYW1zKGxvY2F0aW9uLmhyZWYpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodXJsUGFyYW1zLmlkID09IHVuZGVmaW5lZCkgcmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ldGVhc2VVcmxFbmNvZGUgPSBlbmNvZGVVUklDb21wb25lbnQoJ2h0dHBzOi8vbXVzaWMuMTYzLmNvbS9zb25nP2lkPScrdXJsUGFyYW1zLmlkKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcGVuVXJsID0gd2ViVXJsKyc/dXJsPScrbmV0ZWFzZVVybEVuY29kZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKG9wZW5VcmwpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHFxRnVuKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcXFTb25nTWF0Y2g7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIucGxheWVyX211c2ljX19pbmZvIikpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFxU29uZ01hdGNoID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiLnBsYXllcl9tdXNpY19faW5mbyIpLmNoaWxkTm9kZXNbMF0uaHJlZi5tYXRjaCgvc29uZ0RldGFpbFwvKFxTKilcPy8pOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiI3NpbV9zb25nX2luZm8iKSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXFTb25nTWF0Y2ggPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjc2ltX3NvbmdfaW5mbyIpLmNoaWxkTm9kZXNbMF0uaHJlZi5tYXRjaCgvc29uZ1wvKFxTKikuaHRtbC8pOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXFTb25nTWF0Y2ggPSAnJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighcXFTb25nTWF0Y2hbMV0pe2NvbnNvbGUubG9nKCfmsqHmnInojrflj5bliLDmrYzmm7JJRCcpOyByZXR1cm59OwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGF1ZGlvTGluayA9IGVuY29kZVVSSUNvbXBvbmVudChkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCJhdWRpbyIpLnNyYyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3BlblVybCA9IHdlYlVybCsnP2lkPScrcXFTb25nTWF0Y2hbMV0rJyZ0eXBlPXFxJnBsYXlVcmw9JythdWRpb0xpbms7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cub3BlbihvcGVuVXJsKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBrdWdvdUZ1bigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGF1ZGlvTW9kdWxlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2F1ZGlvTW9kdWxlJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhdWRpb01vZHVsZSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2F1ZGlvTW9kdWxlJykuc3R5bGU9J2JvdHRvbTowcHg7JzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjc2hvd0hpZGVfcGxheWJhcicpLmNsYXNzTmFtZSA9ICdpY29uIHNob3ctcGxheWJhci1idG4nOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn6K+354K55Ye75pKt5pS+6ZyA6KaB5LiL6L2955qE5q2M5puy77yM54S25ZCO5Zyo572R6aG15LiL5pa55pKt5pS+5Zmo5YaF54K55Ye7IuS4i+i9vSInLDIwMDApCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24ga3V3b0Z1bigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnBsYXlDb250cm9sJykuc3R5bGU9J2JvdHRvbTowcHgnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCfor7fngrnlh7vmkq3mlL7pnIDopoHkuIvovb3nmoTmrYzmm7LvvIznhLblkI7lnKjnvZHpobXkuIvmlrnmkq3mlL7lmajlhoXngrnlh7si5LiL6L29IicsMjAwMCkKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB4aW1hbGF5YUZ1bigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnhtLXBsYXllcicpLnN0eWxlPSdib3R0b206MHB4JzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn6K+354K55Ye75pKt5pS+6ZyA6KaB5LiL6L2955qE5q2M5puy77yM54S25ZCO5Zyo572R6aG15LiL5pa55pKt5pS+5Zmo5YaF54K55Ye7IuS4i+i9vSInLDIwMDApCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd5b3V0dWJlJzoKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKIAogICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIH07CiAKICAgICAgICAgICAgICAgICB9OwogCiAgICAgICAgICAgICAgICAgemhtTG9nb0RyYWcub25kcmFnc3RhcnQgPSBmdW5jdGlvbigpewogICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgLy/kuIvovb0KICAgICAgICAgICAgc3RhdGljIExSX2Rvd25sb2FkKHVybCxmaWxlbmFtZSl7CiAKICAgICAgICAgICAgICAgIGxldCB1YSA9IG5hdmlnYXRvci51c2VyQWdlbnQudG9Mb3dlckNhc2UoKTsKICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKHVhLm1hdGNoKC92ZXJzaW9uXC8oW1xkLl0rKS4qc2FmYXJpLykpOwogCiAgICAgICAgICAgICAgICBpZih1YS5tYXRjaCgvdmVyc2lvblwvKFtcZC5dKykuKnNhZmFyaS8pKXsKIAogICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKHVybCk7CiAKICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgR01fZG93bmxvYWQodXJsLGZpbGVuYW1lKTsKICAgICAgICAgICAgICAgIH0KIAogCiAgICAgICAgICAgIH0KIAogICAgICAgIH0KIAogICAgICAgIGNsYXNzIENvdXBvbkNsYXNzIGV4dGVuZHMgQmFzZUNsYXNzewogCiAgICAgICAgICAgIGNvbnN0cnVjdG9yKCl7CiAKICAgICAgICAgICAgICAgIHN1cGVyKCk7CiAKICAgICAgICAgICAgICAgIHRoaXMuZGl2RWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpOwogCiAgICAgICAgICAgICAgICB0aGlzLmRpdkVsZW1lbnQuaWQ9J3pobV9kaXZfcyc7CiAKICAgICAgICAgICAgfQogICAgICAgICAgICB0YW9iYW8oKXsKIAogICAgICAgICAgICAgICAgbGV0IG5vZGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjSl9qdVZhbGlkJyk7CiAKICAgICAgICAgICAgICAgIG5vZGUuc3R5bGU9J292ZXJmbG93OmluaGVyaXQ7JwogCiAgICAgICAgICAgICAgICBsZXQgY2xhc3NOYW1lID0gJ3pobV90YWJfdGFvYmFvJzsKIAogICAgICAgICAgICAgICAgdGhpcy5nZXRDb3Vwb25JbmZvKG5vZGUsY2xhc3NOYW1lKTsKICAgICAgICAgICAgfQogICAgICAgICAgICB0bWFsbCgpewogCiAgICAgICAgICAgICAgICBsZXQgbm9kZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5BY3Rpb25zLS1sZWZ0QnV0dG9ucy0tMU0zS2tGNycpP2RvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5BY3Rpb25zLS1sZWZ0QnV0dG9ucy0tMU0zS2tGNycpOmRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNKX0xpbmtCdXknKS5wYXJlbnROb2RlOwogCiAgICAgICAgICAgICAgICBsZXQgY2xhc3NOYW1lID0gJ3pobV90YWJfdG1hbGwnOwogCiAgICAgICAgICAgICAgICB0aGlzLmdldENvdXBvbkluZm8obm9kZSxjbGFzc05hbWUpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHRtYWxsQ2Fvc2hpKCl7CiAKICAgICAgICAgICAgICAgIGxldCBub2RlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLkFjdGlvbnMtLWxlZnRCdXR0b25zLS0xTTNLa0Y3Jyk/ZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLkFjdGlvbnMtLWxlZnRCdXR0b25zLS0xTTNLa0Y3Jyk6ZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI0pfTGlua0J1eScpLnBhcmVudE5vZGU7CiAKICAgICAgICAgICAgICAgIGxldCBjbGFzc05hbWUgPSAnemhtX3RhYl90bWFsbCc7CiAKICAgICAgICAgICAgICAgIHRoaXMuZ2V0Q291cG9uSW5mbyhub2RlLGNsYXNzTmFtZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdG1hbGxPdGhlcigpewogCiAgICAgICAgICAgICAgICBsZXQgbm9kZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy50bS1tc2ctYm94Jyk7CiAKICAgICAgICAgICAgICAgIGxldCBjbGFzc05hbWUgPSAnemhtX3RhYl90bWFsbCc7CiAKICAgICAgICAgICAgICAgIHRoaXMuZ2V0Q291cG9uSW5mbyhub2RlLGNsYXNzTmFtZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgamQoKXsKICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoKCk9PnsKIAogICAgICAgICAgICAgICAgICAgIGxldCBqZEdvb2RzSWQgPSBjb3Vwb25VcmwubWF0Y2goL2pkXC4oaGt8Y29tKVwvKFxTKikuaHRtbC8pOwogCiAgICAgICAgICAgICAgICAgICAgbGV0IG5vZGU9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNjaG9vc2UtYnRucycpOwogCiAgICAgICAgICAgICAgICAgICAgbm9kZS5iZWZvcmUodGhpcy5kaXZFbGVtZW50KTsKIAogICAgICAgICAgICAgICAgICAgIHRoaXMucmVxdWVzdCgnZ2V0JyxgaHR0cHM6Ly9hcGkudHlwZWNocm9tZS5jb20vaW5kZXhfamRfbmV3LnBocD9nb29kc19pZD0ke2pkR29vZHNJZFsyXX1gKS50aGVuKChyZXN1bHQpPT57CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3A9IEpTT04ucGFyc2UocmVzdWx0KTsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbD0nJzsKIAogICAgICAgICAgICAgICAgICAgICAgICByZXNwLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGh0bWwgKz0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgCiAgICAgICAgPGRpdiBjbGFzcz0iemhtX2NvdXBvbiIgc3R5bGU9Im1hcmdpbi1sZWZ0OjEwcHg7Ij4KICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX2xlZnQiPgogICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX2ltZ19pY29uIj4KICAgICAgICA8aW1nIHNyYz0iZGF0YTppbWFnZS9naWY7YmFzZTY0LFIwbEdPRGxoWkFCa0FIai9BQ0gvQzA1RlZGTkRRVkJGTWk0d0F3RUFBQUFoK1FRSkxBSC9BQ3dBQUFBQVpBQmtBS2Y2QkRuNkJEbjZCRG42QkRuNkJEbjZCRG42QkRuNkJEbjZCRG42QkRuNkJEcjZCVHI2QlRyNkJUcjZCVHI2QlRyNkJUcjZCanI2QmpyNkJqdjZCanY2Qmp2NkJqdjZCenY2Qnp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hza20ycUNwamNsaHJXUElpemxGUHJLTkNmSXlRa0gxSUdQalN6bVhUT0ptY2FPSjlkZ0dhbEZNNVlHVUVxelpLQWMrUm5RUGN2QllnRDJsc2psVzAyVU41Ylk1eEloZE1qcjY5OXBvMUxqTEJ4R0hNclcwU3p6anNsaGFVaFF2L1Z3UWRvQTBSY0NnNkpRSkhSdE5LYk5GSHYxTVFBQUFJZjRWVFdGa1pTQjNhWFJvSUZOamNtVmxibFJ2UjJsbUFEcz0iID4gICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX2NvbnRlbnQiPgogICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9tb25leSIgc3R5bGU9J21hcmdpbi10b3A6N3B4Oyc+CiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9hbW91bnRfbW9uZXkiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX21vbmV5X3NpZ24iIHN0eWxlPSdtYXJnaW4tdG9wOi0xMHB4Oyc+wqU8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9tb25leV9udW0iPiR7aXRlbS5kaXNjb3VudH08L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9jb25kaXRpb24iPua7oSR7aXRlbS5xdW90YX3lhYPlj6/nlKg8L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1fdGltZSIgc3R5bGU9J21hcmdpbi10b3A6MTBweDsnPgogICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1fdGVybSI+5pyJ5pWI5pyfPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9kYXRlIj4ke2l0ZW0uZW5kVGltZX08L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX2NpcmNsZSIgc3R5bGU9InJpZ2h0OjQ0cHg7Ij48L2Rpdj4KICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX2xpbmtfY291cG9uIiBzdHlsZT0icGFkZGluZzowcHggMTZweCAwcHggMTZweDsiPgogICAgICAgICAgICAgICAgPGEgY2xhc3M9InpobV9nZXRfbGlua190ZXh0IiBzdHlsZT0ibGV0dGVyLXNwYWNpbmc6IDEwcHg7Zm9udC1zaXplOjE2cHg7bWFyZ2luLXRvcDoxMHB4OyIgaHJlZj0iJHtpdGVtLmNvdXBvbl9saW5rfSIgdGFyZ2V0PSdfYmxhbmsnIHJlbD0nbm9vcGVuZXIgbm9yZWZlcnJlciBub2ZvbGxvdycgc3R5bGU9Im1hcmdpbi1sZWZ0OjE2cHg7d2lkdGg6MzRweDsiPumihuWPljwvYT4KICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgPC9kaXY+CiAgICAgICAgYAogICAgICAgICAgICAgICAgICAgICAgICB9KTsKIAogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnemhtX2Rpdl9zJykuaW5uZXJIVE1MID0gaHRtbDsKIAogICAgICAgICAgICAgICAgICAgIH0pCiAKIAogCiAgICAgICAgICAgICAgICB9LGNvdXBvbldhaXRUaW1lKQogICAgICAgICAgICB9CiAKICAgICAgICAgICAgZ2V0Q291cG9uSW5mbyhub2RlLGNsYXNzTmFtZSl7CiAKICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoKCk9PnsKIAogICAgICAgICAgICAgICAgICAgIGxldCBnb29kc19pZCA9IHRoaXMuZ2V0UXVlcnlTdHJpbmcoJ2lkJyk7CiAKICAgICAgICAgICAgICAgICAgICBpZighZ29vZHNfaWQpe2NvbnNvbGUubG9nKCdnb29kc19pZCcpO3JldHVybn07CiAKICAgICAgICAgICAgICAgICAgICBpZihjbGFzc05hbWUgPT0gJ3pobV90YWJfdGFvYmFvJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5xdWVyeVNlbGVjdG9yKCdkaXY6bnRoLW9mLXR5cGUoMSknKS5iZWZvcmUodGhpcy5kaXZFbGVtZW50KTsKIAogICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICBub2RlLmJlZm9yZSh0aGlzLmRpdkVsZW1lbnQpOwogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIHRoaXMucmVxdWVzdCgnZ2V0JyxgaHR0cHM6Ly9hcGkudHlwZWNocm9tZS5jb20vaW5kZXhfbmV3LnBocD9nb29kc19pZD0ke2dvb2RzX2lkfWApLnRoZW4oKHJlc3VsdCk9PnsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZihyZXN1bHQpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzcD0gSlNPTi5wYXJzZShyZXN1bHQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYAogICAgICAgIDxkaXYgY2xhc3M9InpobV9jb3Vwb24iPgogICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1fbGVmdCI+CiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1faW1nX2ljb24iPgogICAgICAgIDxpbWcgc3JjPSJkYXRhOmltYWdlL2dpZjtiYXNlNjQsUjBsR09EbGhaQUJrQUhqL0FDSC9DMDVGVkZORFFWQkZNaTR3QXdFQUFBQWgrUVFKTEFIL0FDd0FBQUFBWkFCa0FLZjZCRG42QkRuNkJEbjZCRG42QkRuNkJEbjZCRG42QkRuNkJEbjZCRG42QkR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OVdFUS8xSzFJeFpJWmt4c3BjaWttQ0RsYUNPTHY0WEZGdytrUXRudzFER3VZVnJTaHNrbTJxQ3BqY2xocldQSWl6bEZQcktOQ2ZJeVFrSDFJR1BqU3ptWFRPSm1jYU9KOWRnR2FsRk01WUdVRXF6WktBYytSblFQY3ZCWWdEMmxzamxXMDJVTjViWTV4SWhkTWpyNjk5cG8xTGpMQnhHSE1yVzBTenpqc2xoYVVoUXYvVndRZG9BMFJjQ2c2SlFKSFJ0TktiTkZIdjFNUUFBQUlmNFZUV0ZrWlNCM2FYUm9JRk5qY21WbGJsUnZSMmxtQURzPSIgPiAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1fY29udGVudCI+CiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX21vbmV5Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX2Ftb3VudF9tb25leSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1fbW9uZXlfc2lnbiI+wqU8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9tb25leV9udW0iPiR7cmVzcC55b3VodWlxdWFufTwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX2NvbmRpdGlvbiI+JHtyZXNwLmNvdXBvbl9pbmZvfTwvZGl2PgogICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV90aW1lIj4KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX3Rlcm0iPuacieaViOacnzwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ6aG1fZGF0ZSI+JHtyZXNwLmNvdXBvbl9lbmRfdGltZX08L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgPGRpdiBjbGFzcz0iemhtX2NpcmNsZSI+PC9kaXY+CiAgICAgICAgICAgIDxkaXYgY2xhc3M9InpobV9saW5rX2NvdXBvbiIgc3R5bGU9Im1hcmdpbi1yaWdodDoiPgogICAgICAgICAgICA8YSBjbGFzcz0iemhtX2dldF9saW5rX3RleHQiPuaJq+eggemihuWPljwvYT4KICAgICAgICAgICAgPGRpdiBpZD0idGJxcmNvZGUiIGNsYXNzPSJ6aG1fcXJjb2RlIj48L2Rpdj4KICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgPC9kaXY+CiAgICAgICAgYDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCd6aG1fZGl2X3MnKS5pbm5lckhUTUw9aHRtbDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHFyY29kZSA9IG5ldyBRUkNvZGUoInRicXJjb2RlIiwgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiA2NywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDY3LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yRGFyayA6ICIjMTIxMjEyIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvckxpZ2h0IDogIiNmZmZmZmYiLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvcnJlY3RMZXZlbCA6IFFSQ29kZS5Db3JyZWN0TGV2ZWwuTQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFyY29kZS5tYWtlQ29kZShyZXNwLmNvZGVfdXJsKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLkFjdGlvbnMtLXJvb3QtLWh3RXVqZ2MnKSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuQWN0aW9ucy0tcm9vdC0taHdFdWpnYycpLnN0eWxlPSJwb3NpdGlvbjp1bnNldCI7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICB9LGNvdXBvbldhaXRUaW1lKTsKICAgICAgICAgICAgfQogCiAgICAgICAgfQogCiAgICAgICAgY2xhc3MgUGxheVZpZGVvQ2xhc3MgZXh0ZW5kcyBCYXNlQ2xhc3N7CiAgICAgICAgICAgIGNvbnN0cnVjdG9yKCl7CiAgICAgICAgICAgICAgICBzdXBlcigpOwogICAgICAgICAgICB9CiAKICAgICAgICB9CiAKICAgICAgICBjbGFzcyBQbGF5TXVzaWNDbGFzcyBleHRlbmRzIEJhc2VDbGFzc3sKICAgICAgICAgICAgY29uc3RydWN0b3IoKXsKICAgICAgICAgICAgICAgIHN1cGVyKCk7CiAgICAgICAgICAgIH0KIAogICAgICAgICAgICB4bWx5Q3JlYXRlQ2hlY2tib3goKXsKIAogICAgICAgICAgICAgICAgbGV0IHNvdW5kTGlzdGxpID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLnNvdW5kLWxpc3QgdWwgbGknKTsKIAogICAgICAgICAgICAgICAgc291bmRMaXN0bGkuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgIGxldCBjaGVja2JveGVkID0gaXRlbS5xdWVyeVNlbGVjdG9yKCdpbnB1dCcpOwogCiAgICAgICAgICAgICAgICAgICAgaWYoY2hlY2tib3hlZCl7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBpdGVtLnF1ZXJ5U2VsZWN0b3IoJy50ZXh0Jyk7CiAKICAgICAgICAgICAgICAgICAgICBpZighdGl0bGUpewogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgfTsKIAogICAgICAgICAgICAgICAgICAgIHRpdGxlLnN0eWxlID0gIndpZHRoOjM2MHB4IjsKIAogICAgICAgICAgICAgICAgICAgIGxldCBzcmMgPSB0aXRsZS5xdWVyeVNlbGVjdG9yKCdhJykuZ2V0QXR0cmlidXRlKCdocmVmJyk7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgZmlyc3REb20gPSBpdGVtLnF1ZXJ5U2VsZWN0b3IoJy5pY29uLXdyYXBwZXInKTsKIAogICAgICAgICAgICAgICAgICAgIGxldCBpbnB1dERvbSA9IGZpcnN0RG9tLmNsb25lTm9kZSh0cnVlKTsKIAogICAgICAgICAgICAgICAgICAgIGlucHV0RG9tLnN0eWxlPSAnbWluLXdpZHRoOiAwcHg7JzsKIAogICAgICAgICAgICAgICAgICAgIGlucHV0RG9tLmlubmVySFRNTCA9ICI8aW5wdXQgdHlwZT0nY2hlY2tib3gnIG5hbWU9J3pobUNoZWNrYm94JyB2YWx1ZT0iK3NyYysiICBjbGFzcz0nemhtQ2hlY2tib3gnPiI7CiAKICAgICAgICAgICAgICAgICAgICBmaXJzdERvbS5iZWZvcmUoaW5wdXREb20pOwogCiAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgIH0KICAgICAgICB9CiAKICAgICAgICBjbGFzcyBaaENsYXNzIGV4dGVuZHMgQmFzZUNsYXNzewogCiAgICAgICAgICAgIGNvbnN0cnVjdG9yKCl7CiAgICAgICAgICAgICAgICBzdXBlcigpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHNob3dTcGVjaWFsQ29sdW1uKCl7CiAKICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYgPT0gJ2h0dHBzOi8vd3d3LnpoaWh1LmNvbS8nKXsKIAogICAgICAgICAgICAgICAgICAgIGxldCBjYXJkUmVjb21tZW5kID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLkZlZWQnKTsKIAogICAgICAgICAgICAgICAgICAgIGlmKGNhcmRSZWNvbW1lbmQubGVuZ3RoID4wKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBjYXJkUmVjb21tZW5kLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0ucXVlcnlTZWxlY3RvcignLnNwZWNpYWxDb2x1bW4nKSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YVpvcCA9IEpTT04ucGFyc2UoaXRlbS5nZXRBdHRyaWJ1dGUoJ2RhdGEtemEtZXh0cmEtbW9kdWxlJykpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighZGF0YVpvcClyZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0eXBlID0gZGF0YVpvcC5jYXJkLmNvbnRlbnQudHlwZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZSA9PSAnUG9zdCcpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gaXRlbS5xdWVyeVNlbGVjdG9yKCdkaXY+ZGl2PmgyPnNwYW4+YScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXRpdGxlKXJldHVybjsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdFbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYnV0dG9uJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmNsYXNzTmFtZSA9ICdzcGVjaWFsQ29sdW1uIEJ1dHRvbiBWb3RlQnV0dG9uIFZvdGVCdXR0b24tLXVwJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuc3R5bGUgPSAnbGluZS1oZWlnaHQ6MjBweDtwYWRkaW5nOjBweCA1cHg7bWFyZ2luLXJpZ2h0OjVweDtib3JkZXItcmFkaXVzOjJweDsnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3RWxlbWVudC5pbm5lclRleHQgPSAn5paH56ugJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlLmJlZm9yZShuZXdFbGVtZW50KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmLm1hdGNoKC9odHRwcz86XC9cL3d3dy56aGlodS5jb21cL3NlYXJjaC8pKXsKICAgICAgICAgICAgICAgICAgICBsZXQgbj0wOwogCiAgICAgICAgICAgICAgICAgICAgbGV0IHRpbWVyPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjYXJkU2VhcmNoID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLlNlYXJjaFJlc3VsdC1DYXJkJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYobisrPjYwMCl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNhcmRTZWFyY2gubGVuZ3RoID4wKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhcmRTZWFyY2guZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0ucXVlcnlTZWxlY3RvcignLnNwZWNpYWxDb2x1bW4nKSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YVpvcCA9IEpTT04ucGFyc2UoaXRlbS5nZXRBdHRyaWJ1dGUoJ2RhdGEtemEtZXh0cmEtbW9kdWxlJykpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWRhdGFab3ApcmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhWm9wLmNhcmQuY29udGVudC50eXBlOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZSA9PSAnUG9zdCcpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IGl0ZW0ucXVlcnlTZWxlY3RvcignZGl2PmRpdj5oMj5zcGFuPmRpdj5hJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXRpdGxlKXJldHVybjsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3RWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2J1dHRvbicpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuY2xhc3NOYW1lID0gJ3NwZWNpYWxDb2x1bW4gQnV0dG9uIFZvdGVCdXR0b24gVm90ZUJ1dHRvbi0tdXAnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuc3R5bGUgPSAnbGluZS1oZWlnaHQ6MjBweDtwYWRkaW5nOjBweCA1cHg7bWFyZ2luLXJpZ2h0OjVweDsnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuaW5uZXJUZXh0ID0gJ+aWh+eroCc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUuYmVmb3JlKG5ld0VsZW1lbnQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAKICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBzaG93VmlkZW9UaXRsZSgpewogCiAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmID09ICdodHRwczovL3d3dy56aGlodS5jb20vJyl7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgY2FyZFJlY29tbWVuZCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5GZWVkJyk7CiAKICAgICAgICAgICAgICAgICAgICBpZihjYXJkUmVjb21tZW5kLmxlbmd0aCA+MCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgY2FyZFJlY29tbWVuZC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpdGVtLnF1ZXJ5U2VsZWN0b3IoJy52aWRlb1RpdGxlJykpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGFab3AgPSBKU09OLnBhcnNlKGl0ZW0uZ2V0QXR0cmlidXRlKCdkYXRhLXphLWV4dHJhLW1vZHVsZScpKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWRhdGFab3ApcmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaGFzVmlkZW8gPSBkYXRhWm9wLmNhcmQuaGFzX3ZpZGVvOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihoYXNWaWRlbyA9PSB0cnVlKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0ucXVlcnlTZWxlY3RvcignZGl2PmRpdj5oMj5kaXY+YScpKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IGl0ZW0ucXVlcnlTZWxlY3RvcignZGl2PmRpdj5oMj5kaXY+YScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoaXRlbS5xdWVyeVNlbGVjdG9yKCdkaXY+ZGl2PmgyPnNwYW4+YScpKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IGl0ZW0ucXVlcnlTZWxlY3RvcignZGl2PmRpdj5oMj5zcGFuPmEnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3RWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2J1dHRvbicpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3RWxlbWVudC5jbGFzc05hbWUgPSAndmlkZW9UaXRsZSc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LnN0eWxlID0gJ2JhY2tncm91bmQ6IHJnYmEoMjU1LCAxMzEsIDg2LCAwLjEyKTtjb2xvcjogcmdiKDI1NSwgNzMsIDEyKTtsaW5lLWhlaWdodDoyMHB4O3BhZGRpbmc6MXB4IDZweDttYXJnaW4tcmlnaHQ6NXB4O2JvcmRlci1yYWRpdXM6MnB4O2ZvbnQtc2l6ZToxNHB4Oyc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmlubmVyVGV4dCA9ICfop4bpopEnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUuYmVmb3JlKG5ld0VsZW1lbnQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYubWF0Y2goL2h0dHBzPzpcL1wvd3d3LnpoaWh1LmNvbVwvc2VhcmNoLykpewogCiAgICAgICAgICAgICAgICAgICAgbGV0IG49MDsKIAogICAgICAgICAgICAgICAgICAgIGxldCB0aW1lcj0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgY2FyZFNlYXJjaCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5TZWFyY2hSZXN1bHQtQ2FyZCcpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKG4rKz42MDApewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICBpZihjYXJkU2VhcmNoLmxlbmd0aCA+MCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXJkU2VhcmNoLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpdGVtLnF1ZXJ5U2VsZWN0b3IoJy52aWRlb1RpdGxlJykpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGFab3AgPSBKU09OLnBhcnNlKGl0ZW0uZ2V0QXR0cmlidXRlKCdkYXRhLXphLWV4dHJhLW1vZHVsZScpKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFkYXRhWm9wKXJldHVybjsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0eXBlID0gZGF0YVpvcC5jYXJkLmNvbnRlbnQudHlwZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGUgPT0gJ1p2aWRlbycgKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBpdGVtLnF1ZXJ5U2VsZWN0b3IoJ2Rpdj5kaXY+aDI+c3Bhbj5kaXY+YScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCF0aXRsZSlyZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld0VsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdidXR0b24nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmNsYXNzTmFtZSA9ICd2aWRlb1RpdGxlJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LnN0eWxlID0gJ2JhY2tncm91bmQ6IHJnYmEoMjU1LCAxMzEsIDg2LCAwLjEyKTtjb2xvcjogcmdiKDI1NSwgNzMsIDEyKTtsaW5lLWhlaWdodDoyMHB4O3BhZGRpbmc6MXB4IDZweDttYXJnaW4tcmlnaHQ6NXB4O2JvcmRlci1yYWRpdXM6MnB4O2ZvbnQtc2l6ZToxNHB4Oyc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3RWxlbWVudC5pbm5lclRleHQgPSAn6KeG6aKRJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZS5iZWZvcmUobmV3RWxlbWVudCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgICAgICB9CiAKIAogICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmVtb3ZlVmlkZW8oKXsKIAogICAgICAgICAgICAgICAgbGV0IGNhcmQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuRmVlZCcpOwogCiAgICAgICAgICAgICAgICBjYXJkLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YVpvcCA9IEpTT04ucGFyc2UoaXRlbS5nZXRBdHRyaWJ1dGUoJ2RhdGEtemEtZXh0cmEtbW9kdWxlJykpOwogCiAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvID0gZGF0YVpvcC5jYXJkLmNvbnRlbnQudmlkZW9faWQ7CiAKICAgICAgICAgICAgICAgICAgICBpZih2aWRlbyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5wYXJlbnROb2RlLnN0eWxlPSdkaXNwbGF5Om5vbmU7JzsKIAogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgfQogICAgICAgICAgICByZW1vdmVBRCgpewogCiAgICAgICAgICAgICAgICBsZXQgemhIaWRlQUQgPSBgLlBjLWNhcmQsLlBjLXdvcmR7ZGlzcGxheTpub25lICFpbXBvcnRhbnQ7fS5Ub3BzdG9yeUl0ZW0tLWFkdmVydENhcmR7ZGlzcGxheTpub25lICFpbXBvcnRhbnR9YDsKIAogICAgICAgICAgICAgICAgZG9tU3R5bGUgLmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKHpoSGlkZUFEKSk7CiAKICAgICAgICAgICAgICAgIGRvbUhlYWQuYXBwZW5kQ2hpbGQoZG9tU3R5bGUpOwogCiAgICAgICAgICAgIH0KICAgICAgICAgICAgZG93bmxvYWRWaWRlbygpewogCiAgICAgICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzOwogICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYubWF0Y2goL2h0dHBzOlwvXC93d3dcLnpoaWh1XC5jb21cL3p2aWRlb1wvLisvKSl7CiAKICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnpobURvd25sb2FkJykpcmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2aWRlb0RvbSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ3ZpZGVvJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ3ZpZGVvJykpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBidXR0b24gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuX2UyOTZwZycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGJ1dHRvbi5sZW5ndGg8MilyZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRvd25sb2FkQnV0ID0gYnV0dG9uWzFdLmNsb25lTm9kZSh0cnVlKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZighZG93bmxvYWRCdXQucXVlcnlTZWxlY3RvcignLl8xdGc4b2lyJykpcmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGRvd25sb2FkQnV0LnF1ZXJ5U2VsZWN0b3IoJy5fMXRnOG9pcicpLmlubmVyVGV4dD0n5LiL6L29JzsKIAogICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEJ1dC5zZXRBdHRyaWJ1dGUoJ2lkJywnZG93bmxvYWRWaWRlbycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGJ1dHRvblsxXS5iZWZvcmUoZG93bmxvYWRCdXQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNkb3dubG9hZFZpZGVvJykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWRlb0lkOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuWlZpZGVvLXBsYXllcicpKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6VmlkZW8gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuWlZpZGVvJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9EYXRhID0gSlNPTi5wYXJzZSh6VmlkZW8uZ2V0QXR0cmlidXRlKCdkYXRhLXphLWV4dHJhLW1vZHVsZScpKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvSWQgPSB2aWRlb0RhdGEuY2FyZC5jb250ZW50LnZpZGVvX2lkOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2aWRlb1VybCA9IHdpbmRvdy5sb2NhdGlvbi5ocmVmOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvT2JqID0gdmlkZW9Vcmwuc3BsaXQoJz8nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvSWQgPSB2aWRlb09ialswXS5zcGxpdCgnLycpLnBvcCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighdmlkZW9JZCl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+acquiOt+WPluinhumikWlkJyk7cmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6aERvd25sb2FkKHZpZGVvSWQpOwogICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgfSwyMDAwKTsKIAogICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCdET01Ob2RlSW5zZXJ0ZWQnLChlKSA9PiB7CiAKICAgICAgICAgICAgICAgICAgICBpZighZS5yZWxhdGVkTm9kZS5xdWVyeVNlbGVjdG9yKSByZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICB2YXIgcGxheUJhciA9IGUucmVsYXRlZE5vZGUucXVlcnlTZWxlY3RvcignOnNjb3BlID4gZGl2Omxhc3QtY2hpbGQgPiBkaXY6Zmlyc3QtY2hpbGQgPiBkaXY6bnRoLW9mLXR5cGUoMiknKTsKIAogICAgICAgICAgICAgICAgICAgIGlmKCFwbGF5QmFyIHx8IHBsYXlCYXIucXVlcnlTZWxlY3RvcignLnpobURvd25sb2FkJykpIHJldHVybjsKIAogICAgICAgICAgICAgICAgICAgIGlmKHBsYXlCYXIuY2xhc3NOYW1lICE9ICdjc3MtMTk5cXg3bScpcmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwbGF5QnV0PSBwbGF5QmFyLnBhcmVudE5vZGUucXVlcnlTZWxlY3RvcignLl8xYzFjdnVnJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlCdXRMaSA9IHBsYXlCdXQucXVlcnlTZWxlY3RvcignOnNjb3BlID4gZGl2Omxhc3QtY2hpbGQgPiBkaXY6Zmlyc3QtY2hpbGQnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZighcGxheUJ1dExpKSByZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRvd25sb2FkQnV0ID0gcGxheUJ1dExpLmNsb25lTm9kZSh0cnVlKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEJ1dC5jbGFzc05hbWUgPSBwbGF5QnV0TGkuY2xhc3NOYW1lICsgJyB6aG1Eb3dubG9hZCc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWRvd25sb2FkQnV0LnF1ZXJ5U2VsZWN0b3IoJy5fMXRnOG9pcicpKSByZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRCdXQucXVlcnlTZWxlY3RvcignLl8xdGc4b2lyJykuaW5uZXJUZXh0PSfkuIvovb0nOwogCiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlCdXRMaS5iZWZvcmUoZG93bmxvYWRCdXQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGRvd25sb2FkQnV0LmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkZW9JZDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZ2V0VmlkZW9EYXRhKGRvbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFyZW50RG9tID0gZG9tLnBhcmVudE5vZGUKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBhcmVudERvbS5jbGFzc05hbWUgJiYgcGFyZW50RG9tLmNsYXNzTmFtZT09J0ZlZWQnKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhwYXJlbnREb20uY2xhc3NOYW1lKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9EYXRhID0gSlNPTi5wYXJzZShwYXJlbnREb20uZ2V0QXR0cmlidXRlKCdkYXRhLXphLWV4dHJhLW1vZHVsZScpKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlb0lkID0gdmlkZW9EYXRhLmNhcmQuY29udGVudC52aWRlb19pZDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRWaWRlb0RhdGEocGFyZW50RG9tKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0VmlkZW9EYXRhKHBsYXlCdXQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKHZpZGVvSWQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighdmlkZW9JZCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5pyq6I635Y+W6KeG6aKRaWQnKTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHpoRG93bmxvYWQodmlkZW9JZCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgIH0sMTAwMCk7CiAKICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgZnVuY3Rpb24gemhEb3dubG9hZCh2aWRlb0lkKXsKIAogICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSAnaHR0cHM6Ly9sZW5zLnpoaWh1LmNvbS9hcGkvdjQvdmlkZW9zLycrdmlkZW9JZDsKIAogICAgICAgICAgICAgICAgICAgIF90aGlzLnJlcXVlc3QoJ2dldCcsdXJsKS50aGVuKChyZXN1bHQpPT57CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGEgPSBKU09OLnBhcnNlKHJlc3VsdCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoZGF0YS5wbGF5bGlzdCAhPSB1bmRlZmluZWQpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheV91cmwgPSBkYXRhLnBsYXlsaXN0LkxELnBsYXlfdXJsOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9OYW1lID0gdmlkZW9JZCsiLm1wNCI7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKHBsYXlfdXJsKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLkxSX2Rvd25sb2FkKHBsYXlfdXJsLHZpZGVvTmFtZSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn5LiL6L295aSx6LSl77yBJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmVtb3ZlUmlnaHQoKXsKICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYubWF0Y2goL15odHRwcz86XC9cL3d3d1wuemhpaHVcLmNvbVwvcGVvcGxlXC8uKi8pKXsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIGxldCB6aEZ1bGxTY3JlZW4gPSBgLkdsb2JhbFNpZGVCYXIge2Rpc3BsYXk6IG5vbmUgIWltcG9ydGFudDt9CiAgICAgICAgICAgICAgICAgICAgLmNzcy0xcXl5dGo3e2Rpc3BsYXk6IG5vbmUgIWltcG9ydGFudDt9CiAgICAgICAgICAgICAgICAgICAgLlF1ZXN0aW9uLXNpZGVDb2x1bW57ZGlzcGxheTpub25lICFpbXBvcnRhbnR9CiAgICAgICAgICAgICAgICAgICAgLlRvcHN0b3J5LW1haW5Db2x1bW57d2lkdGg6MTAwJSAhaW1wb3J0YW50fQogICAgICAgICAgICAgICAgICAgIC5RdWVzdGlvbi1tYWluQ29sdW1ue3dpZHRoOjEwMDBweCAhaW1wb3J0YW50fQogICAgICAgICAgICAgICAgICAgIC5jc3MtY2F6ZzQ4e21hcmdpbjogMHB4IDE2cHggMHB4IDBweCAhaW1wb3J0YW50O30KICAgICAgICAgICAgICAgICAgICAuUXVlc3Rpb25XYWl0aW5nLW1haW5Db2x1bW57d2lkdGg6MTAwJSAhaW1wb3J0YW50O30KICAgICAgICAgICAgICAgICAgICAuY3NzLTFqNWQzbGx7cGFkZGluZy1sZWZ0OjEwcHg7fQogICAgICAgICAgICAgICAgICAgIC5jc3MteWhqd29le2p1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbiAhaW1wb3J0YW50O30KICAgICAgICAgICAgICAgICAgICAuQXV0aG9ySW5mb3ttYXgtd2lkdGg6MTAwMHB4ICFpbXBvcnRhbnQ7fTsKICAgICAgICAgICAgICAgICAgICBgOwogICAgICAgICAgICAgICAgZG9tU3R5bGUgLmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKHpoRnVsbFNjcmVlbikpOwogCiAgICAgICAgICAgICAgICBkb21IZWFkLmFwcGVuZENoaWxkKGRvbVN0eWxlKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBjaGFuZ2VMaW5rKCl7CiAKICAgICAgICAgICAgICAgIGlmKGNvdXBvblVybC5pbmRleE9mKCd0YXJnZXQnKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgb2JqID0gdGhpcy5nZXRVcmxQYXJhbXMoY291cG9uVXJsKTsKIAogICAgICAgICAgICAgICAgICAgIGlmKG9iai50YXJnZXQgPT0gdW5kZWZpbmVkKSByZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICBsZXQgbGluayA9IGRlY29kZVVSSUNvbXBvbmVudChvYmoudGFyZ2V0KTsKIAogICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uLmhyZWY9bGluazsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZW1vdmVLZXl3b3JkKCl7CiAKICAgICAgICAgICAgICAgIHZhciBHTUtleXdvcmQgPSBHTV9nZXRWYWx1ZSgnaW5wdXRaaEtleXdvcmQnLCcwJyk7CiAKICAgICAgICAgICAgICAgIGlmKEdNS2V5d29yZCA9PSAnMCcgfHwgR01LZXl3b3JkID09ICcnKSByZXR1cm47CiAKICAgICAgICAgICAgICAgIGxldCBrZXl3b3JkID0gR01LZXl3b3JkLnNwbGl0KCcsJyk7CiAKICAgICAgICAgICAgICAgIGxldCBjb250ZW50ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLkNvbnRlbnRJdGVtJyk7CiAKICAgICAgICAgICAgICAgIGtleXdvcmQuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgIGNvbnRlbnQuZm9yRWFjaChmdW5jdGlvbih2YWx1ZSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGFab3AgPSBKU09OLnBhcnNlKHZhbHVlLmdldEF0dHJpYnV0ZSgnZGF0YS16b3AnKSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoZGF0YVpvcCAmJiBkYXRhWm9wLnRpdGxlLmluZGV4T2YoaXRlbSkgIT0gLTEpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaXRlbUNhcmQgPSB2YWx1ZS5wYXJlbnROb2RlLnBhcmVudE5vZGUucGFyZW50Tm9kZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGl0ZW1DYXJkQ2xhc3M9IGl0ZW1DYXJkLmNsYXNzTmFtZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXRlbUNhcmRDbGFzcy5pbmRleE9mKCdUb3BzdG9yeUl0ZW0taXNSZWNvbW1lbmQnKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtQ2FyZC5zdHlsZT0nZGlzcGxheTpub25lJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmVtb3ZlQXV0aG9yTmFtZSgpewogCiAgICAgICAgICAgICAgICB2YXIgR01BdXRob3JOYW1lID0gR01fZ2V0VmFsdWUoJ2lucHV0WmhBdXRob3JOYW1lJywnMCcpOwogCiAgICAgICAgICAgICAgICBpZihHTUF1dGhvck5hbWUgPT0gJzAnIHx8IEdNQXV0aG9yTmFtZSA9PSAnJykgcmV0dXJuOwogCiAgICAgICAgICAgICAgICBsZXQgYXV0aG9yTmFtZSA9IEdNQXV0aG9yTmFtZS5zcGxpdCgnLCcpOwogCiAgICAgICAgICAgICAgICAvL+aQnOe0oumhtQogICAgICAgICAgICAgICAgaWYobG9jYXRpb24uaHJlZi5tYXRjaCgvXmh0dHBzPzpcL1wvd3d3LnpoaWh1LmNvbVwvc2VhcmNoLykpewogCiAgICAgICAgICAgICAgICAgICAgbGV0IG49MDsKIAogICAgICAgICAgICAgICAgICAgIGxldCB0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgdXNlckxpbmsgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuQ2FyZCcpOwogCiAgICAgICAgICAgICAgICAgICAgaWYodXNlckxpbmsubGVuZ3RoID4gNSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CiAKICAgICAgICAgICAgICAgICAgICAgICAgdXNlckxpbmsuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXV0aG9yID0gaXRlbS5xdWVyeVNlbGVjdG9yKCdiJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXV0aG9yKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXV0aG9yTmFtZS5pbmRleE9mKGF1dGhvci5pbm5lclRleHQpICE9IC0xKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uc3R5bGUgPSAnZGlzcGxheTpub25lJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYobj4zMCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuKys7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIH0sMTAwKQogCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAvL+WbnuetlOmhtQogICAgICAgICAgICAgICAgaWYobG9jYXRpb24uaHJlZi5tYXRjaCgvXmh0dHBzPzpcL1wvd3d3LnpoaWh1LmNvbVwvcXVlc3Rpb25cLy4qLykpewogCiAgICAgICAgICAgICAgICAgICAgbGV0IGl0ZW1Eb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuTGlzdC1pdGVtJyk7CiAKICAgICAgICAgICAgICAgICAgICBpZihpdGVtRG9tLmxlbmd0aD4wKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBpdGVtRG9tLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250ZW50ID0gaXRlbS5xdWVyeVNlbGVjdG9yKCcuQ29udGVudEl0ZW0nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoY29udGVudCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YVpvcCA9IEpTT04ucGFyc2UoY29udGVudC5nZXRBdHRyaWJ1dGUoJ2RhdGEtem9wJykpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXV0aG9yTmFtZS5pbmRleE9mKGRhdGFab3AuYXV0aG9yTmFtZSkgIT0gLTEpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uc3R5bGUgPSAnZGlzcGxheTpub25lJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC8v562J5L2g5Zue562U6aG1CiAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmID09ICdodHRwczovL3d3dy56aGlodS5jb20vcXVlc3Rpb24vd2FpdGluZycpewogCiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBxdWVzdGlvbkxpc3QgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuanNOYXZpZ2FibGUnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZihxdWVzdGlvbkxpc3QubGVuZ3RoPjApewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWVzdGlvbkxpc3QuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdXRob3JEb21UZXh0ID0gaXRlbS5xdWVyeVNlbGVjdG9yKCcuY3NzLXRuc2F4aCcpLmlubmVyVGV4dDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF1dGhvckRvbVRleHQpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdXRob3IgPSBhdXRob3JEb21UZXh0LnJlcGxhY2UoJyInLCcnKS5yZXBsYWNlKCfnmoTmj5Dpl64nLCcnKS5yZXBsYWNlKC8oXlxzKyl8KFxzKyQpL2csJycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF1dGhvcil7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF1dGhvck5hbWUuaW5kZXhPZihhdXRob3IpICE9IC0xKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uc3R5bGU9J2Rpc3BsYXk6bm9uZTsnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIH0sMzAwKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLy/mjqjojZDpobUKICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYgPT0gJ2h0dHBzOi8vd3d3LnpoaWh1LmNvbS8nKXsKIAogICAgICAgICAgICAgICAgICAgIGxldCBjb250ZW50ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLkNvbnRlbnRJdGVtJyk7CiAKICAgICAgICAgICAgICAgICAgICBjb250ZW50LmZvckVhY2goZnVuY3Rpb24odmFsdWUpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhWm9wID0gSlNPTi5wYXJzZSh2YWx1ZS5nZXRBdHRyaWJ1dGUoJ2RhdGEtem9wJykpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF1dGhvck5hbWUuaW5kZXhPZihkYXRhWm9wLmF1dGhvck5hbWUpICE9IC0xKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGl0ZW1DYXJkID0gdmFsdWUucGFyZW50Tm9kZS5wYXJlbnROb2RlLnBhcmVudE5vZGU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW1DYXJkKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1DYXJkLnN0eWxlPSdkaXNwbGF5Om5vbmUnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIHJlbW92ZVlhbnh1YW4oKXsKIAogICAgICAgICAgICAgICAgLy/lm57nrZTpobUKICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYubWF0Y2goL15odHRwcz86XC9cL3d3dy56aGlodS5jb21cL3F1ZXN0aW9uXC8uKi8pKXsKIAogICAgICAgICAgICAgICAgICAgIGxldCBpdGVtRG9tID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLkxpc3QtaXRlbScpOwogCiAgICAgICAgICAgICAgICAgICAgaWYoaXRlbURvbS5sZW5ndGg+MCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaXRlbURvbS5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29udGVudCA9IGl0ZW0ucXVlcnlTZWxlY3RvcignLktmZUNvbGxlY3Rpb24tT3JkaW5hcnlMYWJlbC1jb250ZW50Jyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNvbnRlbnQgJiYgY29udGVudC5pbm5lclRleHQuaW5kZXhPZign55uQ6YCJJykgIT0gLTEpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5zdHlsZSA9ICdkaXNwbGF5Om5vbmUnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICBsZXQgYW5zd2VyQ2FyZCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5BbnN3ZXJDYXJkJyk7CiAKICAgICAgICAgICAgICAgICAgICBpZihhbnN3ZXJDYXJkKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29udGVudCA9IGFuc3dlckNhcmQucXVlcnlTZWxlY3RvcignLktmZUNvbGxlY3Rpb24tT3JkaW5hcnlMYWJlbC1jb250ZW50Jyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoY29udGVudCAmJiBjb250ZW50LmlubmVyVGV4dC5pbmRleE9mKCfnm5DpgIknKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuc3dlckNhcmQuc3R5bGUgPSAnZGlzcGxheTpub25lJzsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAvL+aQnOe0oumhtQogICAgICAgICAgICAgICAgaWYobG9jYXRpb24uaHJlZi5tYXRjaCgvXmh0dHBzPzpcL1wvd3d3LnpoaWh1LmNvbVwvc2VhcmNoLykpewogCiAgICAgICAgICAgICAgICAgICBsZXQgbnVtID0gMDsKIAogICAgICAgICAgICAgICAgICAgbGV0IHRpbWVyID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgY2FyZExpc3QgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuQ2FyZCcpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNhcmRMaXN0Lmxlbmd0aCA+IDUpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FyZExpc3QuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0eXBlID0gaXRlbS5xdWVyeVNlbGVjdG9yKCcuS2ZlQ29sbGVjdGlvbi1QY0NvbGxlZ2VDYXJkLXR5cGUnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGUgJiYgdHlwZS5pbm5lclRleHQuaW5kZXhPZign55uQ6YCJ5LiT5qCPJykgIT0gLTEpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uc3R5bGUgPSAnZGlzcGxheTpub25lJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXV0aG9yID0gaXRlbS5xdWVyeVNlbGVjdG9yKCdiJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXV0aG9yWWFueHVhbiA9IFsn5pWF5LqL5qGj5qGI5bGAJywgJ+ebkOmAieaOqOiNkCcsICfnm5DpgInnp5Hmma4nLCAn55uQ6YCJ5oiQ6ZW/6K6h5YiSJywgJ+efpeS5juebkOmAieS8muWRmCcsICfnn6XkuY7nm5DpgInliJvkvZzogIUnLCAn55uQ6YCJ5b+D55CGJywgJ+ebkOmAieWBpeW6t+W/heS/ruivvicsICfnm5DpgInlpYflppnnianor60nLCAn55uQ6YCJ55Sf5rS76aaGJywgJ+ebkOmAieiBjOWcuicsICfnm5DpgInmloflrabnlITpgIknLCAn55uQ6YCJ5L2c6ICF5bCP566h5a62JywgJ+ebkOmAieWNmueJqemmhicsICfnm5DpgInngrnph5EnLCAn55uQ6YCJ5rWL6K+E5a6kJywgJ+ebkOmAieenkeaKgOWJjeayvycsICfnm5DpgInkvJrlkZjnsr7lk4EnLCAn5Y6G5Y+y546v5ri46K6wJ107CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhdXRob3IgJiYgYXV0aG9yWWFueHVhbi5pbmRleE9mKGF1dGhvci5pbm5lclRleHQpICE9IC0xKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnN0eWxlID0gJ2Rpc3BsYXk6bm9uZSc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYobnVtPjMwKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bSsrOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICB9LDEwMCkKIAogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAvL+aOqOiNkOmhtQogICAgICAgICAgICAgICAgaWYobG9jYXRpb24uaHJlZiA9PSAnaHR0cHM6Ly93d3cuemhpaHUuY29tLycpewogCiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbnRlbnQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuQ29udGVudEl0ZW0nKTsKIAogICAgICAgICAgICAgICAgICAgIGNvbnRlbnQuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29udGVudCA9IGl0ZW0ucXVlcnlTZWxlY3RvcignLktmZUNvbGxlY3Rpb24tT3JkaW5hcnlMYWJlbC1jb250ZW50Jyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoY29udGVudCAmJiBjb250ZW50LmlubmVyVGV4dC5pbmRleE9mKCfnm5DpgIknKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uc3R5bGUgPSAnZGlzcGxheTpub25lJzsKIAogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAKICAgICAgICB9CiAKICAgICAgICBjbGFzcyBWaWRlb0Rvd25sb2FkQ2xhc3MgZXh0ZW5kcyBCYXNlQ2xhc3N7CiAKICAgICAgICAgICAgY29uc3RydWN0b3IoKXsKIAogICAgICAgICAgICAgICAgc3VwZXIoKTsKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIGR5VmlkZW9Eb3dubG9hZCgpewogCiAgICAgICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzOwogCiAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcignbG9hZCcsZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgIGFzeW5jIGZ1bmN0aW9uIGdldENvbnRyb2xzKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvRG9tID0gYXdhaXQgQmFzZUNsYXNzLmdldEVsZW1lbnQoJy54Zy12aWRlby1jb250YWluZXInKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZighdmlkZW9Eb20pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5rKh5pyJ5om+5YiwRE9NJyk7cmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZzTmF2ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmZ1eV93bWN0Om50aC1vZi10eXBlKDUpJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNvdXBvblVybC5pbmRleE9mKCd2c2RldGFpbCcpICE9IC0xKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfnu7zoibrmoI/nm67lhbPpl63kuIvovb0nKTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jcmVhdGVEeVZpZGVvRG93bmxvYWQoKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9QbGF5RG9tQWxsID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgndmlkZW8nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9JbmRleCA9IHZpZGVvUGxheURvbUFsbC5sZW5ndGg+MT92aWRlb1BsYXlEb21BbGwubGVuZ3RoLTI6dmlkZW9QbGF5RG9tQWxsLmxlbmd0aC0xOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2aWRlb1BsYXlEb20gPSB2aWRlb1BsYXlEb21BbGxbdmlkZW9JbmRleF07CiAKICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgdmlkZW9QbGF5RG9tID0gdmlkZW9QbGF5RG9tQWxsLmxlbmd0aD4xP3ZpZGVvUGxheURvbUFsbFt2aWRlb1BsYXlEb21BbGwubGVuZ3RoLTJdOnZpZGVvUGxheURvbUFsbFt2aWRlb1BsYXlEb21BbGwubGVuZ3RoLTFdOwogCiAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvUGxheURvbS5hZGRFdmVudExpc3RlbmVyKCdlbmRlZCcsZnVuY3Rpb24oKXsgLy/nu5PmnZ8KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIuaSreaUvue7k+adnyIpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXV0b1BsYXkgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcueGctc3dpdGNoLWNoZWNrZWQnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXV0b1BsYXkpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udHJvbHMoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSwgZmFsc2UpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN0b0Rvd25sb2FkJykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn5q2j5Zyo5LiL6L296K+356iN5L6vJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbmZvID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLlB6OHQybWVQJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmaWxlbmFtZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaW5mby5sZW5ndGg+MCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IGluZm9bdmlkZW9JbmRleF0uaW5uZXJUZXh0OwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgdGl0bGVBcnIgPSBpbmZvW3ZpZGVvSW5kZXgqMisxXS5pbm5lclRleHQuc3BsaXQoJyMnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2dCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy54aERvcGNRXycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gdnRbdmlkZW9JbmRleF0uaW5uZXJUZXh0LnNwbGl0KCcjJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlbmFtZSA9IHRpdGxlWzBdP3RpdGxlWzBdK2FjY291bnQ6dGl0bGVbMV0rYWNjb3VudCsnLm1wNCc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsZW5hbWUgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKSsnLm1wNCcKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MuTFJfZG93bmxvYWQodmlkZW9QbGF5RG9tLmNoaWxkcmVuWzBdLnNyYyxmaWxlbmFtZSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjdG9Db3B5JykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn5bey5aSN5Yi25Yiw5Ymq6LS05p2/Jyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldENsaXBib2FyZCh2aWRlb1BsYXlEb20uY2hpbGRyZW5bMF0uc3JjKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcudG9MaW5rJykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKHZpZGVvUGxheURvbS5jaGlsZHJlblswXS5zcmMpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIGdldENvbnRyb2xzKCk7CiAKICAgICAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigid2hlZWwiLGdldENvbnRyb2xzKTsKIAogICAgICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdrZXlkb3duJyxmdW5jdGlvbihlKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZihlLmNvZGU9PSdBcnJvd0Rvd24nIHx8IGUuY29kZT09J0Fycm93VXAnKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udHJvbHMoKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgIGFzeW5jIGZ1bmN0aW9uIGluc2VydGVkRG9tKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvRG9tID0gYXdhaXQgQmFzZUNsYXNzLmdldEVsZW1lbnQoJ3ZpZGVvJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXZpZGVvRG9tKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+ayoeacieaJvuWIsERPTScpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvRG9tLmFkZEV2ZW50TGlzdGVuZXIoJ0RPTU5vZGVJbnNlcnRlZCcsKGUpID0+IHsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udHJvbHMoKTsKIAogICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgaW5zZXJ0ZWREb20oKTsKIAogICAgICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZ2V0Q29udHJvbHMpOwogCiAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgIH0KIAogICAgICAgICAgICBjcmVhdGVEeVZpZGVvRG93bmxvYWQoKXsKIAogICAgICAgICAgICAgICAgbGV0IGNvbnRyb2xBbGwgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcueGctcmlnaHQtZ3JpZCcpOwogCiAgICAgICAgICAgICAgICBsZXQgY29udHJvbHMgPSBjb250cm9sQWxsLmxlbmd0aD4xP2NvbnRyb2xBbGxbY29udHJvbEFsbC5sZW5ndGgtMl06Y29udHJvbEFsbFtjb250cm9sQWxsLmxlbmd0aC0xXTsKIAogICAgICAgICAgICAgICAgbGV0IHZpZGVvRG93bmxvYWREb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtRG91eWluRG93bmxvYWQnKTsKIAogICAgICAgICAgICAgICAgaWYodmlkZW9Eb3dubG9hZERvbSl7CiAKICAgICAgICAgICAgICAgICAgICB2aWRlb0Rvd25sb2FkRG9tLnBhcmVudE5vZGUucGFyZW50Tm9kZS5yZW1vdmVDaGlsZCh2aWRlb0Rvd25sb2FkRG9tLnBhcmVudE5vZGUpOwogCiAgICAgICAgICAgICAgICAgICAgLy92aWRlb0Rvd25sb2FkRG9tLnBhcmVudE5vZGUucGFyZW50Tm9kZS5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKHZpZGVvRG93bmxvYWREb20ucGFyZW50Tm9kZS5wYXJlbnROb2RlKQogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICBsZXQgcGxheVNldGluZyA9IGNvbnRyb2xzLnF1ZXJ5U2VsZWN0b3IoJy54Z3BsYXllci1wbGF5YmFjay1zZXR0aW5nJyk7CiAKICAgICAgICAgICAgICAgIGxldCBkb3dubG9hZERvbSA9IHBsYXlTZXRpbmcuY2xvbmVOb2RlKHRydWUpOwogCiAgICAgICAgICAgICAgICBkb3dubG9hZERvbS5zdHlsZT0nbWFyZ2luLXJpZ2h0OjIwcHg7JzsKIAogICAgICAgICAgICAgICAgLy9sZXQgZG93bmxvYWRUZXh0ID0gZG93bmxvYWREb20ucXVlcnlTZWxlY3RvcignZGl2OmZpcnN0LWNoaWxkID4gc3BhbjpmaXJzdC1jaGlsZCcpOwogCiAgICAgICAgICAgICAgICBsZXQgZG93bmxvYWRUZXh0ID0gZG93bmxvYWREb20ucXVlcnlTZWxlY3RvcignZGl2OmZpcnN0LWNoaWxkJyk7CiAKICAgICAgICAgICAgICAgIGRvd25sb2FkVGV4dC5pbm5lclRleHQ9J+S4i+i9vSc7CiAKICAgICAgICAgICAgICAgIGRvd25sb2FkVGV4dC5zdHlsZSA9ICdmb250LXNpemU6MTJweDtmb250LXdlaWdodDo0MDA7JzsKIAogICAgICAgICAgICAgICAgZG93bmxvYWRUZXh0LnNldEF0dHJpYnV0ZSgnaWQnLCd6aG1Eb3V5aW5Eb3dubG9hZCcpOwogCiAgICAgICAgICAgICAgICBsZXQgZGV0YWlsID0gY29udHJvbHMucXVlcnlTZWxlY3RvcigneGctaWNvbjpudGgtb2YtdHlwZSgxKScpLmNoaWxkcmVuWzBdOwogCiAgICAgICAgICAgICAgICBsZXQgbGlua1VybCA9IGRldGFpbC5nZXRBdHRyaWJ1dGUoJ2hyZWYnKT9kZXRhaWwuZ2V0QXR0cmlidXRlKCdocmVmJyk6bG9jYXRpb24uaHJlZjsKIAogICAgICAgICAgICAgICAgaWYobGlua1VybC5pbmRleE9mKCd3d3cuZG91eWluLmNvbScpPT0tMSl7CiAKICAgICAgICAgICAgICAgICAgICBsaW5rVXJsPScvL3d3dy5kb3V5aW4uY29tJytsaW5rVXJsOwogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICBkb3dubG9hZFRleHQuc2V0QXR0cmlidXRlKCdkYXRhLXVybCcsbGlua1VybCk7CiAKICAgICAgICAgICAgICAgIGRvd25sb2FkVGV4dC5yZW1vdmVBdHRyaWJ1dGUoJ3RhcmdldCcpOwogCiAgICAgICAgICAgICAgICBkb3dubG9hZFRleHQuc2V0QXR0cmlidXRlKCdocmVmJywnamF2YXNjcmlwdDp2b2lkKDApOycpOwogCiAgICAgICAgICAgICAgICBkb3dubG9hZERvbS5vbm1vdXNlb3Zlcj1mdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgZG93bmxvYWREb20uY2xhc3NOYW1lPSd4Z3BsYXllci1wbGF5YmFjay1zZXR0aW5nIHNsaWRlLXNob3cnOwogCiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIGRvd25sb2FkRG9tLm9ubW91c2VvdXQ9ZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgIGRvd25sb2FkRG9tLmNsYXNzTmFtZT0neGdwbGF5ZXItcGxheWJhY2stc2V0dGluZyc7CiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIGxldCBkb3dubG9hZEh0bWwgPSAnJzsKIAogICAgICAgICAgICAgICAgZG93bmxvYWRPcHRpb24uZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgIGRvd25sb2FkSHRtbCArPSBgPGRpdiBjbGFzcz0ieGdwbGF5ZXItcGxheXJhdGlvLWl0ZW0gJHtpdGVtLmlkfSIgaWQ9IiR7aXRlbS5pZH0iPiR7aXRlbS5uYW1lfTwvZGl2PmA7CiAKICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgIGRvd25sb2FkRG9tLnF1ZXJ5U2VsZWN0b3IoJy54Z3BsYXllci1wbGF5cmF0aW8td3JhcCcpLmlubmVySFRNTCA9IGRvd25sb2FkSHRtbDsKIAogICAgICAgICAgICAgICAgZG93bmxvYWREb20ucXVlcnlTZWxlY3RvcignLnhncGxheWVyLXNsaWRlcicpLnN0eWxlPSd3aWR0aDo2MHB4IGltcG9ydGFudDsnOwogCiAgICAgICAgICAgICAgICBsZXQgYXV0b1BsYXkgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcueGdwbGF5ZXItYXV0b3BsYXktc2V0dGluZycpOwogCiAgICAgICAgICAgICAgICBhdXRvUGxheS5hZnRlcihkb3dubG9hZERvbSk7CiAKICAgICAgICAgICAgICAgIGxldCBkaXZEb20gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTsKIAogICAgICAgICAgICAgICAgZGl2RG9tLnN0eWxlPSJwb3NpdGlvbjogYWJzb2x1dGU7ei1pbmRleDotOTk5O2hlaWdodDo4MHB4O3dpZHRoOjQwcHg7bWFyZ2luLXRvcDotODBweDsiCiAKICAgICAgICAgICAgICAgIGRvd25sb2FkRG9tLmFwcGVuZENoaWxkKGRpdkRvbSk7CiAKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIGtzVmlkZW9Eb3dubG9hZCgpewogCiAgICAgICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzOwogCiAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcignbG9hZCcsZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgIGFzeW5jIGZ1bmN0aW9uIGdldENvbnRyb2xzKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvRG9tID0gYXdhaXQgQmFzZUNsYXNzLmdldEVsZW1lbnQoJy5wbGF5ZXItdmlkZW8nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZighdmlkZW9Eb20pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5rKh5pyJ5om+5YiwRE9NJyk7cmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICBpZih2aWRlb0RvbS5nZXRBdHRyaWJ1dGUoJ3NyYycpLm1hdGNoKC9eYmxvYi8pKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdibG9i6KeG6aKR5peg5rOV5LiL6L29Jyk7cmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3JlYXRlS3NWaWRlb0Rvd25sb2FkKHZpZGVvRG9tKTsKIAogICAgICAgICAgICAgICAgICAgICAgICB2aWRlb0RvbS5hZGRFdmVudExpc3RlbmVyKCdwbGF5aW5nJyxmdW5jdGlvbigpeyAvL+aSreaUvuS4rQogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIuaSreaUvuS4rSIpOwogICAgICAgICAgICAgICAgICAgICAgICB9KTsKIAogICAgICAgICAgICAgICAgICAgICAgICB2aWRlb0RvbS5hZGRFdmVudExpc3RlbmVyKCdlbmRlZCcsZnVuY3Rpb24oKXsgLy/nu5PmnZ8KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIuaSreaUvue7k+adnyIpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXV0b1BsYXkgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuYXV0by13YXJwcGVyJykuZ2V0QXR0cmlidXRlKCdhdXRvcGxheScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhdXRvUGxheSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29udHJvbHMoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICB9LCBmYWxzZSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3RvRG93bmxvYWQnKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCfmraPlnKjkuIvovb3or7fnqI3kvq8nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlUaW1lVG90YWwgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcudG90YWwnKS5pbm5lclRleHQ7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzZWNvbmQgPSBwbGF5VGltZVRvdGFsLm1hdGNoKC8oLispOiguKykvKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNlY29uZFRvdGFsID0gc2Vjb25kWzFdKjYwK3BhcnNlSW50KHNlY29uZFsyXSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhVXJsID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobUtzRG93bmxvYWQnKS5nZXRBdHRyaWJ1dGUoJ2RhdGEtdXJsJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnByb2ZpbGUtdXNlci1uYW1lLXRpdGxlJyk/ZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnByb2ZpbGUtdXNlci1uYW1lLXRpdGxlJykuaW5uZXJUZXh0OmRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5mZWVkLWF1dGhvcicpLmlubmVyVGV4dDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnZpZGVvLWluZm8tdGl0bGUnKT9kb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcudmlkZW8taW5mby10aXRsZScpLmlubmVyVGV4dDpuZXcgRGF0ZSgpLmdldFRpbWUoKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvRmlsZU5hbWUgPSAoYWNjb3VudCAmJiB0aXRsZSk/YWNjb3VudCsnLScrdGl0bGUrJy5tcDQnOm5ldyBEYXRlKCkuZ2V0VGltZSgpKycubXA0JzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLkxSX2Rvd25sb2FkKGRhdGFVcmwsdmlkZW9GaWxlTmFtZSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjdG9Db3B5JykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn5bey5aSN5Yi25Yiw5Ymq6LS05p2/Jyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldENsaXBib2FyZCh2aWRlb0RvbS5nZXRBdHRyaWJ1dGUoJ3NyYycpKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjdG9MaW5rJykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKHZpZGVvRG9tLmdldEF0dHJpYnV0ZSgnc3JjJykpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICBnZXRDb250cm9scygpOwogCiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKGUpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbnRyb2xzKCk7CiAKICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoIndoZWVsIixnZXRDb250cm9scyk7CiAKICAgICAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigna2V5ZG93bicsZnVuY3Rpb24oZSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoZS5jb2RlPT0nQXJyb3dEb3duJyB8fCBlLmNvZGU9PSdBcnJvd1VwJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbnRyb2xzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogCiAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgfSkKIAogCiAgICAgICAgICAgIH0KIAogICAgICAgICAgICBjcmVhdGVLc1ZpZGVvRG93bmxvYWQodmlkZW9Eb20pewogCiAgICAgICAgICAgICAgICBsZXQgbWF0Y2ggPSAvXmh0dHBzPzpcL1wvd3d3XC5rdWFpc2hvdVwuY29tXC8oLispLzsKIAogICAgICAgICAgICAgICAgbGV0IHJlc3AgPSBsb2NhdGlvbi5ocmVmLm1hdGNoKG1hdGNoKTsKIAogICAgICAgICAgICAgICAgaWYoIXJlc3AgfHwgKHJlc3BbMV0uaW5kZXhPZignc2hvcnQtdmlkZW8nKSA9PSAtMSAmJiByZXNwWzFdLmluZGV4T2YoJ3ZpZGVvJykgPT0tMSAmJiByZXNwWzFdLmluZGV4T2YoJ25ldy1yZWNvJykgPT0gLTEpKXsKIAogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCflvZPliY3kuI3mmK/op4bpopHmkq3mlL7pobUnKTtyZXR1cm47CiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIGlmKHJlc3BbMV0uaW5kZXhPZignc2hvcnQtdmlkZW8nKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgcGxheWVyQXJlYSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy52aWRlby1jb250YWluZXItcGxheWVyJyk7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgcGxheWVyQXJlYVdpZHRoID0gcGxheWVyQXJlYS5zdHlsZS53aWR0aC5tYXRjaCgvKC4rKXB4Lyk7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgcGxheWVyQmFyUHJvZ3Jlc3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcucGxheWVyLWJhci1wcm9ncmVzcycpOwogCiAgICAgICAgICAgICAgICAgICAgcGxheWVyQmFyUHJvZ3Jlc3Muc3R5bGUud2lkdGggPSBwbGF5ZXJBcmVhV2lkdGhbMV0tMzAwKydweCc7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgdGltZVRvdGFsID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnRvdGFsJyk7CiAKICAgICAgICAgICAgICAgICAgICB0aW1lVG90YWwuc3R5bGUucmlnaHQ9JzE2MHB4JzsKICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgbGV0IGNvbnRyb2xzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnJpZ2h0Jyk7CiAKICAgICAgICAgICAgICAgIGxldCB2aWRlb0Rvd25sb2FkRG9tID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobUtzRG93bmxvYWQnKTsKIAogICAgICAgICAgICAgICAgaWYodmlkZW9Eb3dubG9hZERvbSl7CiAKICAgICAgICAgICAgICAgICAgICB2aWRlb0Rvd25sb2FkRG9tLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQodmlkZW9Eb3dubG9hZERvbSk7CiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIGxldCBkZXRhaWxEb20gPSBjb250cm9scy5xdWVyeVNlbGVjdG9yKCdkaXY6bnRoLW9mLXR5cGUoMSknKTsKIAogICAgICAgICAgICAgICAgbGV0IHhnSWNvbiA9IGRldGFpbERvbS5jbG9uZU5vZGUodHJ1ZSk7CiAKICAgICAgICAgICAgICAgIGxldCBsaW5rVXJsID0gdmlkZW9Eb20uZ2V0QXR0cmlidXRlKCdzcmMnKTsKIAogICAgICAgICAgICAgICAgeGdJY29uLnF1ZXJ5U2VsZWN0b3IoJy5rd2FpLXBsYXllci12b2x1bWUtc291bmQnKS5pbm5lckhUTUw9IjxkaXYgc3R5bGU9J2N1cnNvcjpwb2ludGVyOyc+5LiL6L29PC9kaXY+IjsKIAogICAgICAgICAgICAgICAgbGV0IHNsaWRlciA9IHhnSWNvbi5xdWVyeVNlbGVjdG9yKCcucGwtc2xpZGVyJyk7CiAKICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZSA9ICd3aWR0aDo0OXB4O3BhZGRpbmc6MTBweCA1cHggMjBweDsnOwogCiAgICAgICAgICAgICAgICBsZXQgZG93bmxvYWRMaXN0ID0gJyc7CiAKICAgICAgICAgICAgICAgIGRvd25sb2FkT3B0aW9uLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICBkb3dubG9hZExpc3QgKz0gYDxkaXYgc3R5bGU9Im1hcmdpbi10b3A6MTBweDtjb2xvcjojRkZGO2N1cnNvcjpwb2ludGVyOyIgaWQ9IiR7aXRlbS5pZH0iPiR7aXRlbS5uYW1lfTwvZGl2PmA7CiAKICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgIHNsaWRlci5pbm5lckhUTUwgPSBkb3dubG9hZExpc3Q7CiAKICAgICAgICAgICAgICAgIHhnSWNvbi5zZXRBdHRyaWJ1dGUoJ2RhdGEtdXJsJyxsaW5rVXJsKTsKIAogICAgICAgICAgICAgICAgeGdJY29uLnNldEF0dHJpYnV0ZSgnaWQnLCd6aG1Lc0Rvd25sb2FkJyk7CiAKICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2coeGdJY29uKTsKIAogICAgICAgICAgICAgICAgLy94Z0ljb24uaW5uZXJIVE1MPSI8ZGl2IHN0eWxlPSdjdXJzb3I6cG9pbnRlcjsnPuS4i+i9vTwvZGl2PiI7CiAKICAgICAgICAgICAgICAgIGRldGFpbERvbS5iZWZvcmUoeGdJY29uKTsKIAogICAgICAgICAgICAgICAgLy/ph43mnoTmkq3mlL7mk43kvZzmjInpkq4KIAogICAgICAgICAgICAgICAgbGV0IHpobUtzQnV0dG9uID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobUtzQnV0dG9uJyk7CiAKICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2coemhtS3NCdXR0b24pOwogCiAgICAgICAgICAgICAgICBpZih6aG1Lc0J1dHRvbil7CiAKICAgICAgICAgICAgICAgICAgICAvL3pobUtzQnV0dG9uLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQoemhtS3NCdXR0b24pOwogCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICBsZXQgYnV0dG9uSWNvbiA9IGRldGFpbERvbS5jbG9uZU5vZGUodHJ1ZSk7CiAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKGJ1dHRvbkljb24pOwogICAgICAgICAgICAgICAgYnV0dG9uSWNvbi5zZXRBdHRyaWJ1dGUoJ2lkJywnemhtS3NCdXR0b24nKTsKIAogICAgICAgICAgICAgICAgbGV0IGJ1dHRvbkljb25JbWcgPSBidXR0b25JY29uLnF1ZXJ5U2VsZWN0b3IoJy51bm11dGVkLWljb24nKTsKIAogICAgICAgICAgICAgICAgaWYoYnV0dG9uSWNvbkltZyl7CiAgICAgICAgICAgICAgICAgICAgYnV0dG9uSWNvbkltZy5zdHlsZSA9ICdiYWNrZ3JvdW5kOiB1cmwoaHR0cHM6Ly9zMi0xMDYyMy5rd2ltZ3MuY29tL3VkYXRhL3BrZy9jbG91ZGNkbi9pbWcvcGxheWVyLXNldHRpbmcuYWQxZjVjZTguc3ZnKSBuby1yZXBlYXQnOwogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICBkZXRhaWxEb20uYWZ0ZXIoYnV0dG9uSWNvbik7CiAKICAgICAgICAgICAgICAgIGxldCBwbFNsaWRlciA9IGJ1dHRvbkljb24ucXVlcnlTZWxlY3RvcignLnBsLXNsaWRlcicpOwogCiAgICAgICAgICAgICAgICBwbFNsaWRlci5zdHlsZT0nd2lkdGg6YXV0bztwYWRkaW5nOjEwcHggMTBweCAyNXB4IDEwcHg7JzsKIAogICAgICAgICAgICAgICAgcGxTbGlkZXIuaW5uZXJIVE1MID0gIiI7CiAKICAgICAgICAgICAgICAgIGxldCBidXR0b25Gb3VyID0gY29udHJvbHMucXVlcnlTZWxlY3RvcignZGl2Om50aC1vZi10eXBlKDQpJyk7CiAKICAgICAgICAgICAgICAgIGJ1dHRvbkZvdXIuc3R5bGUubWFyZ2luPScwcHgnOwogCiAgICAgICAgICAgICAgICBsZXQgYXV0b1BsYXkgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcucGxheS1zZXR0aW5nLWNvbnRhaW5lcicpOwogCiAgICAgICAgICAgICAgICBpZihhdXRvUGxheSl7CiAgICAgICAgICAgICAgICAgICAgYXV0b1BsYXkuc3R5bGUubWFyZ2luPScwcHggNDBweCAwcHggMHB4JzsKICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgbGV0IGJ1dHRvbkZpdmUgPSBjb250cm9scy5xdWVyeVNlbGVjdG9yKCdkaXY6bnRoLW9mLXR5cGUoNSknKTsKIAogICAgICAgICAgICAgICAgaWYoYnV0dG9uRml2ZSl7CiAKICAgICAgICAgICAgICAgICAgICBidXR0b25GaXZlLnN0eWxlLm1hcmdpbj0nMTVweCAwcHgnOwogCiAgICAgICAgICAgICAgICAgICAgYnV0dG9uRml2ZS5vbm1vdXNlb3Zlcj1mdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvb2xUaXAgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcua3dhaS1wbGF5ZXItcm90YXRlLXRvb2x0aXAnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodG9vbFRpcCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sVGlwLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQodG9vbFRpcCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKIAogICAgICAgICAgICAgICAgICAgICAgICB9LDMwKQogCiAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgcGxTbGlkZXIuYXBwZW5kQ2hpbGQoYnV0dG9uRml2ZSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBsZXQgYnV0dG9uU2l4ID0gY29udHJvbHMucXVlcnlTZWxlY3RvcignZGl2Om50aC1vZi10eXBlKDYpJyk7CiAKICAgICAgICAgICAgICAgIGlmKGJ1dHRvblNpeCl7CiAKICAgICAgICAgICAgICAgICAgICBidXR0b25TaXguc3R5bGUubWFyZ2luPScxNXB4IDBweCc7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgdG9vbFRpcCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5rd2FpLXBsYXllci1mdWxsc2NyZWVuLXRvb2x0aXAnKTsKIAogICAgICAgICAgICAgICAgICAgIGJ1dHRvblNpeC5vbm1vdXNlb3Zlcj1mdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvb2xUaXAgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcua3dhaS1wbGF5ZXItZnVsbHNjcmVlbi10b29sdGlwJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHRvb2xUaXApewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbFRpcC5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKHRvb2xUaXApOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSwzMCkKIAogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIHBsU2xpZGVyLmFwcGVuZENoaWxkKGJ1dHRvblNpeCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBwbFNsaWRlci5hcHBlbmRDaGlsZChidXR0b25Gb3VyKTsKIAogICAgICAgICAgICB9CiAKICAgICAgICAgICAgeGlndWFWaWRlb0Rvd25sb2FkKCl7CiAKICAgICAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7CiAKICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdsb2FkJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgYXN5bmMgZnVuY3Rpb24gZ2V0Q29udHJvbHMoKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9Eb20gPSBhd2FpdCBCYXNlQ2xhc3MuZ2V0RWxlbWVudCgndmlkZW8nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZighdmlkZW9Eb20pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5rKh5pyJ5om+5YiwRE9NJyk7cmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jcmVhdGVYaWd1YVZpZGVvRG93bmxvYWQoKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBHTV94bWxodHRwUmVxdWVzdCh7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogImdldCIsCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2h0dHA6Ly80Ny45OS4xNTguMTE4L3ZpZGVvLWNyYWNrL3YyL3BhcnNlP2NvbnRlbnQ9JytlbmNvZGVVUklDb21wb25lbnQobG9jYXRpb24uaHJlZiksCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6ICcnLAogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7J0FjY2VwdCc6ICd0ZXh0L3BsYWluLCB0ZXh0L2h0bWwsYXBwbGljYXRpb24vanNvbid9LAogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmxvYWQ6IGZ1bmN0aW9uKHJlcyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihyZXMuc3RhdHVzPT0yMDApewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXNwID0gSlNPTi5wYXJzZShyZXMucmVzcG9uc2VUZXh0KQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2aWRlb1NyYyA9ICcnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHJlc3AuY29kZSA9PSAwKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlb1NyYyA9IHJlc3AuZGF0YS51cmw7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjdG9Eb3dubG9hZCcpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXZpZGVvU3JjKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ivpeinhumikeaXoOazleS4i+i9vScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmlkZW9UaXRsZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy52aWRlb1RpdGxlIGgxJykuaW5uZXJUZXh0OwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvQXV0aG9yID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmF1dGhvcl9fdXNlck5hbWUnKS50aXRsZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn5q2j5Zyo5LiL6L296K+356iN5L6vJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MuTFJfZG93bmxvYWQodmlkZW9TcmMsdmlkZW9UaXRsZSsnQCcrdmlkZW9BdXRob3IrJy5tcDQnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjdG9Db3B5JykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighdmlkZW9TcmMpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn6K+l6KeG6aKR5LiN6IO95aSN5Yi25Zyw5Z2AJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn5bey5aSN5Yi25Yiw5Ymq6LS05p2/Jyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRDbGlwYm9hcmQodmlkZW9TcmMpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3RvTGluaycpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXZpZGVvU3JjKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ivpeinhumikeS4jeiDveebtOaOpeaJk+W8gCcpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cub3Blbih2aWRlb1NyYyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbihlKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUucGF0aC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0uY2xhc3NOYW1lID09ICd4Z3BsYXllci1jb250cm9sLWl0ZW0gY29udHJvbF9wbGF5bmV4dCBjb21tb24tY29udHJvbC1pdGVtJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uLnJlbG9hZCgpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LDEwMDApCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JqTGluayA9IHt9OwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wYXRoLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXRlbS5ocmVmKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2JqTGluay5ocmVmID0gaXRlbS5ocmVmP2l0ZW0uaHJlZjonJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2JqTGluay50YXJnZXQgPSBpdGVtLnRhcmdldD9pdGVtLnRhcmdldDonJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYob2JqTGluay5ocmVmICYmIG9iakxpbmsudGFyZ2V0ICE9ICdfYmxhbmsnKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmID0gb2JqTGluay5ocmVmOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmVycm9yIDogZnVuY3Rpb24oZXJyKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnZXJyb3InKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGVycikKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcigndmlkZW8nKS5hZGRFdmVudExpc3RlbmVyKCdlbmRlZCcsZnVuY3Rpb24oKXsgLy/nu5PmnZ8KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIuaSreaUvue7k+adnyIpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSw1NTAwKTsKIAogICAgICAgICAgICAgICAgICAgICAgICB9LCBmYWxzZSk7CiAKICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICBnZXRDb250cm9scygpOwogICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIGNyZWF0ZVhpZ3VhVmlkZW9Eb3dubG9hZCgpewogCiAgICAgICAgICAgICAgICBsZXQgcmlnaHRHcmlkID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnhnLXJpZ2h0LWdyaWQnKTsKIAogICAgICAgICAgICAgICAgbGV0IHBsYXlDb250cm9sID0gcmlnaHRHcmlkLnF1ZXJ5U2VsZWN0b3IoJ2RpdjpudGgtb2YtdHlwZSgyKScpOwogCiAgICAgICAgICAgICAgICBsZXQgY29udHJvbCA9IHBsYXlDb250cm9sLmNsb25lTm9kZSh0cnVlKTsKIAogICAgICAgICAgICAgICAgbGV0IGVudHJ5PSBjb250cm9sLnF1ZXJ5U2VsZWN0b3IoJy54Z3BsYXllci1jb250cm9sLWl0ZW1fX2VudHJ5Jyk7CiAKICAgICAgICAgICAgICAgIGVudHJ5LmlubmVySFRNTCA9ICc8ZGl2IGNsYXNzPSJ4Z3BjUGxheWVyX3RleHRFbnRyeSI+PHNwYW4+5LiL6L29PC9zcGFuPjwvZGl2Pic7CiAKICAgICAgICAgICAgICAgIGxldCBwb3BvdmVyID0gY29udHJvbC5xdWVyeVNlbGVjdG9yKCcueGdwbGF5ZXItY29udHJvbC1pdGVtX19wb3BvdmVyJyk7CiAKICAgICAgICAgICAgICAgIGxldCBkb3dubG9hZExpc3QgPSAnPHVsPic7CiAKICAgICAgICAgICAgICAgIGRvd25sb2FkT3B0aW9uLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICBkb3dubG9hZExpc3QgKz0gYDxsaSB0YWJpbmRleD0iMCIgcm9sZT0ibWVudWl0ZW1yYWRpbyIgYXJpYS1jaGVja2VkPSJmYWxzZSIgaWQ9IiR7aXRlbS5pZH0iPiR7aXRlbS5uYW1lfTwvbGk+YDsKIAogICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgZG93bmxvYWRMaXN0ICs9ICc8L3VsPic7CiAKICAgICAgICAgICAgICAgIHBvcG92ZXIuaW5uZXJIVE1MID0gZG93bmxvYWRMaXN0OwogCiAgICAgICAgICAgICAgICBwbGF5Q29udHJvbC5iZWZvcmUoY29udHJvbCk7CiAKICAgICAgICAgICAgICAgIGxldCBkaXZEb20gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTsKIAogICAgICAgICAgICAgICAgZGl2RG9tLnN0eWxlPSJ3aWR0aDogODBweDsgaGVpZ2h0OiAxNDBweDtwb3NpdGlvbjphYnNvbHV0ZTtib3R0b206NDBweDtsZWZ0OjIwcHg7ei1pbmRleDotMSI7CiAKICAgICAgICAgICAgICAgIGNvbnRyb2wuYXBwZW5kQ2hpbGQoZGl2RG9tKTsKIAogICAgICAgICAgICAgICAgY29udHJvbC5vbm1vdXNlb3Zlcj1mdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgcG9wb3Zlci5zdHlsZS5kaXNwbGF5PSdibG9jayc7CiAKICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgY29udHJvbC5vbm1vdXNlb3V0PWZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICBwb3BvdmVyLnN0eWxlLmRpc3BsYXk9J25vbmUnOwogCiAgICAgICAgICAgICAgICB9CiAKIAogICAgICAgICAgICB9CiAKICAgICAgICAgICAgYmlsaVZpZGVvRG93bmxvYWQoKXsKIAogICAgICAgICAgICAgICAgdmFyIF90aGlzID0gdGhpczsKIAogICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ2xvYWQnLGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICBhc3luYyBmdW5jdGlvbiBnZXRDb250cm9scygpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYuaW5kZXhPZignYmFuZ3VtaScpICE9IC0xKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJpZ2h0Q29udHJvbCA9IGF3YWl0IEJhc2VDbGFzcy5nZXRFbGVtZW50KCcuc3F1aXJ0bGUtY29udHJvbGxlci13cmFwLXJpZ2h0Jyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFyaWdodENvbnRyb2wpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+ayoeacieaJvuWIsERPTScpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3JlYXRlQmlsaVZpZGVvRG93bmxvYWQoKTsKIAogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG49MDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpbWVyID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuYmlsaWJpbGktcGxheWVyLXZpZGVvLWJ0bi1xdWFsaXR5Jyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZG9tT3RoZXIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuYnB4LXBsYXllci1jdHJsLXF1YWxpdHknKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRvbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3JlYXRlQmlsaVZpZGVvRG93bmxvYWQoKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZihkb21PdGhlcil7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3JlYXRlQmlsaVZpZGVvRG93bmxvYWRPdGhlcigpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihuKys+MzApY2xlYXJJbnRlcnZhbCh0aW1lcik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LDEwMCkKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAvL190aGlzLmNyZWF0ZUJpbGlWaWRlb0Rvd25sb2FkKCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpbWVyWmhtSWNvbiA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2aWRlb0RvbSA9IFt7bmFtZTondmlkZW8nLHR5cGU6J2RvbSd9LHtuYW1lOidid3BfdmlkZW8nLHR5cGU6J2RvbSd9LHtuYW1lOicuYmlsaWJpbGktcGxheWVyLXZpZGVvJyx0eXBlOidjbGFzcyd9XTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpID0gMDtpPHZpZGVvRG9tLmxlbmd0aDtpKyspewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvID0gdmlkZW9Eb21baV0udHlwZSA9PSAnZG9tJz9kb2N1bWVudC5xdWVyeVNlbGVjdG9yKHZpZGVvRG9tW2ldLm5hbWUpOmRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IodmlkZW9Eb21baV0ubmFtZSkuZmlyc3RDaGlsZDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHZpZGVvKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyWmhtSWNvbik7IC8v5Y+W5raI5a6a5pe25ZmoCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8uYWRkRXZlbnRMaXN0ZW5lcigncGxheScsZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIuaSreaUvuW8gOWniyIpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jcmVhdGVCaWxpVmlkZW9Eb3dubG9hZCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlby5hZGRFdmVudExpc3RlbmVyKCdlbmRlZCcsZnVuY3Rpb24oKXsgLy/nu5PmnZ8KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYobG9jYXRpb24uaHJlZi5pbmRleE9mKCdiYW5ndW1pJykgIT0gLTEpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJpbGlEb3dubG9hZCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNiaWxpRG93bmxvYWQnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGJpbGlEb3dubG9hZCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaWxpRG93bmxvYWQucGFyZW50Tm9kZS5yZW1vdmVDaGlsZChiaWxpRG93bmxvYWQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICBnZXRDb250cm9scygpOwogCiAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgIH0KIAogICAgICAgICAgICBjcmVhdGVCaWxpVmlkZW9Eb3dubG9hZCgpewogCiAgICAgICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzOwogCiAgICAgICAgICAgICAgICBhc3luYyBmdW5jdGlvbiBnZXRDb250cm9scygpewogCiAgICAgICAgICAgICAgICAgICAgbGV0IGRvd25sb2FkSWNvbiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNiaWxpRG93bmxvYWQnKTsKIAogICAgICAgICAgICAgICAgICAgIGlmKGRvd25sb2FkSWNvbil7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfkuIvovb3mjInpkq7lt7LlrZjlnKgnKTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgaWYobG9jYXRpb24uaHJlZi5pbmRleE9mKCdiYW5ndW1pJykgIT0gLTEpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBxdWFsaXR5ID0gYXdhaXQgQmFzZUNsYXNzLmdldEVsZW1lbnQoJy5zcXVpcnRsZS1xdWFsaXR5LXdyYXAnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZighcXVhbGl0eSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfmsqHmnInmib7liLBET00nKTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29udHJvbCA9IHF1YWxpdHkuY2xvbmVOb2RlKHRydWUpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wucXVlcnlTZWxlY3RvcignLnNxdWlydGxlLXZpZGVvLXF1YWxpdHktdGV4dCcpLmlubmVyVGV4dD0n5LiL6L29JzsKIAogICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sLnNldEF0dHJpYnV0ZSgnaWQnLCdiaWxpRG93bmxvYWQnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5LmJlZm9yZShjb250cm9sKTsKIAogICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKGxvY2F0aW9uLmhyZWYuaW5kZXhPZigndmlkZW8nKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGF1dG9JY29uRG9tID0gYXdhaXQgQmFzZUNsYXNzLmdldEVsZW1lbnQoJy5iaWxpYmlsaS1wbGF5ZXItdmlkZW8tYnRuLXF1YWxpdHknKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZighYXV0b0ljb25Eb20pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5rKh5pyJ5om+5YiwRE9NJyk7cmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29udHJvbCA9IGF1dG9JY29uRG9tLmNsb25lTm9kZSh0cnVlKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sLnN0eWxlPSdtYXJnaW4tcmlnaHQ6MjBweDsnOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wucXVlcnlTZWxlY3RvcignLmJ1aS1zZWxlY3QtcmVzdWx0JykuaW5uZXJUZXh0PSfkuIvovb0nOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wucXVlcnlTZWxlY3RvcignLmJ1aS1zZWxlY3QtcmVzdWx0Jykuc2V0QXR0cmlidXRlKCdpZCcsJ2JpbGlEb3dubG9hZCcpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGF1dG9JY29uRG9tLmJlZm9yZShjb250cm9sKTsKIAogICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCflvZPliY3pobXpnaLkuI3mmK/op4bpopHmiJbnlarliacnKTtyZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjYmlsaURvd25sb2FkJykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJ2aWQgPSAnJyxhdmlkPScnOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGxvY2F0aW9uLmhyZWYuaW5kZXhPZignYmFuZ3VtaScpICE9IC0xKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnZpZCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5hdi1saW5rJykuaW5uZXJUZXh0OwogCiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKGxvY2F0aW9uLmhyZWYuaW5kZXhPZigndmlkZW8nKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSBsb2NhdGlvbi5ocmVmLm1hdGNoKC9odHRwczpcL1wvd3d3LmJpbGliaWxpLmNvbVwvdmlkZW9cLyguKylcPy8pOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwYXJhbXNbMV0uaW5kZXhPZignYXYnKSAhPS0xKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2aWQgPSBwYXJhbXNbMV0ucmVwbGFjZSgnYXYnLCcnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidmlkID0gcGFyYW1zWzFdLnN1YnN0cmluZyhwYXJhbXNbMV0ubGVuZ3RoLTEpPT0nLyc/cGFyYW1zWzFdLnN1YnN0cmluZygwLHBhcmFtc1sxXS5sZW5ndGgtMSk6cGFyYW1zWzFdOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+W9k+WJjemhtemdouaXoOazleS4i+i9vScpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFidmlkICYmICFhdmlkKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+acquiOt+WPlmJ2aWTmiJZhdmlkJyk7cmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICJodHRwczovL2FwaS5iaWxpYmlsaS5jb20veC93ZWItaW50ZXJmYWNlL3ZpZXc/YnZpZD0iK2J2aWQrIiZhaWQ9IithdmlkOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmkgPSBfdGhpcy5yZXF1ZXN0KCdnZXQnLHVybCkudGhlbigocmVzdWx0KT0+ewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzcCA9IEpTT04ucGFyc2UocmVzdWx0KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocmVzcC5jb2RlIDwgMCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ivpeinhumikeaXoOazleS4i+i9vScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+inhumikeS/oeaBr+aOpeWPo+i/lOWbnuaVsOaNrumUmeivrycpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/pgInpm4ZjaWQKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhZ2VJZCA9IF90aGlzLmdldFF1ZXJ5U3RyaW5nKCdwJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjaWQgPSAnJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFnZUlkKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpZCA9IHJlc3AuZGF0YS5wYWdlc1twYWdlSWQtMV0uY2lkOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpZCA9IHJlc3AuZGF0YS5jaWQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGNpZCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaW5rID0gJ2h0dHBzOi8vYXBpLmJpbGliaWxpLmNvbS94L3BsYXllci9wbGF5dXJsP2F2aWQ9JytyZXNwLmRhdGEuYWlkKycmY2lkPScrY2lkKycmcW49MTEyJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlcyA9IF90aGlzLnJlcXVlc3QoJ2dldCcsbGluaykudGhlbigocmVzdWx0KT0+ewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGEgPSBKU09OLnBhcnNlKHJlc3VsdCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihkYXRhLmNvZGUgPCAwKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCfor6Xop4bpopHml6Dms5XkuIvovb0nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+inhumikeWcsOWdgOaOpeWPo+i/lOWbnuaVsOaNrumUmeivrycpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZG93bmxvYWRVcmwgPSBkYXRhLmRhdGEuZHVybFswXS51cmw7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0dNX2Rvd25sb2FkKGRvd25sb2FkVXJsKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKGRvd25sb2FkVXJsKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICBnZXRDb250cm9scygpOwogCiAgICAgICAgICAgIH0KIAogICAgICAgICAgICBjcmVhdGVCaWxpVmlkZW9Eb3dubG9hZE90aGVyKCl7CiAKICAgICAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7CiAKICAgICAgICAgICAgICAgIGFzeW5jIGZ1bmN0aW9uIGdldENvbnRyb2xzKCl7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgZG93bmxvYWRJY29uID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2JpbGlEb3dubG9hZCcpOwogCiAgICAgICAgICAgICAgICAgICAgaWYoZG93bmxvYWRJY29uKXsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+S4i+i9veaMiemSruW3suWtmOWcqCcpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmLmluZGV4T2YoJ2Jhbmd1bWknKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHF1YWxpdHkgPSBhd2FpdCBCYXNlQ2xhc3MuZ2V0RWxlbWVudCgnLnNxdWlydGxlLXF1YWxpdHktd3JhcCcpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFxdWFsaXR5KXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+ayoeacieaJvuWIsERPTScpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250cm9sID0gcXVhbGl0eS5jbG9uZU5vZGUodHJ1ZSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coY29udHJvbC5xdWVyeVNlbGVjdG9yKCcuc3F1aXJ0bGUtdmlkZW8tcXVhbGl0eS10ZXh0JykpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wucXVlcnlTZWxlY3RvcignLnNxdWlydGxlLXZpZGVvLXF1YWxpdHktdGV4dCcpLmlubmVyVGV4dD0n5LiL6L29JzsKIAogICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sLnNldEF0dHJpYnV0ZSgnaWQnLCdiaWxpRG93bmxvYWQnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5LmJlZm9yZShjb250cm9sKTsKIAogICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKGxvY2F0aW9uLmhyZWYuaW5kZXhPZigndmlkZW8nKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGF1dG9JY29uRG9tID0gYXdhaXQgQmFzZUNsYXNzLmdldEVsZW1lbnQoJy5icHgtcGxheWVyLWN0cmwtcXVhbGl0eScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFhdXRvSWNvbkRvbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfmsqHmnInmib7liLBET00nKTtyZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250cm9sID0gYXV0b0ljb25Eb20uY2xvbmVOb2RlKHRydWUpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wuc3R5bGU9J21hcmdpbi1yaWdodDoyMHB4Oyc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5xdWVyeVNlbGVjdG9yKCcuYnB4LXBsYXllci1jdHJsLXF1YWxpdHktcmVzdWx0JykuaW5uZXJUZXh0PSfkuIvovb0nOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wucXVlcnlTZWxlY3RvcignLmJweC1wbGF5ZXItY3RybC1xdWFsaXR5LW1lbnUnKS5zZXRBdHRyaWJ1dGUoJ2lkJywnYmlsaURvd25sb2FkJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1lbnVJdGVtcyA9IGNvbnRyb2wucXVlcnlTZWxlY3RvckFsbCgnLmJweC1wbGF5ZXItY3RybC1xdWFsaXR5LW1lbnUtaXRlbScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIG1lbnVJdGVtcy5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YVZhbHVlID0gaXRlbS5nZXRBdHRyaWJ1dGUoJ2RhdGEtVmFsdWUnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZGF0YVZhbHVlICE9IDE2ICYmIGRhdGFWYWx1ZSAhPSA4MCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQoaXRlbSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgYXV0b0ljb25Eb20uYmVmb3JlKGNvbnRyb2wpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2wub25tb3VzZW92ZXI9KCk9PnsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5xdWVyeVNlbGVjdG9yKCcuYnB4LXBsYXllci1jdHJsLXF1YWxpdHktbWVudScpLnN0eWxlLmRpc3BsYXk9J2Jsb2NrJzsKIAogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5vbm1vdXNlb3V0PSgpPT57CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5xdWVyeVNlbGVjdG9yKCcuYnB4LXBsYXllci1jdHJsLXF1YWxpdHktbWVudScpLnN0eWxlLmRpc3BsYXk9J25vbmUnOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCflvZPliY3pobXpnaLkuI3mmK/op4bpopHmiJbnlarliacnKTtyZXR1cm47CiAKICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjYmlsaURvd25sb2FkJykuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKGUpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBiaWxpRGF0YVZhbHVlID0gZS50YXJnZXQuZ2V0QXR0cmlidXRlKCdkYXRhLVZhbHVlJyk/ZS50YXJnZXQuZ2V0QXR0cmlidXRlKCdkYXRhLVZhbHVlJyk6Jyc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWJpbGlEYXRhVmFsdWUpcmV0dXJuOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBidmlkID0gJycsYXZpZD0nJzsKIAogICAgICAgICAgICAgICAgICAgICAgICBpZihsb2NhdGlvbi5ocmVmLmluZGV4T2YoJ2Jhbmd1bWknKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ2aWQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuYXYtbGluaycpLmlubmVyVGV4dDsKIAogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZihsb2NhdGlvbi5ocmVmLmluZGV4T2YoJ3ZpZGVvJykgIT0gLTEpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbm93VXJsID0gbG9jYXRpb24uaHJlZi5zcGxpdCgnPycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFyYW1zID0gbm93VXJsWzBdLm1hdGNoKC9odHRwczpcL1wvd3d3LmJpbGliaWxpLmNvbVwvdmlkZW9cLyguKykvKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFyYW1zWzFdLmluZGV4T2YoJ2F2JykgIT0tMSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdmlkID0gcGFyYW1zWzFdLnJlcGxhY2UoJ2F2JywnJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnZpZCA9IHBhcmFtc1sxXS5zdWJzdHJpbmcocGFyYW1zWzFdLmxlbmd0aC0xKT09Jy8nP3BhcmFtc1sxXS5zdWJzdHJpbmcoMCxwYXJhbXNbMV0ubGVuZ3RoLTEpOnBhcmFtc1sxXTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCflvZPliY3pobXpnaLml6Dms5XkuIvovb0nKTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICBpZighYnZpZCAmJiAhYXZpZCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfmnKrojrflj5Zidmlk5oiWYXZpZCcpO3JldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSAiaHR0cHM6Ly9hcGkuYmlsaWJpbGkuY29tL3gvd2ViLWludGVyZmFjZS92aWV3P2J2aWQ9IitidmlkKyImYWlkPSIrYXZpZDsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJpID0gX3RoaXMucmVxdWVzdCgnZ2V0Jyx1cmwpLnRoZW4oKHJlc3VsdCk9PnsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3AgPSBKU09OLnBhcnNlKHJlc3VsdCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHJlc3AuY29kZSA8IDApewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCfor6Xop4bpopHml6Dms5XkuIvovb0nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfop4bpopHkv6Hmga/mjqXlj6Pov5Tlm57mlbDmja7plJnor68nKTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8v6YCJ6ZuGY2lkCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYWdlSWQgPSBfdGhpcy5nZXRRdWVyeVN0cmluZygncCcpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY2lkID0gJyc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBhZ2VJZCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaWQgPSByZXNwLmRhdGEucGFnZXNbcGFnZUlkLTFdLmNpZDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaWQgPSByZXNwLmRhdGEuY2lkOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbGluayA9ICdodHRwczovL2FwaS5iaWxpYmlsaS5jb20veC9wbGF5ZXIvcGxheXVybD9hdmlkPScrcmVzcC5kYXRhLmFpZCsnJmNpZD0nK2NpZCsnJnFuPScrYmlsaURhdGFWYWx1ZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlcyA9IF90aGlzLnJlcXVlc3QoJ2dldCcsbGluaywnJyx0cnVlKS50aGVuKChyZXN1bHQpPT57CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IEpTT04ucGFyc2UocmVzdWx0KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRhdGEuY29kZSA8IDApewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ivpeinhumikeaXoOazleS4i+i9vScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn6KeG6aKR5Zyw5Z2A5o6l5Y+j6L+U5Zue5pWw5o2u6ZSZ6K+vJyk7cmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkb3dubG9hZFVybCA9IGRhdGEuZGF0YS5kdXJsWzBdLnVybDsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vR01fZG93bmxvYWQoZG93bmxvYWRVcmwpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93Lm9wZW4oZG93bmxvYWRVcmwpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIGdldENvbnRyb2xzKCk7CiAKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIHlvdXR1YmVWaWRlb0Rvd25sb2FkKCl7CiAKICAgICAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7CiAKICAgICAgICAgICAgICAgIGxldCB0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gbG9jYXRpb24uaHJlZi5tYXRjaCgvXmh0dHBzPzpcL1wvd3d3XC55b3V0dWJlXC5jb21cLyh3YXRjaFw/dj0uK3xzaG9ydHNcLy4rKS8pOwogCiAgICAgICAgICAgICAgICAgICAgaWYodXJsKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgeW91dHViZUljb24gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtbG9nbycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKHlvdXR1YmVJY29uKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlvdXR1YmVJY29uLnN0eWxlLm9wYWNpdHk9MTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKIAogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuemhtTG9nbygpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwbGF5V3JhcEh0bWwgPSAiPGRpdiBjbGFzcz0nemhtX3BsYXlfdmlkZW9fbGluZSc+IjsKIAogICAgICAgICAgICAgICAgICAgICAgICBwbGF5V3JhcEh0bWwgKz0iPHVsIGNsYXNzPSd6aG1fcGxheV92aWRlX2xpbmVfdWwnPiI7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlMaW5lID0gWwogICAgICAgICAgICAgICAgICAgICAgICAgICAge25hbWU6J+S4i+i9vee6v+i3rzEnLHVybDonaHR0cHM6Ly96aC5zYXZlZnJvbS5uZXQvMTc2LyN1cmw9J30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bmFtZTon5LiL6L2957q/6LevMicsdXJsOidodHRwczovL215ZG93bmRvd24uY29tL3kyIyd9LAogICAgICAgICAgICAgICAgICAgICAgICAgICAge25hbWU6J+S4i+i9vee6v+i3rzMnLHVybDonaHR0cHM6Ly93d3cueXRkb3duZmsuY29tL3NlYXJjaD91cmw9J30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bmFtZTon5LiL6L2957q/6LevNCcsdXJsOidodHRwczovL3lvdXQuY29tL3ZpZGVvLz91cmw9J30KICAgICAgICAgICAgICAgICAgICAgICAgXTsKIAogICAgICAgICAgICAgICAgICAgICAgICBwbGF5TGluZS5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF5V3JhcEh0bWwgKz1gPGxpIGNsYXNzPSdwbGF5TGluZVRkIHpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGknIHVybD0nJHtpdGVtLnVybH0nID4ke2l0ZW0ubmFtZX08L2xpPmA7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICBwbGF5V3JhcEh0bWwgKz0iPC91bD48L2Rpdj4iOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6aG1QbGF5ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3pobWxvZ28nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheUxpbmVEb20gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBwbGF5TGluZURvbS5jbGFzc05hbWUgPSAncGxheUxpbmVEaXYgemhtX3BsYXlfdmlkZW9fd3JhcCc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgcGxheUxpbmVEb20uc3R5bGUuZGlzcGxheSA9ICdub25lJzsKIAogICAgICAgICAgICAgICAgICAgICAgICBwbGF5TGluZURvbS5pbm5lckhUTUwgPSBwbGF5V3JhcEh0bWw7CiAKICAgICAgICAgICAgICAgICAgICAgICAgemhtUGxheS5hcHBlbmRDaGlsZChwbGF5TGluZURvbSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlMaW5lVGQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcucGxheUxpbmVUZCcpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlMaW5lVGQuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKGl0ZW0uZ2V0QXR0cmlidXRlKCd1cmwnKStsb2NhdGlvbi5ocmVmKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5wbGF5QnV0dG9uJykub25tb3VzZW92ZXI9KCk9PnsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiLnBsYXlMaW5lRGl2Iikuc3R5bGUuZGlzcGxheT0nYmxvY2snOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcucGxheUJ1dHRvbicpLm9ubW91c2VvdXQ9KCk9PnsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiLnBsYXlMaW5lRGl2Iikuc3R5bGUuZGlzcGxheT0nbm9uZSc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnpobUxvZ29EcmFnKCd5b3V0dWJlJywnJyk7CiAKICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgemhtSWNvbiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aG1JY29uJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoemhtSWNvbil7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHpobUljb24ucGFyZW50Tm9kZS5yZW1vdmVDaGlsZCh6aG1JY29uKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHpobWxvZ28gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtbG9nbycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKHpobWxvZ28pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3pobWxvZ28ucGFyZW50Tm9kZS5yZW1vdmVDaGlsZCh6aG1sb2dvKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgemhtbG9nby5zdHlsZS5vcGFjaXR5PTA7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgfSw1MDApCiAKICAgICAgICAgICAgfQogICAgICAgIH0KIAogICAgICAgIHZhciBhbGxXZWIgPSBbLi4uZ2V0Q291cG9uLC4uLmp4VmlkZW8sLi4uanhNdXNpYywuLi56aE5pY2UsLi4udGFvYmFvLC4uLnZpZGVvRG93bmxvYWQsLi4uYmFpZHVdOwogCiAgICAgICAgdmFyIG5vd1dlYj1bXTsKIAogICAgICAgIGFsbFdlYi5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgIGlmKGl0ZW0uaXNPcGVuID09IDApIHJldHVybiB0cnVlOwogCiAgICAgICAgICAgIGl0ZW0ud2ViLmZvckVhY2goZnVuY3Rpb24odmFsKXsKIAogICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IGxvY2F0aW9uLmhyZWYubWF0Y2godmFsLm1hdGNoKTsKIAogICAgICAgICAgICAgICAgaWYocmVzdWx0KXsKIAogICAgICAgICAgICAgICAgICAgIG5vd1dlYi5wdXNoKHZhbCk7CiAKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSkKIAogICAgICAgIH0pCiAKICAgICAgICBpZihub3dXZWIubGVuZ3RoPT0wKXsKIAogICAgICAgICAgICBsZXQgYmFzZUNsYXNzID0gbmV3IEJhc2VDbGFzcygpOwogCiAgICAgICAgICAgIGNvbnNvbGUubG9nKCfmsqHmnInljLnphY3or6XnvZHnq5nmiJbor6XmqKHlnZflt7LlhbPpl60nKTtyZXR1cm47CiAgICAgICAgfQogCiAgICAgICAgbm93V2ViLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgc3dpdGNoKGl0ZW0uZnVuY05hbWUpewogICAgICAgICAgICAgICAgY2FzZSAnY291cG9uJzoKIAogICAgICAgICAgICAgICAgICAgIGNvdXBvbkZ1bmMoaXRlbSk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICdwbGF5VmlkZW8nOgogICAgICAgICAgICAgICAgICAgIHBsYXlWaWRlb0Z1bmMoKTsKICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgJ3BsYXlNdXNpYyc6CiAgICAgICAgICAgICAgICAgICAgcGxheU11c2ljRnVuYyhpdGVtKTsKICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgJ3poTmljZSc6CiAgICAgICAgICAgICAgICAgICAgemhOaWNlRnVuYygpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAnYmFpZHUnOgogICAgICAgICAgICAgICAgICAgIHZhciBiYXNlQ2xhc3MgPSBuZXcgQmFzZUNsYXNzOwogICAgICAgICAgICAgICAgICAgIGJhaWR1RnVuYygpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAndmlkZW9Eb3dubG9hZCc6CiAKICAgICAgICAgICAgICAgICAgICB2YXIgdmlkZW9Eb3dubG9hZENsYXNzID0gbmV3IFZpZGVvRG93bmxvYWRDbGFzcygpOwogCiAgICAgICAgICAgICAgICAgICAgdmFyIHtmdW5jTmFtZSxtYXRjaDpub3dNYXRjaCxub2RlOm5vd05vZGUsbmFtZTpub3dOYW1lfSA9IGl0ZW07CiAKICAgICAgICAgICAgICAgICAgICBpZihpdGVtLmlzV2ViT3BlbiA9PSAwKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhpdGVtLm5hbWUrJ+W3suWFs+mXrScpO3JldHVybjsKIAogICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvRG93bmxvYWRDbGFzc1tub3dOYW1lXSgpOwogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAgICAgICAgICBjYXNlICd0YW9iYW9TZWFyY2gnOgogICAgICAgICAgICAgICAgICAgIHRhb2Jhb1NlYXJjaEZ1bmMoaXRlbSkKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgICAgfQogCiAgICAgICAgfSkKIAogICAgICAgIGZ1bmN0aW9uIGNvdXBvbkZ1bmMoaXRlbSl7CiAKICAgICAgICAgICAgdmFyIGNvdXBvbkNsYXNzID0gbmV3IENvdXBvbkNsYXNzKCk7CiAKICAgICAgICAgICAgdmFyIHtmdW5jTmFtZSxtYXRjaDpub3dNYXRjaCxub2RlOm5vd05vZGUsbmFtZTpub3dOYW1lfSA9IGl0ZW07CiAKICAgICAgICAgICAgdmFyIGNvdXBvblN0eWxlID1gCiAgICAgICAgICAgICAgICAgICAgaHRtbHsKICAgICAgICAgICAgICAgICAgICAtLXJpZ2h0OjEwMCU7CiAgICAgICAgICAgICAgICAgICAgLS1sZWZ0OjEwMCU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX2NvdXBvbnsKICAgICAgICAgICAgICAgICAgICB3aWR0aDpmaXQtY29udGVudDsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAgIGZsZXgtZGlyZWN0aW9uOnJvdzsKICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47CiAgICAgICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6ZmxleC1zdGFydDsKICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MTRweDsKICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgICAgICAgICAgICAgICAgICAgbWFyZ2luLWJvdHRvbToxNXB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9sZWZ0ewogICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICAgICAgZmxleC1kaXJlY3Rpb246cm93OwogICAgICAgICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDpmbGV4LXN0YXJ0OwogICAgICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOjE0cHg7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZDogcmFkaWFsLWdyYWRpZW50KGNpcmNsZSBhdCByaWdodCB0b3AsIHRyYW5zcGFyZW50IDhweCwjZmZmIDApIHRvcCBsZWZ0IC92YXIoLS1yaWdodCkgNTElIG5vLXJlcGVhdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYWRpYWwtZ3JhZGllbnQoY2lyY2xlIGF0IHJpZ2h0IGJvdHRvbSwgdHJhbnNwYXJlbnQgOHB4LCAjZmZmIDApIGJvdHRvbSBsZWZ0IC92YXIoLS1yaWdodCkgNTElIG5vLXJlcGVhdDsKICAgICAgICAgICAgICAgICAgICBmaWx0ZXI6IGRyb3Atc2hhZG93KDJweCAycHggM3B4ICM4ODgpOwogICAgICAgICAgICAgICAgICAgIGhlaWdodDo4NHB4OwogICAgICAgICAgICAgICAgICAgIHdpZHRoOjEwMCU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX2ltZ19pY29uewogICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6NHB4IDBweCAwcHggNXB4OwogICAgICAgICAgICAgICAgICAgIG1hcmdpbi1yaWdodDo1cHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX2ltZ19pY29uIGltZ3sKICAgICAgICAgICAgICAgICAgICB3aWR0aDo0N3B4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9jb250ZW50ewogICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICAgICAgZmxleC1kaXJlY3Rpb246Y29sdW1uOwogICAgICAgICAgICAgICAgICAgIG1hcmdpbi1yaWdodDogMThweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fbW9uZXl7CiAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDsKICAgICAgICAgICAgICAgICAgICBmbGV4LWRpcmVjdGlvbjpyb3c7CiAgICAgICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBmbGV4LXN0YXJ0OwogICAgICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAuemhtX2Ftb3VudF9tb25leXsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBmbGV4LXN0YXJ0OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9tb25leV9zaWduewogICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmMjMwMzA7CiAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAyMHB4OwogICAgICAgICAgICAgICAgICAgIGZvbnQtZmFtaWx5OiBBcmlhbDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fbW9uZXlfbnVtewogICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmMjMwMzA7CiAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOjM2cHg7CiAgICAgICAgICAgICAgICAgICAgbWFyZ2luLWxlZnQ6IDJweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fY29uZGl0aW9uewogICAgICAgICAgICAgICAgICAgIGNvbG9yOiNmYjBmM2E7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjRlYzsKICAgICAgICAgICAgICAgICAgICBtYXJnaW4tdG9wOjVweDsKICAgICAgICAgICAgICAgICAgICBtYXJnaW4tbGVmdDogNXB4OwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6MnB4IDVweDsKICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MTJweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fdGltZXsKICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4OwogICAgICAgICAgICAgICAgICAgIGZsZXgtZGlyZWN0aW9uOnJvdzsKICAgICAgICAgICAgICAgICAgICBtYXJnaW4tdG9wOiAtNXB4OwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6MnB4IDRweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fdGVybXsKICAgICAgICAgICAgICAgICAgICBjb2xvcjojZmIwZjNhOwogICAgICAgICAgICAgICAgICAgIGJvcmRlcjogMXB4IHNvbGlkICNmYjBmM2E7CiAgICAgICAgICAgICAgICAgICAgYm9yZGVyLXJhZGl1czoycHg7CiAgICAgICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOjBweCA0cHg7CiAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOjEycHg7CiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxOHB4OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9kYXRlewogICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTRweDsKICAgICAgICAgICAgICAgICAgICBmb250LXdlaWdodDogNTAwOwogICAgICAgICAgICAgICAgICAgIHBhZGRpbmctbGVmdDo4cHg7CiAKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fY2lyY2xlewogICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQ6ICNmYjBmM2EgdXJsKGRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBQWdBQUFBSUNBWUFBQURFRDc2TEFBQUFDWEJJV1hNQUFBc1NBQUFMRWdIUzNYNzhBQUFBelVsRVFWUVlsUzNOTVVvRFFSaUc0WGNtdTlsQVhCUWJxKzFDQ3F1Y3dzYk9PM2dBUzI5aDRRbThnUmRJTUtWZ2xRVkJGaVNGallLQnFXWjJkLzdQSXZZUFBFNlNNQ0h2Y0Q4SHVMekJVc0lLRHlZOEFONFJVK0o5LzhuSDhvTFlKM3dXY2h4QmpKSHRaa04xZnNicDlvbXZoenY2Y2NEalFKTGF0bFhYZFpJazVhd2tLVnpkS2s5VzhnQkZVVkRYTlFBMmpKVEE3R1NPbVIyTHBta0lJV0E1NDZzcHZPNXdMMjlRejNHU0JCQ0hubndJek80ZjBmTWFZb0t5L0FjbThBNitmeGtYMTVBTnFpbVk4UWVtQ205MjByMWFVQUFBQUFCSlJVNUVya0pnZ2c9PSkgcmVwZWF0LXk7CiAgICAgICAgICAgICAgICAgICAgbWFyZ2luLXRvcDoxMHB4OwogICAgICAgICAgICAgICAgICAgIHdpZHRoOiAxMHB4OwogICAgICAgICAgICAgICAgICAgIGhlaWdodDo2NnB4OwogICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICAgICAgICAgICAgICAgICAgICByaWdodDo5N3B4OwogICAgICAgICAgICAgICAgICAgIHotaW5kZXg6MjsKICAgICAgICAgICAgICAgICAgICBmaWx0ZXI6bm9uZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fbGlua19jb3Vwb257CiAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDsKICAgICAgICAgICAgICAgICAgICBmbGV4LWRpcmVjdGlvbjpyb3c7CiAgICAgICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6Y2VudGVyOwogICAgICAgICAgICAgICAgICAgIGZpbHRlcjogZHJvcC1zaGFkb3coMnB4IDJweCAzcHggIzg4OCk7CiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZDogcmFkaWFsLWdyYWRpZW50KGNpcmNsZSBhdCBsZWZ0IHRvcCwgdHJhbnNwYXJlbnQgOHB4LCAjZmIwNTNhIDApIHRvcCByaWdodCAvdmFyKC0tbGVmdCkgNTAlIG5vLXJlcGVhdCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYWRpYWwtZ3JhZGllbnQoY2lyY2xlIGF0IGxlZnQgYm90dG9tLCB0cmFuc3BhcmVudCA4cHgsICNmYjA1M2EgMCkgYm90dG9tIHJpZ2h0IC92YXIoLS1sZWZ0KSA1MCUgbm8tcmVwZWF0OwogICAgICAgICAgICAgICAgICAgIGhlaWdodDogODRweDsKICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOjBweCA2cHggMHB4IDRweDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fZ2V0X2xpbmtfdGV4dHsKICAgICAgICAgICAgICAgICAgICBjdXJzb3I6cG9pbnRlcjsKICAgICAgICAgICAgICAgICAgICBtYXJnaW4tdG9wOiAwcHg7CiAgICAgICAgICAgICAgICAgICAgd3JpdGluZy1tb2RlOnZlcnRpY2FsLWxyOwogICAgICAgICAgICAgICAgICAgIGxldHRlci1zcGFjaW5nOjBweDsKICAgICAgICAgICAgICAgICAgICBjb2xvcjogI2ZmZiAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZToxNHB4OwogICAgICAgICAgICAgICAgICAgIGZvbnQtZmFtaWx5OiJNaWNyb3NvZnQgWWFIZWkiOwogICAgICAgICAgICAgICAgICAgIHRleHQtZGVjb3JhdGlvbjpub25lOwogICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQ6IHJhZGlhbC1ncmFkaWVudChjaXJjbGUgYXQgbGVmdCB0b3AsIHRyYW5zcGFyZW50IDhweCwgI2ZiMDUzYSAwKSB0b3AgcmlnaHQgL3ZhcigtLWxlZnQpIDUwJSBuby1yZXBlYXQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFkaWFsLWdyYWRpZW50KGNpcmNsZSBhdCBsZWZ0IGJvdHRvbSwgdHJhbnNwYXJlbnQgOHB4LCAjZmIwNTNhIDApIGJvdHRvbSByaWdodCAvdmFyKC0tbGVmdCkgNTAlIG5vLXJlcGVhdDsKIAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLnpobV9nZXRfbGlua190ZXh0OmhvdmVyewogICAgICAgICAgICAgICAgdGV4dC1kZWNvcmF0aW9uOm5vbmU7CiAgICAgICAgICAgICAgICBmb250LXdlaWdodDo4MDA7CiAgICAgICAgICAgICAgICBmb250LWZhbWlseToiTWljcm9zb2Z0IFlhSGVpIjsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC56aG1fcXJjb2RlewogICAgICAgICAgICAgICAgICAgIGJvcmRlcjozcHggc29saWQgI2ZmZjsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBgOwogCiAgICAgICAgICAgIGRvbVN0eWxlIC5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZShjb3Vwb25TdHlsZSkpOwogCiAgICAgICAgICAgIGRvbUhlYWQuYXBwZW5kQ2hpbGQoZG9tU3R5bGUpOwogCiAgICAgICAgICAgIGxldCBuPTA7CiAKICAgICAgICAgICAgbGV0IGNvdXBvblRpbWVyID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgbisrOwogCiAgICAgICAgICAgICAgICBsZXQgcGFnZU5vZGUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKG5vd05vZGUpCiAKICAgICAgICAgICAgICAgIGlmKHBhZ2VOb2RlKXsKIAogICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoY291cG9uVGltZXIpOwogCiAgICAgICAgICAgICAgICAgICAgY291cG9uQ2xhc3Nbbm93TmFtZV0oKTsKIAogICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICBpZihuPT1jb3Vwb25UaW1lck51bSkgY2xlYXJJbnRlcnZhbChjb3Vwb25UaW1lcik7CiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgfSwxMDApCiAgICAgICAgICAgIH0KIAogICAgICAgIGZ1bmN0aW9uIHBsYXlWaWRlb0Z1bmMoKXsKIAogICAgICAgICAgICB2YXIgcGxheVZpZGVvQ2xhc3MgPSBuZXcgUGxheVZpZGVvQ2xhc3MoKTsKIAogICAgICAgICAgICBwbGF5VmlkZW9DbGFzcy56aG1Mb2dvKCk7CiAKICAgICAgICAgICAgaWYoR01fZ2V0VmFsdWUoJ3BsYXlWaWRlb0xpbmVUZXh0JykpewogCiAgICAgICAgICAgICAgICBsZXQgbGluZU9iaiA9IHBsYXlWaWRlb0NsYXNzLmdldExpbmUoR01fZ2V0VmFsdWUoJ3BsYXlWaWRlb0xpbmVUZXh0JykpOwogCiAgICAgICAgICAgICAgICBpZihsaW5lT2JqKXsKIAogICAgICAgICAgICAgICAgICAgIHBsYXlMaW5lID0gbGluZU9iagogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgIH0KIAogICAgICAgICAgICAvL3RlbXBsYXRlOmljb24scGxheUxpbmU7CiAgICAgICAgICAgIGxldCBwbGF5V3JhcEh0bWwgPSAiPGRpdiBjbGFzcz0nemhtX3BsYXlfdmlkZW9fbGluZSc+IjsKIAogICAgICAgICAgICBwbGF5V3JhcEh0bWwgKz0iPGRpdj48dWwgY2xhc3M9J3pobV9wbGF5X3ZpZGVfbGluZV91bCc+IjsKIAogICAgICAgICAgICBwbGF5TGluZS5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICBsZXQgc2VsZWN0ZWQgPSAnJzsKIAogICAgICAgICAgICAgICAgaWYocGxheVZpZGVvQ2xhc3MuZ2V0Q29va2llKCdwbGF5TGluZUFjdGlvbicpID09IGl0ZW0udXJsKXsKIAogICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkID0gJ3pobV9saW5lX3NlbGVjdGVkJzsKIAogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICBwbGF5V3JhcEh0bWwgKz1gPGxpIGNsYXNzPSdwbGF5TGluZVRkIHpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGkgJHtzZWxlY3RlZH0nIHVybD0nJHtpdGVtLnVybH0nID4ke2l0ZW0ubmFtZX08L2xpPmA7CiAKICAgICAgICAgICAgfSkKIAogICAgICAgICAgICBwbGF5V3JhcEh0bWwgKz0gIjwvZGl2PiI7CiAKICAgICAgICAgICAgbGV0IHpobVBsYXkgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnemhtbG9nbycpOwogCiAgICAgICAgICAgIGxldCBwbGF5TGluZURvbSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpOwogCiAgICAgICAgICAgIHB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ZTonc2VyaWVzLXRhYl9wYW5lJ30sCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6InBsYXlWaWRlbyIsIG5vZGU6IiNwbGF5ZXJXcmFwIixub2RlVHlwZTonaWQnLG1hdGNoOi9maWxtXC5zb2h1XC5jb21cL2FsYnVtXC8vfSwKIAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIjbGVfcGxheWJveCIsbm9kZVR5cGU6J2lkJyxtYXRjaDovbGVcLmNvbVwvcHR2XC92cGxheVwvLyxhcmVhQ2xhc3NOYW1lOidqdWppX2dyaWQnfSwKIAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIjcGxheWVyIixub2RlVHlwZTonaWQnLG1hdGNoOi9wbGF5XC50dWRvdVwuY29tXC92X3Nob3dcL2lkXy99LAogCiAgICAgICAgICAgICAgICB7ZnVuY05hbWU6InBsYXlWaWRlbyIsIG5vZGU6IiNwcHR2X3BsYXlwYWdlX2JveCIsbm9kZVR5cGU6J2lkJyxtYXRjaDovdlwucHB0dlwuY29tXC9zaG93XC8vfSwKIAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIjcGxheWVyIixub2RlVHlwZTonaWQnLG1hdGNoOi92aXBcLjE5MDUuY29tXC9wbGF5XC8vfSwKIAogICAgICAgICAgICAgICAge2Z1bmNOYW1lOiJwbGF5VmlkZW8iLCBub2RlOiIjdm9kUGxheWVyIixub2RlVHlwZTonaWQnLG1hdGNoOi93d3dcLjE5MDUuY29tXC92b2RcL3BsYXlcLy99LAogICAgICAgICAgICBdOwogCiAgICAgICAgICAgIGxldCBqeFZpZGVvV2ViID0ganhWaWRlb0RhdGEuZmlsdGVyKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICByZXR1cm4gbG9jYXRpb24uaHJlZi5tYXRjaChpdGVtLm1hdGNoKTsKIAogICAgICAgICAgICB9KQogCiAgICAgICAgICAgIHBsYXlWaWRlb0NsYXNzLnpobUxvZ29EcmFnKCd2aWRlbycsanhWaWRlb1dlYik7CiAKICAgICAgICAgICAgLy/mmK/lkKblnKjmkq3mlL7pobUKICAgICAgICAgICAgaWYoanhWaWRlb1dlYi5sZW5ndGggPiAwKXsKIAogICAgICAgICAgICAgICAgdmFyIHtmdW5jTmFtZSxtYXRjaDpub3dNYXRjaCxub2RlOm5vd05vZGUsbmFtZTpub3dOYW1lfSA9IGp4VmlkZW9XZWJbMF07CiAKICAgICAgICAgICAgICAgIC8v6byg5qCH57uP6L+H5pi+56S657q/6LevCiAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcucGxheUJ1dHRvbicpLm9ubW91c2VvdmVyPSgpPT57CiAKICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIucGxheUxpbmVEaXYiKS5zdHlsZS5kaXNwbGF5PSdibG9jayc7CiAKICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnBsYXlCdXR0b24nKS5vbm1vdXNlb3V0PSgpPT57CiAKICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIucGxheUxpbmVEaXYiKS5zdHlsZS5kaXNwbGF5PSdub25lJzsKIAogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAvL+mAieaLqee6v+i3r+ino+aekOaSreaUvgogCiAgICAgICAgICAgICAgICB2YXIgcGxheUxpbmVUZCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5wbGF5TGluZVRkJyk7CiAKICAgICAgICAgICAgICAgIHBsYXlMaW5lVGQuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgIGl0ZW0uYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgcGxheUxpbmVUZC5mb3JFYWNoKGZ1bmN0aW9uKGUpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnNldEF0dHJpYnV0ZSgnY2xhc3MnLCdwbGF5TGluZVRkIHpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGknKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEF0dHJpYnV0ZSgnY2xhc3MnLCdwbGF5TGluZVRkIHpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGkgemhtX2xpbmVfc2VsZWN0ZWQnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBwbGF5VmlkZW9DbGFzcy5zZXRDb29raWUoJ3BsYXlMaW5lQWN0aW9uJyx0aGlzLmdldEF0dHJpYnV0ZSgndXJsJyksMzApOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKEdNX2dldFZhbHVlKCd2aWRlb1BsYXlMaW5lQWRkJykgIT0gMjIpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbm93V2ViTm9kZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3Iobm93Tm9kZSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG5vd1dlYk5vZGUpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm93V2ViTm9kZS5pbm5lckhUTUwgPSBwbGF5SnhIdG1sOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlJZnJhbWUgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjcGxheUlmcmFtZScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheUlmcmFtZS5zcmM9IGl0ZW0uZ2V0QXR0cmlidXRlKCd1cmwnKStsb2NhdGlvbi5ocmVmOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfop4bpopHnvZHnq5nnu5PngrnkuI3lrZjlnKgnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93Lm9wZW4oaXRlbS5nZXRBdHRyaWJ1dGUoJ3VybCcpK2xvY2F0aW9uLmhyZWYpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgLyotLeeJueauiuWkhOeQhi0tKi8KICAgICAgICAgICAgICAgIC8v5LyY6YW35Y675bm/5ZGKCiAgICAgICAgICAgICAgICBpZihub3dOb2RlPT0iI3BsYXllciIpewogCiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB5b3VrdUFkID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmFkdmVydGlzZS1sYXllcicpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB5a0FkID0geW91a3VBZC5sYXN0Q2hpbGQ7CiAKICAgICAgICAgICAgICAgICAgICAgICAgeWtBZC5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKHlrQWQpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5rdWktZGFzaGJvYXJkLTAnKS5zdHlsZT0nZGlzcGxheTpmbGV4JzsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheVZpZGVvID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnZpZGVvLWxheWVyIHZpZGVvJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgcGxheVZpZGVvLnBsYXkoKTsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgbj0wOwogCiAgICAgICAgICAgICAgICAgICAgICAgIC8v5pqC5YGcCiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5rdWktcGxheS1pY29uLTAnKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnZpZGVvLWxheWVyIHZpZGVvJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG4rKyUyID09IDApewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8ucGF1c2UoKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlby5wbGF5KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgcGxheVZpZGVvLmFkZEV2ZW50TGlzdGVuZXIoJ3RpbWV1cGRhdGUnLGZ1bmN0aW9uKCl7IC8v5pKt5pS+5pe26Ze05pS55Y+YCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB5b3VrdUFkID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmFkdmVydGlzZS1sYXllcicpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgeWtBZCA9IHlvdWt1QWQubGFzdENoaWxkOwogCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHlrQWQpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeWtBZC5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKHlrQWQpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcua3VpLWRhc2hib2FyZC0wJykuc3R5bGU9J2Rpc3BsYXk6ZmxleCc7CiAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogCiAgICAgICAgICAgICAgICAgICAgfSwzMDAwKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLy/niLHlpYfoibrljrvlub/lkYoKICAgICAgICAgICAgICAgIGlmKG5vd05vZGU9PSIjZmxhc2hib3giKXsKIAogICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZG9tID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnNraXBwYWJsZS1hZnRlcicpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRvbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbS5jbGljaygpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIH0sMzAwMCkKIAogICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAvL+iFvuiur+WOu3ZpcOW8ueeqlwogICAgICAgICAgICAgICAgaWYobm93Tm9kZT09IiNwbGF5ZXItY29udGFpbmVyIil7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgbiA9IDA7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgdGltZXIgPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKG4rKyA8IDEwMCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYW5lbFRpcFZpcCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5wYW5lbC1vdmVybGF5Jyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBhbmVsVGlwVmlwKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhbmVsVGlwVmlwLnN0eWxlLmRpc3BsYXk9J25vbmUnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIH0sMTAwKQogCiAKIAogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC8v5LmQ6KeG6YCJ6ZuG5aSE55CGCiAgICAgICAgICAgICAgICBpZihub3dOb2RlID09ICIjbGVfcGxheWJveCIpewogCiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBqQmxvY2sgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcual9ibG9jaycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFqQmxvY2spIHJldHVybjsKIAogICAgICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGk9MDtpPGpCbG9jay5sZW5ndGg7aSsrKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvSWQgPSBqQmxvY2tbaV0uZ2V0QXR0cmlidXRlKCdkYXRhLXZpZCcpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbGluayA9IGBodHRwczovL3d3dy5sZS5jb20vcHR2L3ZwbGF5LyR7dmlkZW9JZH0uaHRtbGA7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpCbG9ja1tpXS5maXJzdENoaWxkLnNldEF0dHJpYnV0ZSgnaHJlZicsbGluayk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9LDMwMDApCiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIC8vQuermeWkp+S8muWRmHVybOWkhOeQhu+8jOmhtemdomNsYXNz5LiN5LiA6Ie0CiAgICAgICAgICAgICAgICBpZihub3dOb2RlID09ICIucGxheWVyLWNvbnRhaW5lciIpewogCiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcucGxheWVyLWNvbnRhaW5lcicpICYmICFkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuYnB4LXBsYXllci1jb250YWluZXInKSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vd05vZGUgPSAnLnBsYXllci1tYXNrJzsKIAogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbm93Tm9kZSA9ICcuYnB4LXBsYXllci1jb250YWluZXInOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICB9LDMwMDApCiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIC8q6IW+6K6v6KeG6aKR54K55Ye75YW25a6D6KeG6aKR6Lez6L2sKi8KICAgICAgICAgICAgICAgIGlmKG5vd05hbWU9PSdxcVBDJyl7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgZmlndXJlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLmZpZ3VyZScpOwogCiAgICAgICAgICAgICAgICAgICAgbGV0IGZpZ3VyZURldGFpbCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5maWd1cmVfZGV0YWlsJyk7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdEl0ZW0gPSBbLi4uZmlndXJlLC4uLmZpZ3VyZURldGFpbF07CiAKICAgICAgICAgICAgICAgICAgICBpZihsaXN0SXRlbS5sZW5ndGggPiAwKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBsaXN0SXRlbS5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpbmsgPSB0aGlzLmdldEF0dHJpYnV0ZSgnaHJlZicpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYobGluayl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYXRpb24uaHJlZiA9IGxpbms7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICB9KTsKIAogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgbGV0IHZpZGVvU2VsZWN0ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLicranhWaWRlb1dlYlswXS5hcmVhQ2xhc3NOYW1lKTsKIAogICAgICAgICAgICAgICAgICAgIGlmKHZpZGVvU2VsZWN0Lmxlbmd0aD09MCl7Y29uc29sZS5sb2coJ+ivpee9keermeaSreaUvuWMuuexu+WQjeaUueWPmCcpO3JldHVybjt9CiAKICAgICAgICAgICAgICAgICAgICB2aWRlb1NlbGVjdC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKGUpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmPWxvY2F0aW9uLmhyZWY7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sMTAwMCkKIAogICAgICAgICAgICAgICAgICAgICAgICB9KTsKIAogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfSwyMDAwKTsKICAgICAgICAgICAgfQogCiAgICAgICAgfQogCiAgICAgICAgZnVuY3Rpb24gcGxheU11c2ljRnVuYygpewogCiAgICAgICAgICAgIGlmKHNlbGYuZnJhbWVFbGVtZW50ICYmIHNlbGYuZnJhbWVFbGVtZW50LnRhZ05hbWUgPT0gIklGUkFNRSIpewogCiAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIH0KIAogICAgICAgICAgICB2YXIgcGxheU11c2ljQ2xhc3MgPSBuZXcgUGxheU11c2ljQ2xhc3MoKTsKIAogICAgICAgICAgICB2YXIgbXVzaWNJZCA9IE1hdGguY2VpbChNYXRoLnJhbmRvbSgpKjEwMDAwMDAwMCk7CiAKICAgICAgICAgICAgLy9uZXRlYXNlIOi3r+eUseS4pOasoe+8jOmcgOmHjeWumuS5iQogICAgICAgICAgICB2YXIgbmV3VXJsID0gbG9jYXRpb24uaHJlZjsKIAogICAgICAgICAgICBsZXQganhNdXNpY1dlYiA9IGp4TXVzaWNbMF0ud2ViLmZpbHRlcihmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgcmV0dXJuIG5ld1VybC5tYXRjaChpdGVtLm1hdGNoKTsKIAogICAgICAgICAgICB9KQogCiAgICAgICAgICAgIGlmKGp4TXVzaWNXZWIubGVuZ3RoKXsKIAogICAgICAgICAgICAgICAgbGV0IHRpbWVyWmhtSWNvbiA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICBpZiAoZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobUljb24nKSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lclpobUljb24pOyAvLyDlj5bmtojlrprml7blmagKIAogICAgICAgICAgICAgICAgICAgICAgICBpZihqeE11c2ljV2ViWzBdLm5hbWU9PSdrdXdvJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250cm9sID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmljb24tYmFyX2ljb25fZG93bmxvYWRfJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvbiA9IGNvbnRyb2wuY2xvbmVOb2RlKHRydWUpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWNvbi5jbGFzc05hbWUgPSAnJzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGljb24uc3R5bGU9J21hcmdpbi1sZWZ0OjEwcHg7JzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGljb24uaW5uZXJIVE1MID0gIjxhIHN0eWxlPSdmb250LXNpemU6MTBweDt3aGl0ZS1zcGFjZTogbm93cmFwO2N1cnNvcjpwb2ludGVyO2NvbG9yOiM1NTU7JyBpZD0na3V3b0Rvd25sb2FkJz7kuIvovb08L2E+IjsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250cm9scyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5jb2xfcicpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbHMuYmVmb3JlKGljb24pOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2t1d29Eb3dubG9hZCcpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdWRpb1NyYyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoImF1ZGlvIikuc3JjOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzb25nTmFtZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5jb250cm9sIC5zb25nX25hbWUnKS50aXRsZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXJ0aXN0ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmNvbnRyb2wgLmFydGlzdCcpLnRpdGxlOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy5MUl9kb3dubG9hZChhdWRpb1NyYyxzb25nTmFtZSsnLScrYXJ0aXN0KycubXAzJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LDIwMDApCiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICBpZihqeE11c2ljV2ViWzBdLm5hbWU9PSd4aW1hbGF5YScpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/mkq3mlL7lmajliJvlu7rkuIvovb1pY29uCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHhtQ29udHJvbHMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcueG0tcGxheWVyLW9wcmF0aW9ucycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvbnRyb2wgPSB4bUNvbnRyb2xzLnF1ZXJ5U2VsZWN0b3IoJ2E6bnRoLW9mLXR5cGUoMiknKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpY29uID0gY29udHJvbC5jbG9uZU5vZGUodHJ1ZSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpY29uLmlubmVySFRNTCA9ICI8c3BhbiBzdHlsZT0nZm9udC1zaXplOjEwcHg7d2hpdGUtc3BhY2U6IG5vd3JhcDtjdXJzb3I6cG9pbnRlcjtjb2xvcjojRkZGOycgaWQ9J3hpbWFEb3dubG9hZCc+5LiL6L29PC9zcGFuPiI7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4bUNvbnRyb2xzLnN0eWxlPSdwb3NpdGlvbjogcmVsYXRpdmU7bWFyZ2luLWxlZnQ6LTIwcHg7JzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy54bS1wbGF5ZXItcHJvZ3Jlc3MnKS5zdHlsZS53aWR0aD0nNDUwcHgnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnhtLXBsYXllci1wbGF5dGltZScpLnN0eWxlPSdwb3NpdGlvbjogYWJzb2x1dGU7cmlnaHQ6NDBweDsnOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeG1Db250cm9scy5wcmVwZW5kKGljb24pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8v5pKt5pS+5Zmo5LiL6L295LqL5Lu2CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3hpbWFEb3dubG9hZCcpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmbVRpdGxlID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLmZtLXRpdGxlJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZtVGl0bGVNYXRjaCA9IGZtVGl0bGUuaHJlZi5tYXRjaCgvXmh0dHBzPzpcL1wvd3d3XC54aW1hbGF5YVwuY29tXC9zb3VuZFwvKFxTKikkLyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICdodHRwczovL21vYmlsZS54aW1hbGF5YS5jb20vbW9iaWxlLXBsYXlwYWdlL3RyYWNrL3YzL2Jhc2VJbmZvLycrbmV3IERhdGUoKS5nZXRUaW1lKCkrJz9kZXZpY2U9d2ViJnRyYWNrSWQ9JytmbVRpdGxlTWF0Y2hbMV07CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheU11c2ljQ2xhc3MucmVxdWVzdCgnZ2V0Jyx1cmwpLnRoZW4oKHJlc3VsdCk9PnsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGEgPSBKU09OLnBhcnNlKHJlc3VsdCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwbGF5VXJsID0gZGF0YS50cmFja0luZm8ucGxheVVybExpc3RbMV0udXJsOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3RyMSA9IHBsYXlVcmwucmVwbGFjZUFsbCgnLScsJysnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0cjIgPSBzdHIxLnJlcGxhY2VBbGwoJ18nLCcvJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBudW0gPSBzdHIyLmxlbmd0aCU0OwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihudW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyMiArPSAnPT09PScuc3Vic3RyKG51bSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkZWNyeXB0ZWQgPSBDcnlwdG9KUy5BRVMuZGVjcnlwdCh7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaXBoZXJ0ZXh0OiBDcnlwdG9KUy5lbmMuQmFzZTY0LnBhcnNlKHN0cjIpCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIENyeXB0b0pTLmVuYy5IZXgucGFyc2UoImFhYWQzZTRmZDU0MGIwZjc5ZGNhOTU2MDZlNzJiZjkzIiksIHsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6IENyeXB0b0pTLm1vZGUuRUNCLAogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogQ3J5cHRvSlMucGFkLlBrY3M3CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZGVjcnlwdGVkKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZGVjcnlwdGVkKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy5MUl9kb3dubG9hZChkZWNyeXB0ZWQsZGF0YS50cmFja0luZm8udGl0bGUrJy5tcDMnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+ino+WvhuWcsOWdgOWksei0pScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/pobXpnaLliJfooajliJvlu7rmibnph4/kuIvovb0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGltZXIgPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmxNYXRjaCA9IGxvY2F0aW9uLmhyZWYubWF0Y2goL15odHRwczpcL1wvd3d3LnhpbWFsYXlhLmNvbVwvYWxidW1cL1swLTldKy8pOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHVybE1hdGNoKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNvdW5kTGlzdCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNhbmNob3Jfc291bmRfbGlzdCcpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzb3VuZExpc3QpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNvdW5kTGlzdEhlYWQgPSBzb3VuZExpc3QucXVlcnlTZWxlY3RvcignLmhlYWQnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzb3VuZExpc3RIZWFkVGl0bGUgPSBzb3VuZExpc3RIZWFkLnF1ZXJ5U2VsZWN0b3IoJy5zb3J0JykubGFzdENoaWxkOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJhdGNoRG93bmxvYWREb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjYmF0Y2hEb3dubG9hZCcpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWJhdGNoRG93bmxvYWREb20pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gW3tuYW1lOifmibnph4/kuIvovb0nLGlkOidiYXRjaERvd25sb2FkJ30se25hbWU6J+mHjee9ricsaWQ6J3Jlc2V0J30se25hbWU6J+WFqOmAiScsaWQ6J3NlbGVjdEFsbCd9XTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250cm9sID0gc291bmRMaXN0SGVhZFRpdGxlLmNsb25lTm9kZSh0cnVlKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5zZXRBdHRyaWJ1dGUoJ2lkJyxpdGVtLmlkKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5pbm5lclRleHQgPSBpdGVtLm5hbWU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdW5kTGlzdEhlYWRUaXRsZS5hZnRlcihjb250cm9sKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbC5iZWZvcmUoIiB8ICIpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNzZWxlY3RBbGwnKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHpobUNoZWNrYm94ID0gc291bmRMaXN0LnF1ZXJ5U2VsZWN0b3JBbGwoImlucHV0W25hbWU9J3pobUNoZWNrYm94J10iKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgemhtQ2hlY2tib3guZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFpdGVtLmNoZWNrZWQpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uY2hlY2tlZD10cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjcmVzZXQnKS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHpobUNoZWNrYm94ID0gc291bmRMaXN0LnF1ZXJ5U2VsZWN0b3JBbGwoImlucHV0W25hbWU9J3pobUNoZWNrYm94J10iKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgemhtQ2hlY2tib3guZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uY2hlY2tlZCA9IGZhbHNlOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8v5q2j5bqP5YCS5bqP5LqL5Lu2CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdW5kTGlzdEhlYWQucXVlcnlTZWxlY3RvcignLnNvcnQnKS5maXJzdENoaWxkLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF5TXVzaWNDbGFzcy54bWx5Q3JlYXRlQ2hlY2tib3goKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwyMDAwKQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdW5kTGlzdEhlYWRUaXRsZS5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheU11c2ljQ2xhc3MueG1seUNyZWF0ZUNoZWNrYm94KCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sMjAwMCkKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjYmF0Y2hEb3dubG9hZCcpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0Jhc2VDbGFzcy50b2FzdCgn5bey5LiL6L2977yM6K+356iN5YCZJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6aG1DaGVja2JveCA9IHNvdW5kTGlzdC5xdWVyeVNlbGVjdG9yQWxsKCJpbnB1dFtuYW1lPSd6aG1DaGVja2JveCddIik7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHpobUNoZWNrYm94LmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpdGVtLmNoZWNrZWQpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzY3JNYXRjaCA9IGl0ZW0udmFsdWUubWF0Y2goL1wvc291bmRcLyhbMC05XSspLyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICdodHRwczovL21vYmlsZS54aW1hbGF5YS5jb20vbW9iaWxlLXBsYXlwYWdlL3RyYWNrL3YzL2Jhc2VJbmZvLycrbmV3IERhdGUoKS5nZXRUaW1lKCkrJz9kZXZpY2U9d2ViJnRyYWNrSWQ9JytzY3JNYXRjaFsxXTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF5TXVzaWNDbGFzcy5yZXF1ZXN0KCdnZXQnLHVybCkudGhlbigocmVzdWx0KT0+ewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IEpTT04ucGFyc2UocmVzdWx0KTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlVcmwgPSBkYXRhLnRyYWNrSW5mby5wbGF5VXJsTGlzdFsxXS51cmw7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdHIxID0gcGxheVVybC5yZXBsYWNlQWxsKCctJywnKycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3RyMiA9IHN0cjEucmVwbGFjZUFsbCgnXycsJy8nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG51bSA9IHN0cjIubGVuZ3RoJTQ7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG51bSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHIyICs9ICc9PT09Jy5zdWJzdHIobnVtKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRlY3J5cHRlZCA9IENyeXB0b0pTLkFFUy5kZWNyeXB0KHsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpcGhlcnRleHQ6IENyeXB0b0pTLmVuYy5CYXNlNjQucGFyc2Uoc3RyMikKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgQ3J5cHRvSlMuZW5jLkhleC5wYXJzZSgiYWFhZDNlNGZkNTQwYjBmNzlkY2E5NTYwNmU3MmJmOTMiKSwgewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5FQ0IsCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczcKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkudG9TdHJpbmcoQ3J5cHRvSlMuZW5jLlV0ZjgpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKGRlY3J5cHRlZCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRlY3J5cHRlZCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MuTFJfZG93bmxvYWQoZGVjcnlwdGVkLGRhdGEudHJhY2tJbmZvLnRpdGxlKycubXAzJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfop6Plr4blnLDlnYDlpLHotKUnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHpobUNoZWNrYm94PSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuemhtQ2hlY2tib3gnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHpobUNoZWNrYm94Lmxlbmd0aCA9PSAwKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF5TXVzaWNDbGFzcy54bWx5Q3JlYXRlQ2hlY2tib3goKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL+e/u+mhteS6i+S7tgogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhZ2VCYXIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcucGFnaW5hdGlvbi1wYWdlJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwYWdlQmFyKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlQmFyLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF5TXVzaWNDbGFzcy54bWx5Q3JlYXRlQ2hlY2tib3goKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwyMDAwKQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL+i3s+mhteS6i+S7tgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYWdlTGluayA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2J1dHRvblt0eXBlPXN1Ym1pdF0nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBhZ2VMaW5rKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlTGluay5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheU11c2ljQ2xhc3MueG1seUNyZWF0ZUNoZWNrYm94KCk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sMTAwMCkKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5pyq5Yy56YWN5Yiw5YiX6KGo5Zyw5Z2AJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sNTAwKQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LDEwMDApOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL+WFqOWxgOeCueWHu+S6i+S7tgogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLGZ1bmN0aW9uKGUpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9iakxpbmsgPSB7fTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUucGF0aC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0uaHJlZil7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iakxpbmsuaHJlZiA9IGl0ZW0uaHJlZj9pdGVtLmhyZWY6Jyc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iakxpbmsudGFyZ2V0ID0gaXRlbS50YXJnZXQ/aXRlbS50YXJnZXQ6Jyc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG9iakxpbmsuaHJlZiAmJiBvYmpMaW5rLnRhcmdldCAhPSAnX2JsYW5rJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYXRpb24uaHJlZiA9IG9iakxpbmsuaHJlZjsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgaWYoanhNdXNpY1dlYlswXS5uYW1lPT0na3Vnb3UnKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGFEb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCdhJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFEb20uZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhT2JqID0gaXRlbS5nZXRBdHRyaWJ1dGUoJ2RhdGFvYmonKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRhdGFPYmopewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0ucmVtb3ZlQXR0cmlidXRlKCdkYXRhb2JqJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5zZXRBdHRyaWJ1dGUoJ3RhcmdldCcsJ19ibGFuaycpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKGRhdGFPYmopOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoY291cG9uVXJsLmluZGV4T2YoJ21peHNvbmcnKSE9LTEgfHwgY291cG9uVXJsLmluZGV4T2YoJ3NvbmcnKSAhPSAtMSB8fCBjb3Vwb25VcmwuaW5kZXhPZignc2hhcmUnKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZvbHVtZURvbSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN2b2x1bWUnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZG93bmxvYWREb20gPSB2b2x1bWVEb20uY2xvbmVOb2RlKHRydWUpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd25sb2FkRG9tLnJlbW92ZUF0dHJpYnV0ZSgnaWQnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZERvbS5zdHlsZT0nbWFyZ2luLXRvcDozMHB4JzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3dubG9hZERvbS5pbm5lckhUTUwgPSAiPGEgc3R5bGU9J2NvbG9yOiNmZmY7Zm9udC1zaXplOjEwcHg7d2hpdGUtc3BhY2U6bm93cmFwO2N1cnNvcjpwb2ludGVyOycgaWQ9J2t1Z291RG93bmxvYWQnIGphdmFzY3JpcHQ6dm9pZCgwKTs+5LiL6L29PC9hPiI7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9sdW1lRG9tLmJlZm9yZShkb3dubG9hZERvbSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9sdW1lRG9tLnN0eWxlPSdsZWZ0OjUwcHg7JzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjbW9kZScpLnN0eWxlPSdtYXJnaW4tbGVmdDo5MHB4Oyc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3BiX2Rvd25sb2FkJykuc3R5bGU9J21hcmdpbi1sZWZ0OjEzMHB4Oyc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3BiX3NoYXJlJykuc3R5bGU9J21hcmdpbi1sZWZ0OjE3MHB4Oyc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2xpc3QnKS5zdHlsZT0ncmlnaHQ6LTIwcHg7JzsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcja3Vnb3VEb3dubG9hZCcpLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJyxmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXVkaW8gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjbXlBdWRpbycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXVkaW9TcmMgPSBhdWRpby5nZXRBdHRyaWJ1dGUoJ3NyYycpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2luZ2VyTmFtZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5zaW5nZXJOYW1lJykudGl0bGU7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzb25nTmFtZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNzb25nTmFtZVRlbXAnKS50aXRsZTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLkxSX2Rvd25sb2FkKGF1ZGlvU3JjLHNvbmdOYW1lKyctJytzaW5nZXJOYW1lLnN1YnN0cigwLHNpbmdlck5hbWUubGVuZ3RoLTEpKycubXAzJyk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sMTAwMCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGNvdXBvblVybCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICBpZihqeE11c2ljV2ViWzBdLm5hbWU9PSduZXRlYXNlJyAmJiBsb2NhdGlvbi5ocmVmID09ICdodHRwczovL211c2ljLjE2My5jb20vc3QvZG93bmxvYWQnKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHpobVBsYXkgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnemhtSWNvbicpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxheU11c2ljQ2xhc3MuemhtTG9nbygpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF5TXVzaWNDbGFzcy56aG1Mb2dvRHJhZygnbXVzaWMnLGp4TXVzaWNXZWIpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0saWNvbldhaXRUaW1lKTsKIAogICAgICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlNdXNpY0NsYXNzLmNyZWF0ZUVsZW1lbnQoJ2RpdicsJ3pobUljb24nKTsKICAgICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgIH1lbHNlewogCiAgICAgICAgICAgICAgICAgICAgbGV0IHpobVBsYXlEb20gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjemhtSWNvbicpOwogCiAgICAgICAgICAgICAgICAgICAgaWYoemhtUGxheURvbSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgemhtUGxheURvbS5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKHpobVBsYXlEb20pOwogCiAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+W9k+WJjemfs+mikee9keWdgOayoeaciea3u+WKoOWMuemFjeaIluWMuemFjemUmeivrycpOwogCiAgICAgICAgICAgICAgICB9CiAKICAgICAgICB9CiAKICAgICAgICBmdW5jdGlvbiB6aE5pY2VGdW5jKCl7CiAKICAgICAgICAgICAgdmFyIHpoQ2xhc3MgPSBuZXcgWmhDbGFzcygpOwogCiAgICAgICAgICAgIC8v5YWz6Zet55m75b2V5by55qGGCiAgICAgICAgICAgIChhc3luYyBmdW5jdGlvbigpewogCiAgICAgICAgICAgICAgICBsZXQgbG9naW5Nb2RhbFdyYXBwZXIgPSBhd2FpdCBCYXNlQ2xhc3MuZ2V0RWxlbWVudCgiLk1vZGFsLXdyYXBwZXIiKTsKIAogICAgICAgICAgICAgICAgaWYobG9naW5Nb2RhbFdyYXBwZXIpewogCiAgICAgICAgICAgICAgICAgICAgbGV0IGNsb3NlQnV0dG9uID0gbG9naW5Nb2RhbFdyYXBw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FsQ29sdW1uJyxpc09wZW46R01fZ2V0VmFsdWUoJ3NwZWNpYWxDb2x1bW4nLCcyMicpLGlzT25zY3JvbGw6MSxvbmxvYWQ6MX0sCiAgICAgICAgICAgICAgICB7ZnVuYzonc2hvd1ZpZGVvVGl0bGUnLGlzT3BlbjpHTV9nZXRWYWx1ZSgndmlkZW9UaXRsZScsJzIyJyksaXNPbnNjcm9sbDoxLG9ubG9hZDoxfSwKICAgICAgICAgICAgICAgIHtmdW5jOidyZW1vdmVBdXRob3JOYW1lJyxpc09wZW46R01fZ2V0VmFsdWUoJ3JlbW92ZUF1dGhvck5hbWUnLCcwJyksaXNPbnNjcm9sbDoxLG9ubG9hZDoxfSwKICAgICAgICAgICAgICAgIHtmdW5jOidyZW1vdmVZYW54dWFuJyxpc09wZW46R01fZ2V0VmFsdWUoJ3JlbW92ZVlhbnh1YW4nLCcwJyksaXNPbnNjcm9sbDoxLG9ubG9hZDoxfSwKICAgICAgICAgICAgXQogCiAgICAgICAgICAgIHpoRGF0YS5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogICAgICAgICAgICAgICAgaWYoaXRlbS5pc09wZW49PTIyICYmIGl0ZW0ub25sb2FkPT0wKXsKICAgICAgICAgICAgICAgICAgICB6aENsYXNzW2l0ZW0uZnVuY10oKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSkKIAogICAgICAgICAgICB3aW5kb3cub25sb2FkPWZ1bmN0aW9uKCl7CiAgICAgICAgICAgICAgICB6aERhdGEuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKICAgICAgICAgICAgICAgICAgICBpZihpdGVtLmlzT3Blbj09MjIgJiYgaXRlbS5vbmxvYWQ9PTEpewogICAgICAgICAgICAgICAgICAgICAgICB6aENsYXNzW2l0ZW0uZnVuY10oKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICB9CiAgICAgICAgICAgIHdpbmRvdy5vbnNjcm9sbCA9IGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgIHZhciBzY3JvbGxUb3AgPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuc2Nyb2xsVG9wOwogCiAgICAgICAgICAgICAgICBpZihzY3JvbGxUb3AgPiAyMDApewogCiAgICAgICAgICAgICAgICAgICAgemhEYXRhLmZvckVhY2goZnVuY3Rpb24oaXRlbSl7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0uaXNPcGVuPT0yMiAmJiBpdGVtLmlzT25zY3JvbGw9PTEpewogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6aENsYXNzW2l0ZW0uZnVuY10oKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICB9CiAKICAgICAgICB9CiAKICAgICAgICBmdW5jdGlvbiB0YW9iYW9TZWFyY2hGdW5jKGl0ZW0pewogCiAgICAgICAgICAgIGxldCB0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CiAKICAgICAgICAgICAgICAgIGxldCB0YW9iYW9JY29uRG9tID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3Rhb2Jhb0ljb25TZWxlY3QnKTsKIAogICAgICAgICAgICAgICAgbGV0IGJhc2VDbGFzcyA9IG5ldyBCYXNlQ2xhc3MoKTsKIAogICAgICAgICAgICAgICAgbGV0IGZpbHRlclRtYWxsID0gYmFzZUNsYXNzLmdldFF1ZXJ5U3RyaW5nKCdmaWx0ZXJfdGlhbm1hbycpOwogCiAgICAgICAgICAgICAgICBpZighdGFvYmFvSWNvbkRvbSl7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgZmlsdGVycyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5maWx0ZXJzID5hJyk7CiAKICAgICAgICAgICAgICAgICAgICBpZihmaWx0ZXJzLmxlbmd0aD4wKXsKIAogICAgICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGk9MDtpPGZpbHRlcnMubGVuZ3RoO2krKyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhVmFsdWUgPSBmaWx0ZXJzW2ldLmdldEF0dHJpYnV0ZSgnZGF0YS12YWx1ZScpOwogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihkYXRhVmFsdWUgPT0gJ3RtYWxsJyl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKGRhdGFWYWx1ZSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGFvYmFvRG9tID0gZmlsdGVyc1tpXS5jbG9uZU5vZGUodHJ1ZSk7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YW9iYW9Eb20ucXVlcnlTZWxlY3RvcignLnRleHQnKS5pbm5lclRleHQ9J+a3mOWunSc7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YW9iYW9Eb20uc2V0QXR0cmlidXRlKCdpZCcsJ3Rhb2Jhb0ljb25TZWxlY3QnKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhb2Jhb0RvbS5zZXRBdHRyaWJ1dGUoJ2RhdGEtdmFsdWUnLCd0YW9iYW8nKTsKIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGZpbHRlclRtYWxsPT0ndGFvYmFvJyl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhb2Jhb0RvbS5zZXRBdHRyaWJ1dGUoJ2RhdGEtYWN0aW9uJywncmVtb3ZlJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhb2Jhb0RvbS5jbGFzc05hbWU9J2ZpbHRlciBpY29uLXRhZyBKX0FqYXggaWNvbi1ob3Zlcic7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhb2Jhb0RvbS5yZW1vdmVBdHRyaWJ1dGUoJ2RhdGEtYWN0aW9uJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhb2Jhb0RvbS5jbGFzc05hbWU9J2ZpbHRlciBpY29uLXRhZyBKX0FqYXgnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbHRlcnNbaV0uYmVmb3JlKHRhb2Jhb0RvbSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgfWVsc2V7CiAKICAgICAgICAgICAgICAgICAgICBpZihmaWx0ZXJUbWFsbD09J3Rhb2JhbycpewogICAgICAgICAgICAgICAgICAgICAgICB0YW9iYW9JY29uRG9tLnNldEF0dHJpYnV0ZSgnZGF0YS1hY3Rpb24nLCdyZW1vdmUnKTsKICAgICAgICAgICAgICAgICAgICAgICAgdGFvYmFvSWNvbkRvbS5jbGFzc05hbWU9J2ZpbHRlciBpY29uLXRhZyBKX0FqYXggaWNvbi1ob3Zlcic7CiAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgICAgIHRhb2Jhb0ljb25Eb20ucmVtb3ZlQXR0cmlidXRlKCdkYXRhLWFjdGlvbicpOwogICAgICAgICAgICAgICAgICAgICAgICB0YW9iYW9JY29uRG9tLmNsYXNzTmFtZT0nZmlsdGVyIGljb24tdGFnIEpfQWpheCc7CiAgICAgICAgICAgICAgICAgICAgfQogCiAKICAgICAgICAgICAgICAgIH0KIAogCiAKICAgICAgICAgICAgICAgIGlmKGZpbHRlclRtYWxsPT0ndGFvYmFvJyl7CiAKICAgICAgICAgICAgICAgICAgICBsZXQgZ29vZHNMaXN0ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLml0ZW1zID4gLml0ZW0nKTsKIAogICAgICAgICAgICAgICAgICAgIGdvb2RzTGlzdC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpY29uTGlDbGFzcyA9IGl0ZW0ucXVlcnlTZWxlY3RvcignLmljb25zPmxpPmE+c3BhbicpOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjbGFzc05hbWVUbT1bJ2ljb24tc2VydmljZS10aWFubWFvJywnaWNvbi1zZXJ2aWNlLXRpYW5tYW9ndW9qaSddOwogCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGljb25MaUNsYXNzICYmIGNsYXNzTmFtZVRtLmluZGV4T2YoaWNvbkxpQ2xhc3MuY2xhc3NOYW1lKSAhPSAtMSl7CiAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uc3R5bGU9J2Rpc3BsYXk6bm9uZTsnOwogCiAgICAgICAgICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgICAgICAgIH0pCiAKICAgICAgICAgICAgICAgICAgICAvL2NsZWFySW50ZXJ2YWwodGltZXIpOwogCiAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgfSw1MDApCiAKICAgICAgICB9CiAKICAgICAgICBmdW5jdGlvbiBiYWlkdUZ1bmMoKXsKICAgICAgICBsZXQgcHQgPSAnJywgc2VsZWN0TGlzdCA9IFtdLCBwYXJhbXMgPSB7fSwgbW9kZSA9ICcnLCB3aWR0aCA9IDgwMCwgcGFuID0ge30sIGNvbG9yID0gJycsCiAgICAgICAgZG9jID0gJChkb2N1bWVudCksIHByb2dyZXNzID0ge30sIHJlcXVlc3QgPSB7fSwgaW5zID0ge30sIGlkbSA9IHt9OwogICAgICAgIGNvbnN0IHZlcnNpb24gPSAnNi4wLjMnOwogICAgICAgIGNvbnN0IGF1dGhvciA9ICdHcmVhc3lGb3JrJzsKICAgICAgICBjb25zdCBuYW1lID0gJ+e9keebmOebtOmTvuS4i+i9veWKqeaJiyc7CiAgICAgICAgY29uc3QgY3VzdG9tQ2xhc3MgPSB7CiAgICAgICAgcG9wdXA6ICdwbC1wb3B1cCcsCiAgICAgICAgaGVhZGVyOiAncGwtaGVhZGVyJywKICAgICAgICB0aXRsZTogJ3BsLXRpdGxlJywKICAgICAgICBjbG9zZUJ1dHRvbjogJ3BsLWNsb3NlJywKICAgICAgICBjb250ZW50OiAncGwtY29udGVudCcsCiAgICAgICAgaW5wdXQ6ICdwbC1pbnB1dCcsCiAgICAgICAgZm9vdGVyOiAncGwtZm9vdGVyJwogICAgfTsKIAogICAgY29uc3QgdGVybWluYWxUeXBlID0gewogICAgICAgIHdjOiAiV2luZG93cyBDTUQiLAogICAgICAgIHdwOiAiV2luZG93cyBQb3dlclNoZWxsIiwKICAgICAgICBsdDogIkxpbnV4IOe7iOerryIsCiAgICAgICAgbHM6ICJMaW51eCBTaGVsbCIsCiAgICAgICAgbXQ6ICJNYWNPUyDnu4jnq68iLAogICAgfTsKIAogICAgbGV0IHRvYXN0ID0gU3dhbC5taXhpbih7CiAgICAgICAgdG9hc3Q6IHRydWUsCiAgICAgICAgcG9zaXRpb246ICd0b3AnLAogICAgICAgIHNob3dDb25maXJtQnV0dG9uOiBmYWxzZSwKICAgICAgICB0aW1lcjogMzUwMCwKICAgICAgICB0aW1lclByb2dyZXNzQmFyOiBmYWxzZSwKICAgICAgICBkaWRPcGVuOiAodG9hc3QpID0+IHsKICAgICAgICAgICAgdG9hc3QuYWRkRXZlbnRMaXN0ZW5lcignbW91c2VlbnRlcicsIFN3YWwuc3RvcFRpbWVyKTsKICAgICAgICAgICAgdG9hc3QuYWRkRXZlbnRMaXN0ZW5lcignbW91c2VsZWF2ZScsIFN3YWwucmVzdW1lVGltZXIpOwogICAgICAgIH0KICAgIH0pOwogCiAgICBjb25zdCBtZXNzYWdlID0gewogICAgICAgIHN1Y2Nlc3M6ICh0ZXh0KSA9PiB7CiAgICAgICAgICAgIHRvYXN0LmZpcmUoe3RpdGxlOiB0ZXh0LCBpY29uOiAnc3VjY2Vzcyd9KTsKICAgICAgICB9LAogICAgICAgIGVycm9yOiAodGV4dCkgPT4gewogICAgICAgICAgICB0b2FzdC5maXJlKHt0aXRsZTogdGV4dCwgaWNvbjogJ2Vycm9yJ30pOwogICAgICAgIH0sCiAgICAgICAgd2FybmluZzogKHRleHQpID0+IHsKICAgICAgICAgICAgdG9hc3QuZmlyZSh7dGl0bGU6IHRleHQsIGljb246ICd3YXJuaW5nJ30pOwogICAgICAgIH0sCiAgICAgICAgaW5mbzogKHRleHQpID0+IHsKICAgICAgICAgICAgdG9hc3QuZmlyZSh7dGl0bGU6IHRleHQsIGljb246ICdpbmZvJ30pOwogICAgICAgIH0sCiAgICAgICAgcXVlc3Rpb246ICh0ZXh0KSA9PiB7CiAgICAgICAgICAgIHRvYXN0LmZpcmUoe3RpdGxlOiB0ZXh0LCBpY29uOiAncXVlc3Rpb24nfSk7CiAgICAgICAgfQogICAgfTsKIAogICAgbGV0IGJhc2UgPSB7CiAKICAgICAgICBnZXRDb29raWUobmFtZSkgewogICAgICAgICAgICBsZXQgYXJyID0gZG9jdW1lbnQuY29va2llLnJlcGxhY2UoL1xzL2csICIiKS5zcGxpdCgnOycpOwogICAgICAgICAgICBmb3IgKGxldCBpID0gMCwgbCA9IGFyci5sZW5ndGg7IGkgPCBsOyBpKyspIHsKICAgICAgICAgICAgICAgIGxldCB0ZW1wQXJyID0gYXJyW2ldLnNwbGl0KCc9Jyk7CiAgICAgICAgICAgICAgICBpZiAodGVtcEFyclswXSA9PT0gbmFtZSkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBkZWNvZGVVUklDb21wb25lbnQodGVtcEFyclsxXSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuICcnOwogICAgICAgIH0sCiAKICAgICAgICBpc1R5cGUob2JqKSB7CiAgICAgICAgICAgIHJldHVybiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqKS5yZXBsYWNlKC9eXFtvYmplY3QgKC4rKVxdJC8sICckMScpLnRvTG93ZXJDYXNlKCk7CiAgICAgICAgfSwKIAogICAgICAgIGdldFZhbHVlKG5hbWUpIHsKICAgICAgICAgICAgcmV0dXJuIEdNX2dldFZhbHVlKG5hbWUpOwogICAgICAgIH0sCiAKICAgICAgICBzZXRWYWx1ZShuYW1lLCB2YWx1ZSkgewogICAgICAgICAgICBHTV9zZXRWYWx1ZShuYW1lLCB2YWx1ZSk7CiAgICAgICAgfSwKIAogICAgICAgIGdldFN0b3JhZ2Uoa2V5KSB7CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShsb2NhbFN0b3JhZ2UuZ2V0SXRlbShrZXkpKTsKICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGxvY2FsU3RvcmFnZS5nZXRJdGVtKGtleSk7CiAgICAgICAgICAgIH0KICAgICAgICB9LAogCiAgICAgICAgc2V0U3RvcmFnZShrZXksIHZhbHVlKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzVHlwZSh2YWx1ZSkgPT09ICdvYmplY3QnIHx8IHRoaXMuaXNUeXBlKHZhbHVlKSA9PT0gJ2FycmF5JykgewogICAgICAgICAgICAgICAgcmV0dXJuIGxvY2FsU3RvcmFnZS5zZXRJdGVtKGtleSwgSlNPTi5zdHJpbmdpZnkodmFsdWUpKTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gbG9jYWxTdG9yYWdlLnNldEl0ZW0oa2V5LCB2YWx1ZSk7CiAgICAgICAgfSwKIAogICAgICAgIHNldENsaXBib2FyZCh0ZXh0KSB7CiAgICAgICAgICAgIEdNX3NldENsaXBib2FyZCh0ZXh0LCAndGV4dCcpOwogICAgICAgIH0sCiAKICAgICAgICBlKHN0cikgewogICAgICAgICAgICByZXR1cm4gYnRvYSh1bmVzY2FwZShlbmNvZGVVUklDb21wb25lbnQoc3RyKSkpOwogICAgICAgIH0sCiAKICAgICAgICBkKHN0cikgewogICAgICAgICAgICByZXR1cm4gZGVjb2RlVVJJQ29tcG9uZW50KGVzY2FwZShhdG9iKHN0cikpKTsKICAgICAgICB9LAogCiAgICAgICAgZ2V0RXh0ZW5zaW9uKG5hbWUpIHsKICAgICAgICAgICAgY29uc3QgcmVnID0gLyg/IVwuKVx3KyQvOwogICAgICAgICAgICBpZiAocmVnLnRlc3QobmFtZSkpIHsKICAgICAgICAgICAgICAgIGxldCBtYXRjaCA9IG5hbWUubWF0Y2gocmVnKTsKICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaFswXS50b1VwcGVyQ2FzZSgpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9LAogCiAgICAgICAgc2l6ZUZvcm1hdCh2YWx1ZSkgewogICAgICAgICAgICBpZiAodmFsdWUgPT09ICt2YWx1ZSkgewogICAgICAgICAgICAgICAgbGV0IHVuaXQgPSBbIkIiLCAiS0IiLCAiTUIiLCAiR0IiLCAiVEIiLCAiUEIiLCAiRUIiLCAiWkIiLCAiWUIiXTsKICAgICAgICAgICAgICAgIGxldCBpbmRleCA9IE1hdGguZmxvb3IoTWF0aC5sb2codmFsdWUpIC8gTWF0aC5sb2coMTAyNCkpOwogICAgICAgICAgICAgICAgbGV0IHNpemUgPSB2YWx1ZSAvIE1hdGgucG93KDEwMjQsIGluZGV4KTsKICAgICAgICAgICAgICAgIHNpemUgPSBzaXplLnRvRml4ZWQoMSk7CiAgICAgICAgICAgICAgICByZXR1cm4gc2l6ZSArIHVuaXRbaW5kZXhdOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9LAogCiAgICAgICAgc29ydEJ5TmFtZShhcnIpIHsKICAgICAgICAgICAgY29uc3QgaGFuZGxlID0gKCkgPT4gewogICAgICAgICAgICAgICAgcmV0dXJuIChhLCBiKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgY29uc3QgcDEgPSBhLmZpbGVuYW1lID8gYS5maWxlbmFtZSA6IGEuc2VydmVyX2ZpbGVuYW1lOwogICAgICAgICAgICAgICAgICAgIGNvbnN0IHAyID0gYi5maWxlbmFtZSA/IGIuZmlsZW5hbWUgOiBiLnNlcnZlcl9maWxlbmFtZTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gcDEubG9jYWxlQ29tcGFyZShwMiwgInpoLUNOIik7CiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICB9OwogICAgICAgICAgICBhcnIuc29ydChoYW5kbGUoKSk7CiAgICAgICAgfSwKIAogICAgICAgIGJsb2JEb3dubG9hZChibG9iLCBmaWxlbmFtZSkgewogICAgICAgICAgICBpZiAoYmxvYiBpbnN0YW5jZW9mIEJsb2IpIHsKICAgICAgICAgICAgICAgIGNvbnN0IHVybCA9IFVSTC5jcmVhdGVPYmplY3RVUkwoYmxvYik7CiAgICAgICAgICAgICAgICBjb25zdCBhID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYScpOwogICAgICAgICAgICAgICAgYS5ocmVmID0gdXJsOwogICAgICAgICAgICAgICAgYS5kb3dubG9hZCA9IGZpbGVuYW1lOwogICAgICAgICAgICAgICAgYS5jbGljaygpOwogICAgICAgICAgICAgICAgVVJMLnJldm9rZU9iamVjdFVSTCh1cmwpOwogICAgICAgICAgICB9CiAgICAgICAgfSwKIAogICAgICAgIHBvc3QodXJsLCBkYXRhLCBoZWFkZXJzLCB0eXBlKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzVHlwZShkYXRhKSA9PT0gJ29iamVjdCcpIHsKICAgICAgICAgICAgICAgIGRhdGEgPSBKU09OLnN0cmluZ2lmeShkYXRhKTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4gewogICAgICAgICAgICAgICAgR01feG1saHR0cFJlcXVlc3QoewogICAgICAgICAgICAgICAgICAgIG1ldGhvZDogIlBPU1QiLCB1cmwsIGhlYWRlcnMsIGRhdGEsCiAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2VUeXBlOiB0eXBlIHx8ICdqc29uJywKICAgICAgICAgICAgICAgICAgICBvbmxvYWQ6IChyZXMpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9PT0gJ2Jsb2InID8gcmVzb2x2ZShyZXMpIDogcmVzb2x2ZShyZXMucmVzcG9uc2UgfHwgcmVzLnJlc3BvbnNlVGV4dCk7CiAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICBvbmVycm9yOiAoZXJyKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnIpOwogICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwKIAogICAgICAgIGdldCh1cmwsIGhlYWRlcnMsIHR5cGUsIGV4dHJhKSB7CiAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7CiAgICAgICAgICAgICAgICBsZXQgcmVxdWVzdE9iaiA9IEdNX3htbGh0dHBSZXF1ZXN0KHsKICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICJHRVQiLCB1cmwsIGhlYWRlcnMsCiAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2VUeXBlOiB0eXBlIHx8ICdqc29uJywKICAgICAgICAgICAgICAgICAgICBvbmxvYWQ6IChyZXMpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcy5zdGF0dXMgPT09IDIwNCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdE9iai5hYm9ydCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWRtW2V4dHJhLmluZGV4XSA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09ICdibG9iJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLnN0YXR1cyA9PT0gMjAwICYmIGJhc2UuYmxvYkRvd25sb2FkKHJlcy5yZXNwb25zZSwgZXh0cmEuZmlsZW5hbWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXMpOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXMucmVzcG9uc2UgfHwgcmVzLnJlc3BvbnNlVGV4dCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgIG9ucHJvZ3Jlc3M6IChyZXMpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4dHJhICYmIGV4dHJhLmZpbGVuYW1lICYmIGV4dHJhLmluZGV4KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMudG90YWwgPiAwID8gcHJvZ3Jlc3NbZXh0cmEuaW5kZXhdID0gKHJlcy5sb2FkZWQgKiAxMDAgLyByZXMudG90YWwpLnRvRml4ZWQoMikgOiBwcm9ncmVzc1tleHRyYS5pbmRleF0gPSAwLjAwOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICBvbmxvYWRzdGFydCgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEgJiYgZXh0cmEuZmlsZW5hbWUgJiYgZXh0cmEuaW5kZXggJiYgKHJlcXVlc3RbZXh0cmEuaW5kZXhdID0gcmVxdWVzdE9iaik7CiAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICBvbmVycm9yOiAoZXJyKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnIpOwogICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwKIAogICAgICAgIGdldEZpbmFsVXJsKHVybCwgaGVhZGVycykgewogICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4gewogICAgICAgICAgICAgICAgbGV0IHJlcXVlc3RPYmogPSBHTV94bWxodHRwUmVxdWVzdCh7CiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAiR0VUIiwgdXJsLCBoZWFkZXJzLAogICAgICAgICAgICAgICAgICAgIG9ubG9hZDogKHJlcykgPT4gewogICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJlcy5maW5hbFVybCk7CiAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICBvbmVycm9yOiAoZXJyKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnIpOwogICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwKIAogICAgICAgIGFkZFN0eWxlKGlkLCB0YWcsIGNzcykgewogICAgICAgICAgICB0YWcgPSB0YWcgfHwgJ3N0eWxlJzsKICAgICAgICAgICAgbGV0IGRvYyA9IGRvY3VtZW50LCBzdHlsZURvbSA9IGRvYy5nZXRFbGVtZW50QnlJZChpZCk7CiAgICAgICAgICAgIGlmIChzdHlsZURvbSkgcmV0dXJuOwogICAgICAgICAgICBsZXQgc3R5bGUgPSBkb2MuY3JlYXRlRWxlbWVudCh0YWcpOwogICAgICAgICAgICBzdHlsZS5yZWwgPSAnc3R5bGVzaGVldCc7CiAgICAgICAgICAgIHN0eWxlLmlkID0gaWQ7CiAgICAgICAgICAgIHRhZyA9PT0gJ3N0eWxlJyA/IHN0eWxlLmlubmVySFRNTCA9IGNzcyA6IHN0eWxlLmhyZWYgPSBjc3M7CiAgICAgICAgICAgIGRvYy5nZXRFbGVtZW50c0J5VGFnTmFtZSgnaGVhZCcpWzBdLmFwcGVuZENoaWxkKHN0eWxlKTsKICAgICAgICB9LAogCiAgICAgICAgZmluZFJlYWN0KGRvbSwgdHJhdmVyc2VVcCA9IDApIHsKICAgICAgICAgICAgY29uc3Qga2V5ID0gT2JqZWN0LmtleXMoZG9tKS5maW5kKGtleSA9PiB7CiAgICAgICAgICAgICAgICByZXR1cm4ga2V5LnN0YXJ0c1dpdGgoIl9fcmVhY3RGaWJlciQiKQogICAgICAgICAgICAgICAgICAgIHx8IGtleS5zdGFydHNXaXRoKCJfX3JlYWN0SW50ZXJuYWxJbnN0YW5jZSQiKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGNvbnN0IGRvbUZpYmVyID0gZG9tW2tleV07CiAgICAgICAgICAgIGlmIChkb21GaWJlciA9PSBudWxsKSByZXR1cm4gbnVsbDsKIAogICAgICAgICAgICBpZiAoZG9tRmliZXIuX2N1cnJlbnRFbGVtZW50KSB7CiAgICAgICAgICAgICAgICBsZXQgY29tcEZpYmVyID0gZG9tRmliZXIuX2N1cnJlbnRFbGVtZW50Ll9vd25lcjsKICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJhdmVyc2VVcDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgY29tcEZpYmVyID0gY29tcEZpYmVyLl9jdXJyZW50RWxlbWVudC5fb3duZXI7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICByZXR1cm4gY29tcEZpYmVyLl9pbnN0YW5jZTsKICAgICAgICAgICAgfQogCiAgICAgICAgICAgIGNvbnN0IEdldENvbXBGaWJlciA9IGZpYmVyID0+IHsKICAgICAgICAgICAgICAgIGxldCBwYXJlbnRGaWJlciA9IGZpYmVyLnJldHVybjsKICAgICAgICAgICAgICAgIHdoaWxlICh0eXBlb2YgcGFyZW50RmliZXIudHlwZSA9PSAic3RyaW5nIikgewogICAgICAgICAgICAgICAgICAgIHBhcmVudEZpYmVyID0gcGFyZW50RmliZXIucmV0dXJuOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIHBhcmVudEZpYmVyOwogICAgICAgICAgICB9OwogICAgICAgICAgICBsZXQgY29tcEZpYmVyID0gR2V0Q29tcEZpYmVyKGRvbUZpYmVyKTsKICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmF2ZXJzZVVwOyBpKyspIHsKICAgICAgICAgICAgICAgIGNvbXBGaWJlciA9IEdldENvbXBGaWJlcihjb21wRmliZXIpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiBjb21wRmliZXIuc3RhdGVOb2RlIHx8IGNvbXBGaWJlcjsKICAgICAgICB9LAogCiAgICAgICAgaW5pdERlZmF1bHRDb25maWcoKSB7CiAgICAgICAgICAgIGxldCB2YWx1ZSA9IFt7CiAgICAgICAgICAgICAgICBuYW1lOiAnc2V0dGluZ19ycGNfZG9tYWluJywKICAgICAgICAgICAgICAgIHZhbHVlOiAnaHR0cDovL2xvY2FsaG9zdCcKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgbmFtZTogJ3NldHRpbmdfcnBjX3BvcnQnLAogICAgICAgICAgICAgICAgdmFsdWU6ICcxNjgwMCcKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgbmFtZTogJ3NldHRpbmdfcnBjX3BhdGgnLAogICAgICAgICAgICAgICAgdmFsdWU6ICcvanNvbnJwYycKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgbmFtZTogJ3NldHRpbmdfcnBjX3Rva2VuJywKICAgICAgICAgICAgICAgIHZhbHVlOiAnJwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICBuYW1lOiAnc2V0dGluZ19ycGNfZGlyJywKICAgICAgICAgICAgICAgIHZhbHVlOiAnRDonCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICAgIG5hbWU6ICdzZXR0aW5nX3Rlcm1pbmFsX3R5cGUnLAogICAgICAgICAgICAgICAgdmFsdWU6ICd3YycKICAgICAgICAgICAgfSwgewogICAgICAgICAgICAgICAgbmFtZTogJ3NldHRpbmdfdGhlbWVfY29sb3InLAogICAgICAgICAgICAgICAgdmFsdWU6ICcjMDlBQUZGJwogICAgICAgICAgICB9LCB7CiAgICAgICAgICAgICAgICBuYW1lOiAnc2V0dGluZ19pbml0X2NvZGUnLAogICAgICAgICAgICAgICAgdmFsdWU6ICcnCiAgICAgICAgICAgIH1dOwogCiAgICAgICAgICAgIHZhbHVlLmZvckVhY2goKHYpID0+IHsKICAgICAgICAgICAgICAgIGJhc2UuZ2V0VmFsdWUodi5uYW1lKSA9PT0gdW5kZWZpbmVkICYmIGJhc2Uuc2V0VmFsdWUodi5uYW1lLCB2LnZhbHVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwKIAogICAgICAgIHNob3dTZXR0aW5nKCkgewogICAgICAgICAgICBsZXQgZG9tID0gJycsIGJ0biA9ICcnLAogICAgICAgICAgICAgICAgY29sb3JMaXN0ID0gWycjMDlBQUZGJywgJyNjYzMyMzUnLCAnIzUyNmVmYScsICcjNTE4YzE3JywgJyNlZDk0NGInLCAnI2Y5NjlhNScsICcjYmNhMjgwJ107CiAgICAgICAgICAgIGRvbSArPSBgPGxhYmVsIGNsYXNzPSJwbC1zZXR0aW5nLWxhYmVsIj48ZGl2IGNsYXNzPSJwbC1sYWJlbCI+UlBD5Li75py6PC9kaXY+PGlucHV0IHR5cGU9InRleHQiICBwbGFjZWhvbGRlcj0i5Li75py65Zyw5Z2A77yM6ZyA5bim5LiKaHR0cChzKTovLyIgY2xhc3M9InBsLWlucHV0IGxpc3RlbmVyLWRvbWFpbiIgdmFsdWU9IiR7YmFzZS5nZXRWYWx1ZSgnc2V0dGluZ19ycGNfZG9tYWluJyl9Ij48L2xhYmVsPmA7CiAgICAgICAgICAgIG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sIGNsYXNzPSJwbC1zZXR0aW5nLWxhYmVsIj48ZGl2IGNsYXNzPSJwbC1sYWJlbCI+5Li76aKY6aKc6ImyPC9kaXY+IDxkaXYgY2xhc3M9InBsLWNvbG9yIj4ke2J0bn08ZGl2PjwvbGFiZWw+YDsKICAgICAgICAgICAgZG9tID0gJzxkaXY+JyArIGRvbSArICc8L2Rpdj4nOwogCiAgICAgICAgICAgIFN3YWwuZmlyZSh7CiAgICAgICAgICAgICAgICB0aXRsZTogJ+WKqeaJi+mFjee9ricsCiAgICAgICAgICAgICAgICBodG1sOiBkb20sCiAgICAgICAgICAgICAgICBpY29uOiAnaW5mbycsCiAgICAgICAgICAgICAgICBzaG93Q2xvc2VCdXR0b246IHRydWUsCiAgICAgICAgICAgICAgICBzaG93Q29uZmlybUJ1dHRvbjogZmFsc2UsCiAgICAgICAgICAgICAgICBmb290ZXI6IHBhbi5mb290ZXIsCiAgICAgICAgICAgIH0pLnRoZW4oKCkgPT4gewogICAgICAgICAgICAgICAgbWVzc2FnZS5zdWNjZXNzKCforr7nva7miJDlip/vvIEnKTsKICAgICAgICAgICAgICAgIGhpc3RvcnkuZ28oMCk7CiAgICAgICAgICAgIH0pOwogCiAgICAgICAgICAgIGRvYy5vbignY2xpY2snLCAnLmxpc3RlbmVyLWNvbG9yJywgYXN5bmMgKGUpID0+IHsKICAgICAgICAgICAgICAgIGJhc2Uuc2V0VmFsdWUoJ3NldHRpbmdfdGhlbWVfY29sb3InLCBlLnRhcmdldC5kYXRhc2V0LmNvbG9yKTsKICAgICAgICAgICAgICAgIG1lc3NhZ2Uuc3VjY2Vzcygn6K6+572u5oiQ5Yqf77yBJyk7CiAgICAgICAgICAgICAgICBoaXN0b3J5LmdvKDApOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdpbnB1dCcsICcubGlzdGVuZXItZG9tYWluJywgYXN5bmMgKGUpID0+IHsKICAgICAgICAgICAgICAgIGJhc2Uuc2V0VmFsdWUoJ3NldHRpbmdfcnBjX2RvbWFpbicsIGUudGFyZ2V0LnZhbHVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignaW5wdXQnLCAnLmxpc3RlbmVyLXBvcnQnLCBhc3luYyAoZSkgPT4gewogICAgICAgICAgICAgICAgYmFzZS5zZXRWYWx1ZSgnc2V0dGluZ19ycGNfcG9ydCcsIGUudGFyZ2V0LnZhbHVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignaW5wdXQnLCAnLmxpc3RlbmVyLXBhdGgnLCBhc3luYyAoZSkgPT4gewogICAgICAgICAgICAgICAgYmFzZS5zZXRWYWx1ZSgnc2V0dGluZ19ycGNfcGF0aCcsIGUudGFyZ2V0LnZhbHVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignaW5wdXQnLCAnLmxpc3RlbmVyLXRva2VuJywgYXN5bmMgKGUpID0+IHsKICAgICAgICAgICAgICAgIGJhc2Uuc2V0VmFsdWUoJ3NldHRpbmdfcnBjX3Rva2VuJywgZS50YXJnZXQudmFsdWUpOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdpbnB1dCcsICcubGlzdGVuZXItZGlyJywgYXN5bmMgKGUpID0+IHsKICAgICAgICAgICAgICAgIGJhc2Uuc2V0VmFsdWUoJ3NldHRpbmdfcnBjX2RpcicsIGUudGFyZ2V0LnZhbHVlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignY2hhbmdlJywgJy5saXN0ZW5lci10ZXJtaW5hbCcsIGFzeW5jIChlKSA9PiB7CiAgICAgICAgICAgICAgICBiYXNlLnNldFZhbHVlKCdzZXR0aW5nX3Rlcm1pbmFsX3R5cGUnLCBlLnRhcmdldC52YWx1ZSk7CiAgICAgICAgICAgIH0pOwogICAgICAgIH0sCiAKICAgICAgICByZWdpc3Rlck1lbnVDb21tYW5kKCkgewogICAgICAgICAgICBHTV9yZWdpc3Rlck1lbnVDb21tYW5kKCfimpnvuI8g6K6+572uJywgKCkgPT4gewogICAgICAgICAgICAgICAgdGhpcy5zaG93U2V0dGluZygpOwogICAgICAgICAgICB9KTsKICAgICAgICB9LAogCiAgICAgICAgY3JlYXRlVGlwKCkgewogICAgICAgICAgICAkKCdib2R5JykuYXBwZW5kKCc8ZGl2IGNsYXNzPSJwbC10b29sdGlwIj48L2Rpdj4nKTsKIAogICAgICAgICAgICBkb2Mub24oJ21vdXNlZW50ZXIgbW91c2VsZWF2ZScsICcubGlzdGVuZXItdGlwJywgKGUpID0+IHsKICAgICAgICAgICAgICAgIGlmIChlLnR5cGUgPT09ICdtb3VzZWVudGVyJykgewogICAgICAgICAgICAgICAgICAgIGxldCBmaWxlbmFtZSA9IGUuY3VycmVudFRhcmdldC5pbm5lclRleHQ7CiAgICAgICAgICAgICAgICAgICAgbGV0IHNpemUgPSBlLmN1cnJlbnRUYXJnZXQuZGF0YXNldC5zaXplOwogICAgICAgICAgICAgICAgICAgIGxldCB0aXAgPSBgJHtmaWxlbmFtZX08c3BhbiBzdHlsZT0ibWFyZ2luLWxlZnQ6IDEwcHg7Y29sb3I6ICNmNTZjNmM7Ij4ke3NpemV9PC9zcGFuPmA7CiAgICAgICAgICAgICAgICAgICAgJChlLmN1cnJlbnRUYXJnZXQpLmNzcyh7b3BhY2l0eTogJzAuNSd9KTsKICAgICAgICAgICAgICAgICAgICAkKCcucGwtdG9vbHRpcCcpLmh0bWwodGlwKS5jc3MoewogICAgICAgICAgICAgICAgICAgICAgICAnbGVmdCc6IGUucGFnZVggKyAxMCArICdweCcsCiAgICAgICAgICAgICAgICAgICAgICAgICd0b3AnOiBlLnBhZ2VZIC0gZS5jdXJyZW50VGFyZ2V0Lm9mZnNldFRvcCA+IDE0ID8gZS5wYWdlWSArICdweCcgOiBlLnBhZ2VZICsgMjAgKyAncHgnCiAgICAgICAgICAgICAgICAgICAgfSkuc2hvdygpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAkKGUuY3VycmVudFRhcmdldCkuY3NzKHtvcGFjaXR5OiAnMSd9KTsKICAgICAgICAgICAgICAgICAgICAkKCcucGwtdG9vbHRpcCcpLmhpZGUoMCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgIH0sCiAKICAgICAgICBjcmVhdGVMb2FkaW5nKCkgewogICAgICAgICAgICByZXR1cm4gJCgnPGRpdiBjbGFzcz0icGwtbG9hZGluZyI+PGRpdiBjbGFzcz0icGwtbG9hZGluZy1ib3giPjxkaXY+PGRpdj48L2Rpdj48ZGl2PjwvZGl2PjwvZGl2PjwvZGl2PjwvZGl2PicpOwogICAgICAgIH0sCiAKICAgICAgICBjcmVhdGVEb3dubG9hZElmcmFtZSgpIHsKICAgICAgICAgICAgbGV0ICRkaXYgPSAkKCc8ZGl2IHN0eWxlPSJwYWRkaW5nOjA7bWFyZ2luOjA7ZGlzcGxheTpibG9jayI+PC9kaXY+Jyk7CiAgICAgICAgICAgIGxldCAkaWZyYW1lID0gJCgnPGlmcmFtZSBzcmM9ImphdmFzY3JpcHQ6OyIgaWQ9ImRvd25sb2FkSWZyYW1lIiBzdHlsZT0iZGlzcGxheTpub25lIj48L2lmcmFtZT4nKTsKICAgICAgICAgICAgJGRpdi5hcHBlbmQoJGlmcmFtZSk7CiAgICAgICAgICAgICQoJ2JvZHknKS5hcHBlbmQoJGRpdik7CiAgICAgICAgfSwKIAogICAgICAgIGdldE1pcnJvckxpc3QobGluaywgbWlycm9yLCB0aHJlYWQgPSAyKSB7CiAgICAgICAgICAgIGxldCBob3N0ID0gbmV3IFVSTChsaW5rKS5ob3N0OwogICAgICAgICAgICBsZXQgbWlycm9ycyA9IFtdOwogICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1pcnJvci5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0aHJlYWQ7IGorKykgewogICAgICAgICAgICAgICAgICAgIGxldCBpdGVtID0gbGluay5yZXBsYWNlKGhvc3QsIG1pcnJvcltpXSkgKyAnJicucmVwZWF0KGopOwogICAgICAgICAgICAgICAgICAgIG1pcnJvcnMucHVzaChpdGVtKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gbWlycm9ycy5qb2luKCdcbicpOwogICAgICAgIH0sCiAKICAgICAgICBhZGRQYW5MaW5rZXJTdHlsZSgpIHsKICAgICAgICAgICAgY29sb3IgPSBiYXNlLmdldFZhbHVlKCdzZXR0aW5nX3RoZW1lX2NvbG9yJyk7CiAgICAgICAgICAgIGxldCBjc3MgPSBgCiAgICAgICAgICAgIGJvZHk6Oi13ZWJraXQtc2Nyb2xsYmFyIHsgZGlzcGxheTogbm9uZSB9CiAgICAgICAgICAgIDo6LXdlYmtpdC1zY3JvbGxiYXIgeyB3aWR0aDogNnB4OyBoZWlnaHQ6IDEwcHggfQogICAgICAgICAgICA6Oi13ZWJraXQtc2Nyb2xsYmFyLXRyYWNrIHsgYm9yZGVyLXJhZGl1czogMDsgYmFja2dyb3VuZDogbm9uZSB9CiAgICAgICAgICAgIDo6LXdlYmtpdC1zY3JvbGxiYXItdGh1bWIgeyBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDg1LDg1LDg1LC40KSB9CiAgICAgICAgICAgIDo6LXdlYmtpdC1zY3JvbGxiYXItdGh1bWIsOjotd2Via2l0LXNjcm9sbGJhci10aHVtYjpob3ZlciB7IGJvcmRlci1yYWRpdXM6IDVweDsgLXdlYmtpdC1ib3gtc2hhZG93OiBpbnNldCAwIDAgNnB4IHJnYmEoMCwwLDAsLjIpIH0KICAgICAgICAgICAgOjotd2Via2l0LXNjcm9sbGJhci10aHVtYjpob3ZlciB7IGJhY2tncm91bmQtY29sb3I6IHJnYmEoODUsODUsODUsLjMpIH0KICAgICAgICAgICAgLnN3YWwyLXBvcHVwIHsgZm9udC1zaXplOiAxNnB4ICFpbXBvcnR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Ym94OyB9CiAgICAgICAgICAgIC5zd2FsMi1jb250YWluZXIgeyB6LWluZGV4OjEwMDAwMCFpbXBvcnRhbnQ7IH0KICAgICAgICAgICAgYm9keS5zd2FsMi1oZWlnaHQtYXV0byB7IGhlaWdodDogaW5oZXJpdCFpbXBvcnRhbnQ7IH0KICAgICAgICAgICAgYDsKICAgICAgICAgICAgdGhpcy5hZGRTdHlsZSgncGFubGlua2VyLXN0eWxlJywgJ3N0eWxlJywgY3NzKTsKICAgICAgICB9LAogCiAgICAgICAgYXN5bmMgaW5pdERpYWxvZygpIHsKICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSBhd2FpdCBTd2FsLmZpcmUoewogICAgICAgICAgICAgICAgICAgIHRpdGxlOiAi6K+35pSv5oyB5Y6f5YibIiwKICAgICAgICAgICAgICAgICAgICBodG1sOiBgPGRpdj48aW1nIHN0eWxlPSJ3aWR0aDogMjUwcHg7bWFyZ2luLWJvdHRvbTogMTBweDsiIHNyYz0iJHtwYW4uaW1nfSIgYWx0PSIke3Bhbi5pbWd9Ij48aW5wdXQgY2xhc3M9InN3YWwyLWlucHV0IiBpZD0iaW5pdCIgdHlwZT0idGV4dCIgcGxhY2Vob2xkZXI9Iuivt+maj+S+v+i+k+WFpeaal+WPtyI+PC9kaXY+YCwKICAgICAgICAgICAgICAgICAgICBhbGxvd091dHNpZGVDbGljazogZmFsc2UsCiAgICAgICAgICAgICAgICAgICAgc2hvd0Nsb3NlQnV0dG9uOiB0cnVlLAogICAgICAgICAgICAgICAgICAgIGNvbmZpcm1CdXR0b25UZXh0OiAn56C06KejJwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBpZiAocmVzdWx0LmlzRGlzbWlzc2VkICYmIHJlc3VsdC5kaXNtaXNzID09PSAnY2xvc2UnKSByZXR1cm47CiAgICAgICAgICAgICAgICBpZiAocGFuLm51bSA9PSBwYW4ubnVtKSB7CiAgICAgICAgICAgICAgICAgICAgYmFzZS5zZXRWYWx1ZSgnc2V0dGluZ19pbml0X2NvZGUnLCBwYW4ubnVtKTsKICAgICAgICAgICAgICAgICAgICBtZXNzYWdlLnN1Y2Nlc3MoIuaal+WPt+ato+ehriIpOwogICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgICAgICBoaXN0b3J5LmdvKDApOwogICAgICAgICAgICAgICAgICAgIH0sIDE1MDApOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBhd2FpdCBTd2FsLmZpcmUoewogICAgICAgICAgICAgICAgICAgICAgICB0aXRsZToi5pqX5Y+35LiN5q2j56GuIiwKICAgICAgICAgICAgICAgICAgICAgICAgdGV4dDogIuaal+WPt+S4jeato+ehriIsCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm1CdXR0b25UZXh0OiAn6YeN5paw6L6T5YWlJywKICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2VVcmw6IHBhbi5pbWcsCiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5pbml0RGlhbG9nKCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sCiAgICAgICAgfTsKIAogICAgbGV0IGJhaWR1ID0gewogCiAgICAgICAgX2dldEV4dHJhKCkgewogICAgICAgICAgICBsZXQgc2VLZXkgPSBkZWNvZGVVUklDb21wb25lbnQoYmFzZS5nZXRDb29raWUoJ0JEQ0xORCcpKTsKICAgICAgICAgICAgcmV0dXJuICd7JyArICcic2VrZXkiOiInICsgc2VLZXkgKyAnIicgKyAifSI7CiAgICAgICAgfSwKIAogICAgICAgIF9nZXRTdXJsKCkgewogCiAgICAgICAgICAgICAgICBsZXQgcmVzcCA9IGxvY2F0aW9uLmhyZWYubWF0Y2goL2h0dHBzPzpcL1wvLitcLmJhaWR1XC5jb21cLyhzXC98c3VybD0pKC4rKVw/Lyk7CiAKICAgICAgICAgICAgICAgIGlmIChyZXNwKSB7CiAgICAgICAgICAgICAgICAgICAgLy9jb25zb2xlLmxvZyhyZXNwWzJdLCdyZXNwJyk7CiAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXNwWzJdOwogCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIHJldHVybiAnJzsKIAogICAgICAgIH0sCiAKICAgICAgICBfZ2V0RmlkTGlzdCgpIHsKICAgICAgICAgICAgbGV0IGZpZGxpc3QgPSBbXTsKICAgICAgICAgICAgc2VsZWN0TGlzdC5mb3JFYWNoKHYgPT4gewogICAgICAgICAgICAgICAgaWYgKCt2LmlzZGlyID09PSAxKSByZXR1cm47CiAgICAgICAgICAgICAgICBmaWRsaXN0LnB1c2godi5mc19pZCk7CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICByZXR1cm4gJ1snICsgZmlkbGlzdCArICddJzsKICAgICAgICB9LAogCiAgICAgICAgX3Jlc2V0RGF0YSgpIHsKICAgICAgICAgICAgcHJvZ3Jlc3MgPSB7fTsKICAgICAgICAgICAgJC5lYWNoKHJlcXVlc3QsIChrZXkpID0+IHsKICAgICAgICAgICAgICAgIChyZXF1ZXN0W2tleV0pLmFib3J0KCk7CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICAkLmVhY2goaW5zLCAoa2V5KSA9PiB7CiAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKGluc1trZXldKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGlkbSA9IHt9OwogICAgICAgICAgICBpbnMgPSB7fTsKICAgICAgICAgICAgcmVxdWVzdCA9IHt9OwogICAgICAgIH0sCiAKICAgICAgICBzZXRCRFVTUygpIHsKICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgIEdNX2Nvb2tpZSAmJiBHTV9jb29raWUoJ2xpc3QnLCB7bmFtZTogJ0JEVVNTJ30sIChjb29raWVzLCBlcnJvcikgPT4gewogICAgICAgICAgICAgICAgICAgIGlmICghZXJyb3IpIHsKICAgICAgICAgICAgICAgICAgICAgICAgYmFzZS5zZXRTdG9yYWdlKCJiYWlkdXl1blBsdWdpbl9CRFVTUyIsIHtCRFVTUzogY29va2llc1swXS52YWx1ZX0pOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIH0KICAgICAgICB9LAogCiAgICAgICAgZ2V0QkRVU1MoKSB7CiAgICAgICAgICAgIGxldCBiYWlkdXl1blBsdWdpbl9CRFVTUyA9IGJhc2UuZ2V0U3RvcmFnZSgnYmFpZHV5dW5QbHVnaW5fQkRVU1MnKSA/IGJhc2UuZ2V0U3RvcmFnZSgnYmFpZHV5dW5QbHVnaW5fQkRVU1MnKSA6ICd7ImJhaWR1eXVuUGx1Z2luX0JEVVNTIjoiIn0nOwogICAgICAgICAgICByZXR1cm4gYmFpZHV5dW5QbHVnaW5fQkRVU1MuQkRVU1MgfHwgJyc7CiAgICAgICAgfSwKIAogICAgICAgIGNvbnZlcnRMaW5rVG9BcmlhKGxpbmssIGZpbGVuYW1lLCB1YSkgewogICAgICAgICAgICBsZXQgQkRVU1MgPSB0aGlzLmdldEJEVVNTKCk7CiAgICAgICAgICAgIGlmICghIUJEVVNTKSB7CiAgICAgICAgICAgICAgICBmaWxlbmFtZSA9IGZpbGVuYW1lLnJlcGxhY2UoJyAnLCAnXycpOwogICAgICAgICAgICAgICAgcmV0dXJuIGVuY29kZVVSSUNvbXBvbmVudChgYXJpYTJjICIke2xpbmt9IiAtLW91dCAiJHtmaWxlbmFtZX0iIC0taGVhZGVyICJVc2VyLUFnZW50OiAke3VhfSIgLS1oZWFkZXIgIkNvb2tpZTogQkRVU1M9JHtCRFVTU30iYCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgICAgIGxpbms6IHBhbi5hc3Npc3RhbnQsCiAgICAgICAgICAgICAgICB0ZXh0OiBwYW4uaW5pdFs1XQogICAgICAgICAgICB9OwogICAgICAgIH0sCiAKICAgICAgICBjb252ZXJ0TGlua1RvQkMobGluaywgZmlsZW5hbWUsIHVhKSB7CiAgICAgICAgICAgIGxldCBCRFVTUyA9IHRoaXMuZ2V0QkRVU1MoKTsKICAgICAgICAgICAgaWYgKCEhQkRVU1MpIHsKICAgICAgICAgICAgICAgIGxldCBjb29raWUgPSBgQkRVU1M9JHtCRFVTU31gOwogICAgICAgICAgICAgICAgbGV0IGJjID0gYEFBLyR7ZW5jb2RlVVJJQ29tcG9uZW50KGZpbGVuYW1lKX0vP3VybD0ke2VuY29kZVVSSUNvbXBvbmVudChsaW5rKX0mY29va2llPSR7ZW5jb2RlVVJJQ29tcG9uZW50KGNvb2tpZSl9JnVzZXJfYWdlbnQ9JHtlbmNvZGVVUklDb21wb25lbnQodWEpfVpaYDsKICAgICAgICAgICAgICAgIHJldHVybiBlbmNvZGVVUklDb21wb25lbnQoYGJjOi8vaHR0cC8ke2Jhc2UuZShiYyl9YCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgICAgIGxpbms6IHBhbi5hc3Npc3RhbnQsCiAgICAgICAgICAgICAgICB0ZXh0OiBwYW4uaW5pdFs1XQogICAgICAgICAgICB9OwogICAgICAgIH0sCiAKICAgICAgICBjb252ZXJ0TGlua1RvQ3VybChsaW5rLCBmaWxlbmFtZSwgdWEpIHsKICAgICAgICAgICAgbGV0IEJEVVNTID0gdGhpcy5nZXRCRFVTUygpOwogICAgICAgICAgICBpZiAoISFCRFVTUykgewogICAgICAgICAgICAgICAgbGV0IHRlcm1pbmFsID0gYmFzZS5nZXRWYWx1ZSgnc2V0dGluZ190ZXJtaW5hbF90eXBlJyk7CiAgICAgICAgICAgICAgICBmaWxlbmFtZSA9IGZpbGVuYW1lLnJlcGxhY2UoJyAnLCAnXycpOwogICAgICAgICAgICAgICAgcmV0dXJuIGVuY29kZVVSSUNvbXBvbmVudChgJHt0ZXJtaW5hbCAhPT0gJ3dwJyA/ICdjdXJsJyA6ICdjdXJsLmV4ZSd9IC1MICIke2xpbmt9IiAtLW91dHB1dCAiJHtmaWxlbmFtZX0iIC1BICIke3VhfSIgLWIgIkJEVVNTPSR7QkRVU1N9ImApOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICBsaW5rOiBwYW4uYXNzaXN0YW50LAogICAgICAgICAgICAgICAgdGV4dDogcGFuLmluaXRbNV0KICAgICAgICAgICAgfTsKICAgICAgICB9LAogCiAgICAgICAgYWRkUGFnZUxpc3RlbmVyKCkgewogICAgICAgICAgICBmdW5jdGlvbiBfZmFjdG9yeShlKSB7CiAgICAgICAgICAgICAgICBsZXQgdGFyZ2V0ID0gJChlLnRhcmdldCk7CiAgICAgICAgICAgICAgICBsZXQgaXRlbSA9IHRhcmdldC5wYXJlbnRzKCcucGwtaXRlbScpOwogICAgICAgICAgICAgICAgbGV0IGxpbmsgPSBpdGVtLmZpbmQoJy5wbC1pdGVtLWxpbmsnKTsKICAgICAgICAgICAgICAgIGxldCBwcm9ncmVzcyA9IGl0ZW0uZmluZCgnLnBsLWl0ZW0tcHJvZ3Jlc3MnKTsKICAgICAgICAgICAgICAgIGxldCB0aXAgPSBpdGVtLmZpbmQoJy5wbC1pdGVtLXRpcCcpOwogICAgICAgICAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgICAgICAgICBpdGVtLCBsaW5rLCBwcm9ncmVzcywgdGlwLCB0YXJnZXQsCiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICB9CiAKICAgICAgICAgICAgZnVuY3Rpb24gX3Jlc2V0KGkpIHsKICAgICAgICAgICAgICAgIGluc1tpXSAmJiBjbGVhckludGVydmFsKGluc1tpXSk7CiAgICAgICAgICAgICAgICByZXF1ZXN0W2ldICYmIHJlcXVlc3RbaV0uYWJvcnQoKTsKICAgICAgICAgICAgICAgIHByb2dyZXNzW2ldID0gMDsKICAgICAgICAgICAgICAgIGlkbVtpXSA9IGZhbHNlOwogICAgICAgICAgICB9CiAKICAgICAgICAgICAgZG9jLm9uKCdtb3VzZWVudGVyIG1vdXNlbGVhdmUgY2xpY2snLCAnLnBsLWJ1dHRvbi5nLWRyb3Bkb3duLWJ1dHRvbicsIChlKSA9PiB7CiAgICAgICAgICAgICAgICBpZiAoZS50eXBlID09PSAnbW91c2VsZWF2ZScpIHsKICAgICAgICAgICAgICAgICAgICAkKGUuY3VycmVudFRhcmdldCkucmVtb3ZlQ2xhc3MoJ2J1dHRvbi1vcGVuJyk7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICQoZS5jdXJyZW50VGFyZ2V0KS5hZGRDbGFzcygnYnV0dG9uLW9wZW4nKTsKICAgICAgICAgICAgICAgICAgICAkKGUuY3VycmVudFRhcmdldCkuZmluZCgnLnBsLWRyb3Bkb3duLW1lbnUnKS5zaG93KCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkb2Mub24oJ21vdXNlbGVhdmUnLCAnLnBsLWJ1dHRvbi5nLWRyb3Bkb3duLWJ1dHRvbiAucGwtZHJvcGRvd24tbWVudScsIChlKSA9PiB7CiAgICAgICAgICAgICAgICAkKGUuY3VycmVudFRhcmdldCkuaGlkZSgpOwogICAgICAgICAgICB9KTsKIAogICAgICAgICAgICBkb2Mub24oJ2NsaWNrJywgJy5wbC1idXR0b24tbW9kZScsIChlKSA9PiB7CiAgICAgICAgICAgICAgICBtb2RlID0gZS50YXJnZXQuZGF0YXNldC5tb2RlOwogICAgICAgICAgICAgICAgU3dhbC5zaG93TG9hZGluZygpOwogICAgICAgICAgICAgICAgdGhpcy5nZXRQQ1NMaW5rKCk7CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkb2Mub24oJ2NsaWNrJywgJy5saXN0ZW5lci1saW5rLWFwaScsIGFzeW5jIChlKSA9PiB7CiAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7CiAgICAgICAgICAgICAgICBsZXQgbyA9IF9mYWN0b3J5KGUpOwogICAgICAgICAgICAgICAgbGV0ICR3aWR0aCA9IG8uaXRlbS5maW5kKCcucGwtcHJvZ3Jlc3MtaW5uZXInKTsKICAgICAgICAgICAgICAgIGxldCAkdGV4dCA9IG8uaXRlbS5maW5kKCcucGwtcHJvZ3Jlc3MtaW5uZXItdGV4dCcpOwogICAgICAgICAgICAgICAgbGV0IGZpbGVuYW1lID0gby5saW5rWzBdLmRhdGFzZXQuZmlsZW5hbWU7CiAgICAgICAgICAgICAgICBsZXQgaW5kZXggPSBvLmxpbmtbMF0uZGF0YXNldC5pbmRleDsKICAgICAgICAgICAgICAgIF9yZXNldChpbmRleCk7CiAgICAgICAgICAgICAgICBiYXNlLmdldChvLmxpbmtbMF0uZGF0YXNldC5saW5rLCB7IlVzZXItQWdlbnQiOiBwYW4udWF9LCAnYmxvYicsIHtmaWxlbmFtZSwgaW5kZXh9KTsKICAgICAgICAgICAgICAgIGluc1tpbmRleF0gPSBzZXRJbnRlcnZhbCgoKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgbGV0IHByb2cgPSArcHJvZ3Jlc3NbaW5kZXhdIHx8IDA7CiAgICAgICAgICAgICAgICAgICAgbGV0IGlzSURNID0gaWRtW2luZGV4XSB8fCBmYWxzZTsKICAgICAgICAgICAgICAgICAgICBpZiAoaXNJRE0pIHsKICAgICAgICAgICAgICAgICAgICAgICAgby50aXAuaGlkZSgpOwogICAgICAgICAgICAgICAgICAgICAgICBvLnByb2dyZXNzLmhpZGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgby5saW5rLnRleHQoJ+W3suaIkOWKn+WUpOi1t0lETe+8jOivt+afpeeci0lETeS4i+i9veahhu+8gScpLmFuaW1hdGUoe29wYWNpdHk6ICcwLjUnfSwgInNsb3ciKS5zaG93KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoaW5zW2luZGV4XSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlkbVtpbmRleF0gPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBvLmxpbmsuaGlkZSgpOwogICAgICAgICAgICAgICAgICAgICAgICBvLnRpcC5oaWRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIG8ucHJvZ3Jlc3Muc2hvdygpOwogICAgICAgICAgICAgICAgICAgICAgICAkd2lkdGguY3NzKCd3aWR0aCcsIHByb2cgKyAnJScpOwogICAgICAgICAgICAgICAgICAgICAgICAkdGV4dC50ZXh0KHByb2cgKyAnJScpOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJvZyA9PT0gMTAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKGluc1tpbmRleF0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NbaW5kZXhdID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8uaXRlbS5maW5kKCcucGwtcHJvZ3Jlc3Mtc3RvcCcpLmhpZGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8uaXRlbS5maW5kKCcucGwtcHJvZ3Jlc3MtdGlwJykuaHRtbCgn5LiL6L295a6M5oiQ77yM5q2j5Zyo5by55Ye65rWP6KeI5Zmo5LiL6L295qGG77yBJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9LCA1MDApOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdjbGljaycsICcubGlzdGVuZXItcmV0cnknLCBhc3luYyAoZSkgPT4gewogICAgICAgICAgICAgICAgbGV0IG8gPSBfZmFjdG9yeShlKTsKICAgICAgICAgICAgICAgIG8udGlwLmhpZGUoKTsKICAgICAgICAgICAgICAgIG8ubGluay5zaG93KCk7CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkb2Mub24oJ2NsaWNrJywgJy5saXN0ZW5lci1ob3cnLCBhc3luYyAoZSkgPT4gewogICAgICAgICAgICAgICAgbGV0IG8gPSBfZmFjdG9yeShlKTsKICAgICAgICAgICAgICAgIGxldCBpbmRleCA9IG8ubGlua1swXS5kYXRhc2V0LmluZGV4OwogICAgICAgICAgICAgICAgaWYgKHJlcXVlc3RbaW5kZXhdKSB7CiAgICAgICAgICAgICAgICAgICAgcmVxdWVzdFtpbmRleF0uYWJvcnQoKTsKICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKGluc1tpbmRleF0pOwogICAgICAgICAgICAgICAgICAgIG8ucHJvZ3Jlc3MuaGlkZSgpOwogICAgICAgICAgICAgICAgICAgIG8udGlwLnNob3coKTsKICAgICAgICAgICAgICAgIH0KIAogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdjbGljaycsICcubGlzdGVuZXItc3RvcCcsIGFzeW5jIChlKSA9PiB7CiAgICAgICAgICAgICAgICBsZXQgbyA9IF9mYWN0b3J5KGUpOwogICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gby5saW5rWzBdLmRhdGFzZXQuaW5kZXg7CiAgICAgICAgICAgICAgICBpZiAocmVxdWVzdFtpbmRleF0pIHsKICAgICAgICAgICAgICAgICAgICByZXF1ZXN0W2luZGV4XS5hYm9ydCgpOwogICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoaW5zW2luZGV4XSk7CiAgICAgICAgICAgICAgICAgICAgby50aXAuaGlkZSgpOwogICAgICAgICAgICAgICAgICAgIG8ucHJvZ3Jlc3MuaGlkZSgpOwogICAgICAgICAgICAgICAgICAgIG8ubGluay5zaG93KDApOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdjbGljaycsICcubGlzdGVuZXItYmFjaycsIGFzeW5jIChlKSA9PiB7CiAgICAgICAgICAgICAgICBsZXQgbyA9IF9mYWN0b3J5KGUpOwogICAgICAgICAgICAgICAgby50aXAuaGlkZSgpOwogICAgICAgICAgICAgICAgby5saW5rLnNob3coKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignY2xpY2snLCAnLmxpc3RlbmVyLWxpbmstYXJpYSwgLmxpc3RlbmVyLWNvcHktYWxsJywgKGUpID0+IHsKICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKICAgICAgICAgICAgICAgIGlmICghZS50YXJnZXQuZGF0YXNldC5saW5rKSB7CiAgICAgICAgICAgICAgICAgICAgJChlLnRhcmdldCkucmVtb3ZlQ2xhc3MoJ2xpc3RlbmVyLWNvcHktYWxsJykuYWRkQ2xhc3MoJ3BsLWJ0bi1kYW5nZXInKS5odG1sKGAke3Bhbi5pbml0WzVdffCfkYk8YSBocmVmPSIke3Bhbi5hc3Npc3RhbnR9IiB0YXJnZXQ9Il9ibGFuayIgY2xhc3M9InBsLWEiPueCueWHu+atpOWkhOWuieijhTwvYT7wn5GIYCk7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGJhc2Uuc2V0Q2xpcGJvYXJkKGRlY29kZVVSSUNvbXBvbmVudChlLnRhcmdldC5kYXRhc2V0LmxpbmspKTsKICAgICAgICAgICAgICAgICAgICAkKGUudGFyZ2V0KS50ZXh0KCflpI3liLbmiJDlip/vvIzlv6vljrvnspjotLTlkKfvvIEnKS5hbmltYXRlKHtvcGFjaXR5OiAnMC41J30sICJzbG93Iik7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkb2Mub24oJ2NsaWNrJywgJy5saXN0ZW5lci1saW5rLXJwYycsIGFzeW5jIChlKSA9PiB7CiAgICAgICAgICAgICAgICBsZXQgdGFyZ2V0ID0gJChlLmN1cnJlbnRUYXJnZXQpOwogICAgICAgICAgICAgICAgdGFyZ2V0LmZpbmQoJy5pY29uJykucmVtb3ZlKCk7CiAgICAgICAgICAgICAgICB0YXJnZXQuZmluZCgnLnBsLWxvYWRpbmcnKS5yZW1vdmUoKTsKICAgICAgICAgICAgICAgIHRhcmdldC5wcmVwZW5kKGJhc2UuY3JlYXRlTG9hZGluZygpKTsKICAgICAgICAgICAgICAgIGxldCByZXMgPSBhd2FpdCB0aGlzLnNlbmRMaW5rVG9SUEMoZS5jdXJyZW50VGFyZ2V0LmRhdGFzZXQuZmlsZW5hbWUsIGUuY3VycmVudFRhcmdldC5kYXRhc2V0LmxpbmspOwogICAgICAgICAgICAgICAgaWYgKHJlcyA9PT0gJ3N1Y2Nlc3MnKSB7CiAgICAgICAgICAgICAgICAgICAgJCgnLmxpc3RlbmVyLXJwYy10YXNrJykuc2hvdygpOwogICAgICAgICAgICAgICAgICAgIHRhcmdldC5yZW1vdmVDbGFzcygncGwtYnRuLWRhbmdlcicpLmh0bWwoJ+WPkemAgeaIkOWKn++8jOW/q+WOu+eci+eci+WQp++8gScpLmFuaW1hdGUoe29wYWNpdHk6ICcwLjUnfSwgInNsb3ciKTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzID09PSAnYXNzaXN0YW50JykgewogICAgICAgICAgICAgICAgICAgIHRhcmdldC5hZGRDbGFzcygncGwtYnRuLWRhbmdlcicpLmh0bWwoYCR7cGFuLmluaXRbNV198J+RiTxhIGhyZWY9IiR7cGFuLmFzc2lzdGFudH0iIHRhcmdldD0iX2JsYW5rIiBjbGFzcz0icGwtYSI+54K55Ye75q2k5aSE5a6J6KOFPC9hPvCfkYhgKTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0LmFkZENsYXNzKCdwbC1idG4tZGFuZ2VyJykudGV4dCgn5Y+R6YCB5aSx6LSl77yM6K+35qOA5p+l5oKo55qEUlBD6YWN572u5L+h5oGv77yBJykuYW5pbWF0ZSh7b3BhY2l0eTogJzAuNSd9LCAic2xvdyIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZG9jLm9uKCdjbGljaycsICcubGlzdGVuZXItc2VuZC1ycGMnLCAoZSkgPT4gewogICAgICAgICAgICAgICAgJCgnLmxpc3RlbmVyLWxpbmstcnBjJykuY2xpY2soKTsKICAgICAgICAgICAgICAgICQoZS50YXJnZXQpLnRleHQoJ+WPkemAgeWujOaIkO+8jOWPkemAgee7k+aenOingeS4iuaWueaMiemSru+8gScpLmFuaW1hdGUoe29wYWNpdHk6ICcwLjUnfSwgInNsb3ciKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignY2xpY2snLCAnLmxpc3RlbmVyLW9wZW4tc2V0dGluZycsICgpID0+IHsKICAgICAgICAgICAgICAgIGJhc2Uuc2hvd1NldHRpbmcoKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvYy5vbignY2xpY2snLCAnLmxpc3RlbmVyLXJwYy10YXNrJywgKCkgPT4gewogICAgICAgICAgICAgICAgbGV0IHJwYyA9IEpTT04uc3RyaW5naWZ5KHsKICAgICAgICAgICAgICAgICAgICBkb21haW46IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX2RvbWFpbicpLAogICAgICAgICAgICAgICAgICAgIHBvcnQ6IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX3BvcnQnKSwKICAgICAgICAgICAgICAgIH0pLCB1cmwgPSBgJHtwYW4uZH0vP3JwYz0ke2Jhc2UuZShycGMpfSMke2Jhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX3Rva2VuJyl9YDsKICAgICAgICAgICAgICAgIEdNX29wZW5JblRhYih1cmwsIHthY3RpdmU6IHRydWV9KTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5hZGRFdmVudExpc3RlbmVyKCdtb3VzZXVwJywgKGUpID0+IHsKICAgICAgICAgICAgICAgIGlmIChlLnRhcmdldC5ub2RlTmFtZSA9PT0g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29sV3JhcC5wcmVwZW5kKCRidXR0b24pOwogICAgICAgICAgICAkYnV0dG9uLmNsaWNrKCgpID0+IGJhc2UuaW5pdERpYWxvZygpKTsKICAgICAgICB9LAogCiAgICAgICAgYXN5bmMgZ2V0UENTTGluaygpIHsKICAgICAgICAgICAgc2VsZWN0TGlzdCA9IHRoaXMuZ2V0U2VsZWN0ZWRMaXN0KCk7CiAgICAgICAgICAgIGxldCBmaWRMaXN0ID0gdGhpcy5fZ2V0RmlkTGlzdCgpLCB1cmwsIHJlczsKIAogICAgICAgICAgICBpZiAocHQgPT09ICdob21lJyB8fCBwdCA9PT0gJ21haW4nKSB7CiAgICAgICAgICAgICAgICBpZiAoc2VsZWN0TGlzdC5sZW5ndGggPT09IDApIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWVzc2FnZS5lcnJvcign5o+Q56S677ya6K+35YWI5Yu+6YCJ6KaB5LiL6L2955qE5paH5Lu277yBJyk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAoZmlkTGlzdC5sZW5ndGggPT09IDIpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWVzc2FnZS5lcnJvcign5o+Q56S677ya6K+35omT5byA5paH5Lu25aS55ZCO5Yu+6YCJ5paH5Lu277yBJyk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBmaWRMaXN0ID0gZW5jb2RlVVJJQ29tcG9uZW50KGZpZExpc3QpOwogICAgICAgICAgICAgICAgdXJsID0gYCR7cGFuLnBjc1swXX0mZnNpZHM9JHtmaWRMaXN0fWA7CiAgICAgICAgICAgICAgICByZXMgPSBhd2FpdCBiYXNlLmdldCh1cmwsIHsiVXNlci1BZ2VudCI6IHBhbi51YX0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChwdCA9PT0gJ3NoYXJlJykgewogICAgICAgICAgICAgICAgdGhpcy5nZXRTaGFyZURhdGEoKTsKICAgICAgICAgICAgICAgIGlmIChzZWxlY3RMaXN0Lmxlbmd0aCA9PT0gMCkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBtZXNzYWdlLmVycm9yKCfmj5DnpLrvvJror7flhYjli77pgInopoHkuIvovb3nmoTmlofku7bvvIEnKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmIChmaWRMaXN0Lmxlbmd0aCA9PT0gMikgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBtZXNzYWdlLmVycm9yKCfmj5DnpLrvvJror7fmiZPlvIDmlofku7blpLnlkI7li77pgInmlofku7bvvIEnKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmICghcGFyYW1zLnNpZ24pIHsKICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gYCR7cGFuLnBjc1syXX0mc3VybD0ke3BhcmFtcy5zdXJsfSZsb2dpZD0ke3BhcmFtcy5sb2dpZH1gOwogICAgICAgICAgICAgICAgICAgIGxldCByID0gYXdhaXQgYmFzZS5nZXQodXJsKTsKICAgICAgICAgICAgICAgICAgICBpZiAoci5lcnJubyA9PT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuc2lnbiA9IHIuZGF0YS5zaWduOwogICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMudGltZXN0YW1wID0gci5kYXRhLnRpbWVzdGFtcDsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGlhbG9nID0gYXdhaXQgU3dhbC5maXJlKHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0OiB0cnVlLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWNvbjogJ2luZm8nLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGDmj5DnpLrvvJror7flsIbmlofku7Y8c3BhbiBjbGFzcz0idGFnLWRhbmdlciI+W+S/neWtmOWIsOe9keebmF08L3NwYW4+8J+RieWJjeW+gDxzcGFuIGNsYXNzPSJ0YWctZGFuZ2VyIj5b5oiR55qE572R55uYXTwvc3Bhbj7kuK3kuIvovb3vvIFgLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvd0NvbmZpcm1CdXR0b246IHRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maXJtQnV0dG9uVGV4dDogJ+eCueWHu+S/neWtmCcsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogJ3RvcCcsCiAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlhbG9nLmlzQ29uZmlybWVkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkKCcudG9vbHMtc2hhcmUtc2F2ZS1oYicpWzBdLmNsaWNrKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmICghcGFyYW1zLmJkc3Rva2VuKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1lc3NhZ2UuZXJyb3IoJ+aPkOekuu+8muivt+WFiOeZu+W9lee9keebmO+8gScpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgbGV0IGZvcm1EYXRhID0gbmV3IEZvcm1EYXRhKCk7CiAgICAgICAgICAgICAgICBmb3JtRGF0YS5hcHBlbmQoJ2VuY3J5cHQnLCBwYXJhbXMuZW5jcnlwdCk7CiAgICAgICAgICAgICAgICBmb3JtRGF0YS5hcHBlbmQoJ3Byb2R1Y3QnLCBwYXJhbXMucHJvZHVjdCk7CiAgICAgICAgICAgICAgICBmb3JtRGF0YS5hcHBlbmQoJ3VrJywgcGFyYW1zLnVrKTsKICAgICAgICAgICAgICAgIGZvcm1EYXRhLmFwcGVuZCgncHJpbWFyeWlkJywgcGFyYW1zLnByaW1hcnlpZCk7CiAgICAgICAgICAgICAgICBmb3JtRGF0YS5hcHBlbmQoJ2ZpZF9saXN0JywgZmlkTGlzdCk7CiAgICAgICAgICAgICAgICBmb3JtRGF0YS5hcHBlbmQoJ2xvZ2lkJywgcGFyYW1zLmxvZ2lkKTsKICAgICAgICAgICAgICAgIHBhcmFtcy5zaGFyZVR5cGUgPT09ICdzZWNyZXQnID8gZm9ybURhdGEuYXBwZW5kKCdleHRyYScsIHBhcmFtcy5leHRyYSkgOiAnJzsKICAgICAgICAgICAgICAgIHVybCA9IGAke3Bhbi5wY3NbMV19JnNpZ249JHtwYXJhbXMuc2lnbn0mdGltZXN0YW1wPSR7cGFyYW1zLnRpbWVzdGFtcH1gOwogICAgICAgICAgICAgICAgcmVzID0gYXdhaXQgYmFzZS5wb3N0KHVybCwgZm9ybURhdGEsIHsiVXNlci1BZ2VudCI6IHBhbi51YX0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChyZXMuZXJybm8gPT09IDApIHsKICAgICAgICAgICAgICAgIGxldCBodG1sID0gdGhpcy5nZW5lcmF0ZURvbShyZXMubGlzdCk7CiAgICAgICAgICAgICAgICB0aGlzLnNob3dNYWluRGlhbG9nKHBhblttb2RlXVswXSwgaHRtbCwgcGFuW21vZGVdWzFdKTsKICAgICAgICAgICAgfSBlbHNlIGlmIChyZXMuZXJybm8gPT09IDExMikgewogICAgICAgICAgICAgICAgcmV0dXJuIG1lc3NhZ2UuZXJyb3IoJ+aPkOekuu+8mumhtemdoui/h+acn++8jOivt+WIt+aWsOmHjeivle+8gScpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgbWVzc2FnZS5lcnJvcign5o+Q56S677ya6I635Y+W5LiL6L296ZO+5o6l5aSx6LSl77yB6K+35Yi35paw572R6aG15ZCO6YeN6K+V77yBJyk7CiAgICAgICAgICAgIH0KICAgICAgICB9LAogCiAgICAgICAgZ2VuZXJhdGVEb20obGlzdCkgewogICAgICAgICAgICBsZXQgY29udGVudCA9ICc8ZGl2IGNsYXNzPSJwbC1tYWluIj4nOwogICAgICAgICAgICBsZXQgYWxpbmtBbGxUZXh0ID0gJyc7CiAgICAgICAgICAgIGJhc2Uuc29ydEJ5TmFtZShsaXN0KTsKICAgICAgICAgICAgbGlzdC5mb3JFYWNoKCh2LCBpKSA9PiB7CiAgICAgICAgICAgICAgICBpZiAodi5pc2RpciA9PT0gMSkgcmV0dXJuOwogICAgICAgICAgICAgICAgbGV0IGZpbGVuYW1lID0gdi5zZXJ2ZXJfZmlsZW5hbWUgfHwgdi5maWxlbmFtZTsKICAgICAgICAgICAgICAgIGxldCBleHQgPSBiYXNlLmdldEV4dGVuc2lvbihmaWxlbmFtZSk7CiAgICAgICAgICAgICAgICBsZXQgc2l6ZSA9IGJhc2Uuc2l6ZUZvcm1hdCh2LnNpemUpOwogICAgICAgICAgICAgICAgbGV0IGRsaW5rID0gdi5kbGluazsKICAgICAgICAgICAgICAgIGlmIChtb2RlID09PSAnYXBpJykgewogICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgKz0gYDxkaXYgY2xhc3M9InBsLWl0ZW0iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InBsLWl0ZW0tbmFtZSBsaXN0ZW5lci10aXAiIGRhdGEtc2l6ZT0iJHtzaXplfSI+JHtmaWxlbmFtZX08L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YSBjbGFzcz0icGwtaXRlbS1saW5rIHBsLWEgbGlzdGVuZXItbGluay1hcGkiIGhyZWY9IiR7ZGxpbmt9IiBkYXRhLWZpbGVuYW1lPSIke2ZpbGVuYW1lfSIgZGF0YS1saW5rPSIke2RsaW5rfSIgZGF0YS1pbmRleD0iJHtpfSI+JHtkbGlua308L2E+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0icGwtaXRlbS10aXAiIHN0eWxlPSJkaXNwbGF5OiBub25lIj48c3Bhbj7oi6XmsqHmnInlvLnlh7pJRE3kuIvovb3moYbvvIzmib7liLBJRE0gPGI+6YCJ6aG5PC9iPiAtPiA8Yj7mlofku7bnsbvlnos8L2I+IC0+IDxiPuesrOS4gOS4quahhjwvYj4g5Lit5re75Yqg5ZCO57yAIDxzcGFuIGNsYXNzPSJwbC1leHQiPiR7ZXh0fTwvc3Bhbj7vvIw8YSBocmVmPSIke3Bhbi5pZG19IiB0YXJnZXQ9Il9ibGFuayIgY2xhc3M9InBsLWEiPuivpuingeatpOWkhDwvYT48L3NwYW4+IDxzcGFuIGNsYXNzPSJwbC1iYWNrIGxpc3RlbmVyLWJhY2siPui/lOWbnjwvc3Bhbj48L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJwbC1pdGVtLXByb2dyZXNzIiBzdHlsZT0iZGlzcGxheTogbm9uZSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InBsLXByb2dyZXNzIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InBsLXByb2dyZXNzLW91dGVyIj48L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InBsLXByb2dyZXNzLWlubmVyIiBzdHlsZT0id2lkdGg6NSUiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJwbC1wcm9ncmVzcy1pbm5lci10ZXh0Ij4wJTwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz0icGwtcHJvZ3Jlc3Mtc3RvcCBsaXN0ZW5lci1zdG9wIj7lj5bmtojkuIvovb08L3NwYW4+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPSJwbC1wcm9ncmVzcy10aXAiPuacquWPkeeOsElETe+8jOS9v+eUqOiHquW4pua1j+iniOWZqOS4i+i9vTwvc3Bhbj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9InBsLXByb2dyZXNzLWhvdyBsaXN0ZW5lci1ob3ciPuWmguS9leWUpOi1t0lETe+8nzwvc3Bhbj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj48L2Rpdj5gOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKG1vZGUgPT09ICdhcmlhJykgewogICAgICAgICAgICAgICAgICAgIGxldCBhbGluayA9IHRoaXMuY29udmVydExpbmtUb0FyaWEoZGxpbmssIGZpbGVuYW1lLCBwYW4udWEpOwogICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgKGFsaW5rKSA9PT0gJ29iamVjdCcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCArPSBgPGRpdiBjbGFzcz0icGwtaXRlbSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0icGwtaXRlbS1uYW1lIGxpc3RlbmVyLXRpcCIgZGF0YS1zaXplPSIke3NpemV9Ij4ke2ZpbGVuYW1lfTwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxhIGNsYXNzPSJwbC1pdGVtLWxpbmsgcGwtYSIgdGFyZ2V0PSJfYmxhbmsiIGhyZWY9IiR7YWxpbmsubGlua30iIHRpdGxlPSLngrnlh7vlpI3liLZhcmlhMmPpk77mjqUiIGRhdGEtZmlsZW5hbWU9IiR7ZmlsZW5hbWV9IiBkYXRhLWxpbms9IiR7YWxpbmsubGlua30iPiR7ZGVjb2RlVVJJQ29tcG9uZW50KGFsaW5rLnRleHQpfTwvYT4gPC9kaXY+YDsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBhbGlua0FsbFRleHQgKz0gYWxpbmsgKyAnXHJcbic7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgKz0gYDxkaXYgY2xhc3M9InBsLWl0ZW0iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InBsLWl0ZW0tbmFtZSBsaXN0ZW5lci10aXAiIGRhdGEtc2l6ZT0iJHtzaXplfSI+JHtmaWxlbmFtZX08L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YSBjbGFzcz0icGwtaXRlbS1saW5rIHBsLWEgbGlzdGVuZXItbGluay1hcmlhIiBocmVmPSIke2FsaW5rfSIgdGl0bGU9IueCueWHu+WkjeWItmFyaWEyY+mTvuaOpSIgZGF0YS1maWxlbmFtZT0iJHtmaWxlbmFtZX0iIGRhdGEtbGluaz0iJHthbGlua30iPiR7ZGVjb2RlVVJJQ29tcG9uZW50KGFsaW5rKX08L2E+IDwvZGl2PmA7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKG1vZGUgPT09ICdycGMnKSB7CiAgICAgICAgICAgICAgICAgICAgY29udGVudCArPSBgPGRpdiBjbGFzcz0icGwtaXRlbSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0icGwtaXRlbS1uYW1lIGxpc3RlbmVyLXRpcCIgZGF0YS1zaXplPSIke3NpemV9Ij4ke2ZpbGVuYW1lfTwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9InBsLWl0ZW0tbGluayBsaXN0ZW5lci1saW5rLXJwYyBwbC1idG4tcHJpbWFyeSBwbC1idG4taW5mbyIgZGF0YS1maWxlbmFtZT0iJHtmaWxlbmFtZX0iIGRhdGEtbGluaz0iJHtkbGlua30iPjxlbSBjbGFzcz0iaWNvbiBpY29uLWRldmljZSI+PC9lbT48c3BhbiBzdHlsZT0ibWFyZ2luLWxlZnQ6IDVweDsiPuaOqOmAgeWIsCBSUEMg5LiL6L295ZmoPC9zcGFuPjwvYnV0dG9uPjwvZGl2PmA7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAobW9kZSA9PT0gJ2N1cmwnKSB7CiAgICAgICAgICAgICAgICAgICAgbGV0IGFsaW5rID0gdGhpcy5jb252ZXJ0TGlua1RvQ3VybChkbGluaywgZmlsZW5hbWUsIHBhbi51YSk7CiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiAoYWxpbmspID09PSAnb2JqZWN0JykgewogICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50ICs9IGA8ZGl2IGNsYXNzPSJwbC1pdGVtIj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJwbC1pdGVtLW5hbWUgbGlzdGVuZXItdGlwIiBkYXRhLXNpemU9IiR7c2l6ZX0iPiR7ZmlsZW5hbWV9PC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGEgY2xhc3M9InBsLWl0ZW0tbGluayBwbC1hIiB0YXJnZXQ9Il9ibGFuayIgaHJlZj0iJHthbGluay5saW5rfSIgdGl0bGU9IueCueWHu+WkjeWItmN1cmzpk77mjqUiIGRhdGEtZmlsZW5hbWU9IiR7ZmlsZW5hbWV9IiBkYXRhLWxpbms9IiR7YWxpbmsubGlua30iPiR7ZGVjb2RlVVJJQ29tcG9uZW50KGFsaW5rLnRleHQpfTwvYT4gPC9kaXY+YDsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBhbGlua0FsbFRleHQgKz0gYWxpbmsgKyAnXHJcbic7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQgKz0gYDxkaXYgY2xhc3M9InBsLWl0ZW0iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InBsLWl0ZW0tbmFtZSBsaXN0ZW5lci10aXAiIGRhdGEtc2l6ZT0iJHtzaXplfSI+JHtmaWxlbmFtZX08L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YSBjbGFzcz0icGwtaXRlbS1saW5rIHBsLWEgbGlzdGVuZXItbGluay1hcmlhIiBocmVmPSIke2FsaW5rfSIgdGl0bGU9IueCueWHu+WkjeWItmN1cmzpk77mjqUiIGRhdGEtZmlsZW5hbWU9IiR7ZmlsZW5hbWV9IiBkYXRhLWxpbms9IiR7YWxpbmt9Ij4ke2RlY29kZVVSSUNvbXBvbmVudChhbGluayl9PC9hPiA8L2Rpdj5gOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmIChtb2RlID09PSAnYmMnKSB7CiAgICAgICAgICAgICAgICAgICAgbGV0IGFsaW5rID0gdGhpcy5jb252ZXJ0TGlua1RvQkMoZGxpbmssIGZpbGVuYW1lLCBwYW4udWEpOwogICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgKGFsaW5rKSA9PT0gJ29iamVjdCcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCArPSBgPGRpdiBjbGFzcz0icGwtaXRlbSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0icGwtaXRlbS1uYW1lIGxpc3RlbmVyLXRpcCIgZGF0YS1zaXplPSIke3NpemV9Ij4ke2ZpbGVuYW1lfTwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxhIGNsYXNzPSJwbC1pdGVtLWxpbmsgcGwtYSIgaHJlZj0iJHtkZWNvZGVVUklDb21wb25lbnQoYWxpbmsubGluayl9IiB0aXRsZT0i54K55Ye755So5q+U54m55b2X5pif5LiL6L29IiBkYXRhLWZpbGVuYW1lPSIke2ZpbGVuYW1lfSIgZGF0YS1saW5rPSIke2FsaW5rfSI+JHtkZWNvZGVVUklDb21wb25lbnQoYWxpbmsudGV4dCl9PC9hPiA8L2Rpdj5gOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGFsaW5rQWxsVGV4dCArPSBhbGluayArICdcclxuJzsKICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCArPSBgPGRpdiBjbGFzcz0icGwtaXRlbSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0icGwtaXRlbS1uYW1lIGxpc3RlbmVyLXRpcCIgZGF0YS1zaXplPSIke3NpemV9Ij4ke2ZpbGVuYW1lfTwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxhIGNsYXNzPSJwbC1pdGVtLWxpbmsgcGwtYSIgaHJlZj0iJHtkZWNvZGVVUklDb21wb25lbnQoYWxpbmspfSIgdGl0bGU9IueCueWHu+eUqOavlOeJueW9l+aYn+S4i+i9vSIgZGF0YS1maWxlbmFtZT0iJHtmaWxlbmFtZX0iIGRhdGEtbGluaz0iJHthbGlua30iPiR7ZGVjb2RlVVJJQ29tcG9uZW50KGFsaW5rKX08L2E+IDwvZGl2PmA7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICAgICAgY29udGVudCArPSAnPC9kaXY+JzsKICAgICAgICAgICAgaWYgKG1vZGUgPT09ICdhcmlhJykKICAgICAgICAgICAgICAgIGNvbnRlbnQgKz0gYDxkaXYgY2xhc3M9InBsLWV4dHJhIj48YnV0dG9uIGNsYXNzPSJwbC1idG4tcHJpbWFyeSBsaXN0ZW5lci1jb3B5LWFsbCIgZGF0YS1saW5rPSIke2FsaW5rQWxsVGV4dH0iPuWkjeWItuWFqOmDqOmTvuaOpTwvYnV0dG9uPjwvZGl2PmA7CiAgICAgICAgICAgIGlmIChtb2RlID09PSAncnBjJykgewogICAg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wZW4tc2V0dGluZyIgc3R5bGU9Im1hcmdpbi1sZWZ0OiAxMHB4OyI+6K6+572u57uI56uv57G75Z6L77yI5b2T5YmN5Li677yaJHt0ZXJtaW5hbFR5cGVbYmFzZS5nZXRWYWx1ZSgnc2V0dGluZ190ZXJtaW5hbF90eXBlJyldfe+8iTwvYnV0dG9uPjwvZGl2PmA7CiAgICAgICAgICAgIHJldHVybiBjb250ZW50OwogICAgICAgIH0sCiAKICAgICAgICBhc3luYyBzZW5kTGlua1RvUlBDKGZpbGVuYW1lLCBsaW5rKSB7CiAgICAgICAgICAgIGxldCBycGMgPSB7CiAgICAgICAgICAgICAgICBkb21haW46IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX2RvbWFpbicpLAogICAgICAgICAgICAgICAgcG9ydDogYmFzZS5nZXRWYWx1ZSgnc2V0dGluZ19ycGNfcG9ydCcpLAogICAgICAgICAgICAgICAgcGF0aDogYmFzZS5nZXRWYWx1ZSgnc2V0dGluZ19ycGNfcGF0aCcpLAogICAgICAgICAgICAgICAgdG9rZW46IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX3Rva2VuJyksCiAgICAgICAgICAgICAgICBkaXI6IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfcnBjX2RpcicpLAogICAgICAgICAgICB9OwogICAgICAgICAgICBsZXQgQkRVU1MgPSB0aGlzLmdldEJEVVNTKCk7CiAgICAgICAgICAgIGlmICghQkRVU1MpIHJldHVybiAnYXNzaXN0YW50JzsKIAogICAgICAgICAgICBsZXQgdXJsID0gYCR7cnBjLmRvbWFpbn06JHtycGMucG9ydH0ke3JwYy5wYXRofWA7CiAgICAgICAgICAgIGxldCBycGNEYXRhID0gewogICAgICAgICAgICAgICAgaWQ6IG5ldyBEYXRlKCkuZ2V0VGltZSgpLAogICAgICAgICAgICAgICAganNvbnJwYzogJzIuMCcsCiAgICAgICAgICAgICAgICBtZXRob2Q6ICdhcmlhMi5hZGRVcmknLAogICAgICAgICAgICAgICAgcGFyYW1zOiBbYHRva2VuOiR7cnBjLnRva2VufWAsIFtsaW5rXSwgewogICAgICAgICAgICAgICAgICAgIGRpcjogcnBjLmRpciwKICAgICAgICAgICAgICAgICAgICBvdXQ6IGZpbGVuYW1lLAogICAgICAgICAgICAgICAgICAgIGhlYWRlcjogW2BVc2VyLUFnZW50OiAke3Bhbi51YX1gLCBgQ29va2llOiBCRFVTUz0ke0JEVVNTfWBdCiAgICAgICAgICAgICAgICB9XQogICAgICAgICAgICB9OwogICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgbGV0IHJlcyA9IGF3YWl0IGJhc2UucG9zdCh1cmwsIHJwY0RhdGEsIHsiVXNlci1BZ2VudCI6IHBhbi51YX0sICcnKTsKICAgICAgICAgICAgICAgIGlmIChyZXMucmVzdWx0KSByZXR1cm4gJ3N1Y2Nlc3MnOwogICAgICAgICAgICAgICAgcmV0dXJuICdmYWlsJzsKICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgcmV0dXJuICdmYWlsJzsKICAgICAgICAgICAgfQogICAgICAgIH0sCiAKICAgICAgICBnZXRTZWxlY3RlZExpc3QoKSB7CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICByZXR1cm4gcmVxdWlyZSgnc3lzdGVtLWNvcmU6Y29udGV4dC9jb250ZXh0LmpzJykuaW5zdGFuY2VGb3JTeXN0ZW0ubGlzdC5nZXRTZWxlY3RlZCgpOwogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLndwLXMtY29yZS1wYW4nKS5fX3Z1ZV9fLnNlbGVjdGVkTGlzdDsKICAgICAgICAgICAgfQogICAgICAgIH0sCiAKICAgICAgICBnZXRMb2dpZCgpIHsKICAgICAgICAgICAgbGV0IHV0ID0gcmVxdWlyZSgic3lzdGVtLWNvcmU6Y29udGV4dC9jb250ZXh0Lmp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ICAgICAgICAgbGV0IHBhdGggPSBsb2NhdGlvbi5wYXRobmFtZTsKICAgICAgICAgICAgaWYgKC9eXC9kaXNrXC9ob21lLy50ZXN0KHBhdGgpKSByZXR1cm4gJ2hvbWUnOwogICAgICAgICAgICBpZiAoL15cL2Rpc2tcL21haW4vLnRlc3QocGF0aCkpIHJldHVybiAnbWFpbic7CiAgICAgICAgICAgIGlmICgvXlwvKHN8c2hhcmUpXC8vLnRlc3QocGF0aCkpIHJldHVybiAnc2hhcmUnOwogICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9LAogCiAgICAgICAgc2hvd01haW5EaWFsb2codGl0bGUsIGh0bWwsIGZvb3RlcikgewogICAgICAgICAgICBTd2FsLmZpcmUoewogICAgICAgICAgICAgICAgdGl0bGUsCiAgICAgICAgICAgICAgICBodG1sLAogICAgICAgICAgICAgICAgZm9vdGVyLAogICAgICAgICAgICAgICAgYWxsb3dPdXRzaWRlQ2xpY2s6IGZhbHNlLAogICAgICAgICAgICAgICAgc2hvd0Nsb3NlQnV0dG9uOiB0cnVlLAogICAgICAgICAgICAgICAgc2hvd0NvbmZpcm1CdXR0b246IGZhbHNlLAogICAgICAgICAgICAgICAgcG9zaXRpb246ICd0b3AnLAogICAgICAgICAgICAgICAgd2lkdGgsCiAgICAgICAgICAgICAgICBwYWRkaW5nOiAnMTVweCAyMHB4IDVweCcsCiAgICAgICAgICAgICAgICBjdXN0b21DbGFzcywKICAgICAgICAgICAgfSkudGhlbigoKSA9PiB7CiAgICAgICAgICAgICAgICB0aGlzLl9yZXNldERhdGEoKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfSwKIAogICAgICAgIGFzeW5jIGluaXRQYW5MaW5rZXIoKSB7CiAgICAgICAgICAgIGJhc2UuaW5pdERlZmF1bHRDb25maWcoKTsKICAgICAgICAgICAgYmFzZS5hZGRQYW5MaW5rZXJTdHlsZSgpOwogICAgICAgICAgICBwdCA9IHRoaXMuZGV0ZWN0UGFnZSgpOwogICAgICAgICAgICBsZXQgcmVzID0gYXdhaXQgYmFzZS5wb3N0CiAgICAgICAgICAgIChgaHR0cHM6Ly9hcGkueW91eGlhb2hvdS5jb20vY29uZmlnP3Zlcj0ke3ZlcnNpb259JmE9JHthdXRob3J9YCwge30sIHt9LCAndGV4dCcpOwogICAgICAgICAgICBwYW4gPSBKU09OLnBhcnNlKGJhc2UuZChyZXMpKTsKICAgICAgICAgICAgT2JqZWN0LmZyZWV6ZSAmJiBPYmplY3QuZnJlZXplKHBhbik7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKHBhbik7CiAgICAgICAgICAgIHBhbi5udW0gPT09IGJhc2UuZ2V0VmFsdWUoJ3NldHRpbmdfaW5pdF9jb2RlJykgPyB0aGlzLmFkZEJ1dHRvbigpIDogdGhpcy5hZGRJbml0QnV0dG9uKCk7CiAgICAgICAgICAgIGJhc2UuY3JlYXRlVGlwKCk7CiAgICAgICAgICAgIGJhc2UucmVnaXN0ZXJNZW51Q29tbWFuZCgpOwogICAgICAgIH0KICAgIH07CiAKICAgIGxldCBtYWluID0gewogICAgICAgIGluaXQoKSB7CiAgICAgICAgICAgIGlmICgvKHBhbnx5dW4pLmJhaWR1LmNvbS8udGVzdChsb2NhdGlvbi5ob3N0KSkgewogICAgICAgICAgICAgICAgYmFpZHUuaW5pdFBhbkxpbmtlcigpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfTsKIAogICAgbWFpbi5pbml0KCk7CiAgICB9CiAgICB9Cn0pKCk7
Add Comment
Please, Sign In to add comment