Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_海角社区@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICDmtbfop5LnpL7ljLoKLy8gQG5hbWVzcGFjZSAgICBodHRwOi8vdGFtcGVybW9ua2V5Lm5ldC8KLy8gQHZlcnNpb24gICAgICA4LjExCi8vIEBkZXNjcmlwdGlvbiAg55uu5YmN5Y+v5Lul55So77yM5Y+v5Lul5p+l55yL6YeR5biB6ZK755+z6KeG6aKRLOmcgOimgeaJi+WKqOazqOWGjOeZu+W9lQovLyBAYXV0aG9yICAgICAgIHhpZ3VhMDAxMgovLyBAbGljZW5zZSAgICAgIE1JVAovLyBAbWF0Y2ggICAgICAgaHR0cHM6Ly90b29scy50aGF0d2luZC5jb20vdG9vbCoKLy8gQG1hdGNoICAgICAgICBodHRwczovLyovcG9zdC9kZXRhaWxzKgovLyBAaWNvbiAgICAgICAgIGh0dHBzOi8vaGpiYzMwLnRvcC9pbWFnZXMvY29tbW9uL3Byb2plY3QvZmF2aWNvbi5pY28KLy8gQHJ1bi1hdCAgICAgIGRvY3VtZW50LXN0YXJ0Ci8vIEBncmFudCAgICAgICB1bnNhZmVXaW5kb3cKLy8gQGdyYW50ICAgICAgICBHTV9kb3dubG9hZAovLyBAZ3JhbnQgICAgICAgIEdNX29wZW5JblRhYgovLyBAZ3JhbnQgICAgICAgIEdNX3htbGh0dHBSZXF1ZXN0Ci8vIEBncmFudCAgICAgICAgR01feG1saHR0cFJlcXVlc3QKLy8gQGNvbm5lY3QgICAgICAqCi8vIEByZXF1aXJlICAgICAgaHR0cHM6Ly9jZG4uc3RhdGljZmlsZS5vcmcvanF1ZXJ5LzEuMTAuMi9qcXVlcnkubWluLmpzCi8vIEBkb3dubG9hZFVSTCBub25lCi8vID09L1VzZXJTY3JpcHQ9PQoKCmZ1bmN0aW9uIHB3ZCgpIHsKICAgIGxldCB3b3JkID0gJycKICAgIGxldCBhID0gJzQ4LzQ2LzExNi8xMTUnCiAgICBsZXQgYiA9IGEuc3BsaXQoJy8nKQogICAgZm9yIChsZXQgYyBpbiBiKSB7CiAgICAgICAgbGV0IGQgPSBwYXJzZUludChiW2NdKQogICAgICAgIGxldCBlID0gU3RyaW5nLmZyb21DaGFyQ29kZShkKQogICAgICAgIHdvcmQgPSB3b3JkICsgZQogICAgfQogICAgcmV0dXJuIHdvcmQKfQoKZnVuY3Rpb24gY2xlYXJDb250YWluZXIoY29udGFpbmVyKSB7CiAgICBpZiAoY29udGFpbmVyLmhhc0NoaWxkTm9kZXMoKSkgewogICAgICAgIGNvbnRhaW5lci5pbm5lckhUTUwgPSAiIjsKICAgICAgICBjb250YWluZXIuc3R5bGUuYm9yZGVyID0gIiI7CiAgICB9Cn0KZnVuY3Rpb24gZ2V0Q29udGFpbmVyKCkgewogICAgY29uc3QgZXhpc3RDb250YWluZXIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIuYmlnLWltZy1jb250YWluZXItYyIpOwogICAgaWYgKCFleGlzdENvbnRhaW5lcikgewogICAgICAgIGNvbnN0IGNvbnRhaW5lciA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpOwogICAgICAgIGNvbnRhaW5lci5jbGFzc05hbWUgPSAiYmlnLWltZy1jb250YWluZXItYyI7CiAgICAgICAgY29udGFpbmVyLnN0eWxlLnBvc2l0aW9uID0gImZpeGVkIjsKICAgICAgICBjb250YWluZXIuc3R5bGUudG9wID0gMDsKICAgICAgICBjb250YWluZXIuc3R5bGUubGVmdCA9IDA7CiAgICAgICAgY29udGFpbmVyLnN0eWxlLnpJbmRleCA9IDk5OTk5OTsKICAgICAgICBjb250YWluZXIub25jbGljayA9IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgY2xlYXJDb250YWluZXIoY29udGFpbmVyKTsKICAgICAgICB9OwogICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoImh0bWw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2dyb3VuZDogI0ZGNjY2Njtjb2xvcjojZmZmZmZmO292ZXJmbG93OiBoaWRkZW47ei1pbmRleDogOTk5OTtwb3NpdGlvbjogZml4ZWQ7cGFkZGluZzo1cHg7dGV4dC1hbGlnbjpjZW50ZXI7Jz7lh4blpIfkuK08L2Rpdj4iKTsKICAgIH0KCiAgICB2YXIganhzcG15RGl2ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImp4c3BteURpdiIpOyAvLyDojrflj5bliLBpZOS4uiJteURpdiLnmoRkaXblhYPntKAKICAgIGp4c3BteURpdi5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsIGZ1bmN0aW9uIChlKSB7CiAgICAgICAgaWYgKGZhc29uZ3RleHQuaW5kZXhPZigiSVY9IikgPT09IC0xIHx8IGZhc29uZ3RleHQuaW5kZXhPZigi5YyF5ZCrIikgPT09IC0xfHwgZmFzb25ndGV4dC5pbmRleE9mKCJbLS3np5JdIikgPiAtMSkgewogICAgICAgICAgICBqeHNwbXlEaXYuaW5uZXJIVE1MID0gIuino+aekOWksei0pSIKICAgICAgICAgICAgYWxlcnQoIuino+aekOWksei0pe+8jOivt+WIt+aWsOmHjeivlSIpCiAgICAgICAgICAgIHJldHVybgogICAgICAgIH0KICAgICAgICBqeHNwbXlEaXYuaW5uZXJIVE1MID0gIuino+aekOS4rSIKICAgICAgICBmYXNvbmcoZmFzb25ndGV4dCkKCiAgICB9KTsKCgogICAgdmFyIGp4bXlEaXYgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgianhteURpdiIpOyAvLyDojrflj5bliLBpZOS4uiJteURpdiLnmoRkaXblhYPntKAKICAgIGp4bXlEaXYuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCBmdW5jdGlvbiAoZSkgewogICAgICAgIGNvbnN0IHRleHRhcmVhID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgndGV4dGFyZWEnKTsKICAgICAgICB0ZXh0YXJlYS52YWx1ZSA9IGRvd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R01fb3BlbkluVGFiKHVybDMsIHsgYWN0aXZlOiB0cnVlIH0pOwogICAgICAgIGNvbnNvbGUubG9nKHVybDMpOwogICAgICAgIC8vd2luZG93LmxvY2F0aW9uLmhyZWYgPSB1cmw7CiAgICAgICAgLy93aW5kb3cub3Blbih1cmwsICJfYmxhbmsiKTsKCgogICAgfSk7CgoKCgogICAgdmFyIG15RGl2ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoIm15RGl2Iik7IC8vIOiOt+WPluWIsGlk5Li6Im15RGl2IueahGRpduWFg+e0oAogICAgbXlEaXYuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCBmdW5jdGlvbiAoZSkgewogICAgICAgIC8vYWxlcnQoIuS9oOeCueWHu+S6hkRJVu+8gSIpOyAvLyDlvZPngrnlh7vor6VkaXbml7bkvJrop6blj5HmraTlh73mlbDlubbmmL7npLrmj5DnpLrkv6Hmga8KICAgICAgICBjb25zdCBjb250YWluZXIgPSBnZXRDb250YWluZXIoKTsKICAgICAgICBjb25zdCBoYWxmV2lkdGggPSB3aW5kb3cuaW5uZXJXaWR0aCAvIDI7CiAgICAgICAgY29uc3QgaGFsZkhlaWdodCA9IHdpbmRvdy5pbm5lckhlaWdodCAvIDI7CiAgICAgICAgY2xlYXJDb250YWluZXIoY29udGFpbmVyKTsKCgogICAgICAgIGlmIChpc3Bob25lKSB7CiAgICAgICAgICAgIGNvbnN0IGNvbnRhaW5lclggPSBoYWxmV2lkdGggLSAxNjA7CiAgICAgICAgICAgIGNvbnN0IGNvbnRhaW5lclkgPSBoYWxmSGVpZ2h0IC0gMTQwOwogICAgICAgICAgICBjb250YWluZXIuc3R5bGUubGVmdCA9IGAke2NvbnRhaW5lclh9cHhgOwogICAgICAgICAgICBjb250YWluZXIuc3R5bGUudG9wID0gYCR7Y29udGFpbmVyWX1weGA7CiAgICAgICAgICAgIGNvbnRhaW5lci5zdHlsZS5ib3JkZXIgPSAiMXB4IHNvbGlkICMwMDAiOwogICA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ICAgICAgIHJlcXVlc3Qub3BlbignR0VUJywgdXJsLCBmYWxzZSk7CiAgICAgICAgcmVxdWVzdC5zZW5kKG51bGwpOwogICAgICAgIGlmIChyZXF1ZXN0LnN0YXR1cyAhPT0gMjAwKSB7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKGDop6PmnpDlpLHotKUhYCk7CiAgICAgICAgICAgIHJldHVybiB1cmw7CiAgICAgICAgfQogICAgICAgIGxldCB0c19wYXRoID0gcmVxdWVzdC5yZXNwb25zZVRleHQuc3BsaXQoJ1xuJylbNl07CiAgICAgICAgbGV0IGlkID0gdHNfcGF0aC5tYXRjaCgvKFtcd19dK18/KVtcZF0rLnRzLylbMV07CiAgICAgICAgbGV0IHJ1cmwgPSB1cmwucmVwbGFjZSgvKFtcd19dKykubTN1OC8sIGAke2lkfS5tM3U4YCk7CiAgICAgICAgcmV0dXJuIHJ1cmw7CiAgICB9CiAgICBmdW5jdGlvbiBydW5Bc3luYyh1cmwsIHNlbmRfdHlwZSwgZGF0YV9yeSkgewogICAgICAgIGNvbnNvbGUubG9nKCLor7fmsYLlvIDlp4siKTsKICAgICAgICB2YXIgcCA9IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICAgICAgR01feG1saHR0cFJlcXVlc3QoewogICAgICAgICAgICAgICAgbWV0aG9kOiBzZW5kX3R5cGUsCiAgICAgICAgICAgICAgICB1cmw6IHVybCwKICAgICAgICAgICAgICAgIGhlYWRlcnM6IHsKICAgICAgICAgICAgICAgICAgICAiQ29udGVudC1UeXBlIjogImFwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZDtjaGFyc2V0PXV0Zi04IgogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgIGRhdGE6IGRhdGFfcnksCiAgICAgICAgICAgICAgICBvbmxvYWQ6IGZ1bmN0aW9uIChyZXNwb25zZSkgewogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCLor7fmsYLmiJDlip8iKTsKICAgICAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKHJlc3BvbnNlLnJlc3BvbnNlVGV4dCk7CiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXNwb25zZS5yZXNwb25zZVRleHQpOwogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgIG9uZXJyb3I6IGZ1bmN0aW9uIChyZXNwb25zZSkgewogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCLor7fmsYLlpLHotKUiKTsKICAgICAgICAgICAgICAgICAgICBhbGVydCgi6Kej5p6Q5aSx6LSl77yM5qOA5p+l6ISa5pys5piv5ZCm5pyJ5pu05pawIikKICAgICAgICAgICAgICAgICAgICByZWplY3QoIuivt+axguWksei0pSIpOwoKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgfSkKICAgICAgICAvL2NvbnNvbGUubG9nKCJwPSIrcCk7CiAgICAgICAgcmV0dXJuIHA7CiAgICB9CiAgICBmdW5jdGlvbiBnZXRfdXNlcl9kaWN0KGhvc3QsIGlkKSB7CiAgICAgICAgdmFyIHVybCA9IGBodHRwczovLyR7aG9zdH0uY29tL2FwaS90b3BpYy9ub2RlL3RvcGljcz9wYWdlPTEmdXNlcklkPSR7aWR9JnR5cGU9MGA7CiAgICAgICAgdmFyIHJlcXVlc3QgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTsKICAgICAgICByZXF1ZXN0Lm9wZW4oJ0dFVCcsIHVybCwgZmFsc2UpOwogICAgICAgIHJlcXVlc3Quc2VuZChudWxsKTsKICAgICAgICBpZiAocmVxdWVzdC5zdGF0dXMgIT09IDIwMCkgewogICAgICAgICAgICBjb25zb2xlLmxvZyhg55So5oi35L+h5oGv6Kej5p6Q5aSx6LSlIWApOwogICAgICAgICAgICByZXR1cm4ge307CiAgICAgICAgfQogICAgICAgIGxldCBwID0gSlNPTi5wYXJzZShyZXF1ZXN0LnJlc3BvbnNlVGV4dCwgYHV0Zi04YCkuZGF0YTsKICAgICAgICBwID0gSlNPTi5wYXJzZShkZWNvZGUocCksIGB1dGYtOGApOwogICAgICAgIGxldCB0b3RhbCA9IHAucGFnZS50b3RhbDsKICAgICAgICBsZXQgdWlkID0gYFtiYW5uZWRdYDsKICAgICAgICBpZiAoYHJlc3VsdHNgIGluIHApIHsKICAgICAgICAgICAgdWlkID0gcC5yZXN1bHRzWzBdLnVzZXIubmlja25hbWUgKyBgIGAgKyB1aWQ7CiAgICAgICAgfQogICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICdpc0Zhdm9yaXRlJzogZmFsc2UsCiAgICAgICAgICAgICdsaWtlQ291bnQnOiAxMiwKICAgICAgICAgICAgJ3VzZXInOiB7CiAgICAgICAgICAgICAgICAnaWQnOiBwYXJzZUludChpZCksCiAgICAgICAgICAgICAgICAnbmlja25hbWUnOiB1aWQsCiAgICAgICAgICAgICAgICAnYXZhdGFyJzogJzI5JywKICAgICAgICAgICAgICAgICdkZXNjcmlwdGlvbic6IGBoaiBjb21tdW5pdHlgLAogICAgICAgICAgICAgICAgJ3RvcGljQ291bnQnOiB0b3RhbCwKICAgICAgICAgICAgICAgICd2aWRlb0NvdW50JzogMCwKICAgICAgICAgICAgICAgICdjb21tZW50Q291bnQnOiAzMDMsCiAgICAgICAgICAgICAgICAnZmFuc0NvdW50JzogNTcsCiAgICAgICAgICAgICAgICAnZmF2b3JpdGVDb3VudCc6IDM5LAogICAgICAgICAgICAgICAgJ3N0YXR1cyc6IDAsCiAgICAgICAgICAgICAgICAnc2V4JzogMSwKICAgICAgICAgICAgICAgICd2aXAnOiAwLAogICAgICAgICAgICAgICAgJ3ZpcEV4cGlyZXNUaW1lJzogJzAwMDEtMDEtMDEgMDA6MDA6MDAnLAogICAgICAgICAgICAgICAgJ2NlcnRpZmllZCc6IGZhbHNlLAogICAgICAgICAgICAgICAgJ2NlcnRWaWRlbyc6IGZhbHNlLAogICAgICAgICAgICAgICAgJ2NlcnRQcm9mZXNzb3InOiBmYWxzZSwKICAgICAgICAgICAgICAgICdmYW1vdXMnOiBmYWxzZSwKICAgICAgICAgICAgICAgICdmb3JiaWRkZW4nOiBmYWxzZSwKICAgICAgICAgICAgICAgICd0YWdzJzogbnVsbCwKICAgICAgICAgICAgICAgICdyb2xlJzogMCwKICAgICAgICAgICAgICAgICdwb3B1bGFyaXR5JzogMTAsCiAgICAgICAgICAgICAgICAnZGlhbW9uZENvbnN1bWUnOiAwLAogICAgICAgICAgICAgICAgJ3RpdGxlJzogeyAnaWQnOiAwLCAnbmFtZSc6ICcnLCAnY29uc3VtZSc6IDAsICdjb25zdW1lRW5kJzogMCwgJ2ljb24nOiAnJyB9LAogICAgICAgICAgICAgICAgJ2ZyaWVuZFN0YXR1cyc6IGZhbHNlLAogICAgICAgICAgICAgICAgJ3ZvaWNlU3RhdHVzJzogZmFsc2UsCiAgICAgICAgICAgICAgICAndmlkZW9TdGF0dXMnOiBmYWxzZSwKICAgICAgICAgICAgICAgICd2b2ljZU1vbmV5VHlwZSc6IDAsCiAgICAgICAgICAgICAgICAndm9pY2VBbW91bnQnOiAwLAogICAgICAgICAgICAgICAgJ3ZpZGVvTW9uZXlUeXBlJzogMCwKICAgICAgICAgICAgICAgICd2aWRlb0Ftb3VudCc6IDAsCiAgICAgICAgICAgICAgICAnZGVwb3NpdE1vbmV5JzogMAogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIGZ1bmN0aW9uIGRlc3RvcnkoKSB7CiAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSgncHJldmlldy10aXRsZScpWzBdLnJlbW92ZSgpCiAgICB9CgoKCiAgICBmdW5jdGlvbiByZW1vdmVfdmlwKGJvZHkpIHsKICAgICAgICBib2R5Lm5vZGUudmlwTGltaXQgPSAwOwogICAgICAgIGxldCBhdHRhY2htZW50cyA9IGJvZHkuYXR0YWNobWVudHM7CiAgICAgICAgbGV0IGltYWdlX3VybHMgPSBbXTsKICAgICAgICBsZXQgdmlkZW9fdXJscyA9IGBgOwogICAgICAgIGxldCBoYXNfdmlkZW8gPSAtMTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGF0dGFjaG1lbnRzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIHZhciBhdHRhID0gYXR0YWNobWVudHNbaV07CiAgICAgICAgICAgIGlmIChhdHRhLmNhdGVnb3J5ID09PSAnaW1hZ2VzJykgewogICAgICAgICAgICAgICAgaW1hZ2VfdXJscy5wdXNoKGA8aW1nIHNyYz0iJHthdHRhLnJlbW90ZVVybH0iIGRhdGEtaWQ9IiR7YXR0YS5pZH0iLz5gKQogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChhdHRhLmNhdGVnb3J5ID09PSAndmlkZW8nKSB7CiAgICAgICAgICAgICAgICBoYXNfdmlkZW8gPSBpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGxldCBpbWFnZXMgPSBpbWFnZV91cmxzLmpvaW4oKTsKICAgICAgICBpZiAoaGFzX3ZpZGVvID49IDApIHsKICAgICAgICAgICAgbGV0IFtuYm9keSwgdl0gPSByZXBsYWNlX20zdTgoYm9keSwgaGFzX3ZpZGVvKTsKICAgICAgICAgICAgYm9keSA9IG5ib2R5OwogICAgICAgICAgICB2aWRlb191cmxzID0gYDx2aWRlbyBzcmM9IiR7di5yZW1vdGVVcmx9IiBkYXRhLWlkPSIke3YuaWR9Ii8+PC92aWRlbz5gCiAgICAgICAgfQogICAgICAgIGxldCBjb250ZW50ID0gYm9keS5jb250ZW50LnJlcGxhY2UoL1xbW+WbvueJh+inhumikV0rXF0/LywgYGApOwogICAgICAgIGNvbnRlbnQgPSBib2R5LmNvbnRlbnQucmVwbGFjZSgv5q2k5aSE5YaF5a655ZSu5Lu3Lio/5oKo6L+Y5rKh5pyJ6LSt5Lmw77yM6K+36LSt5Lmw5ZCO5p+l55yL77yBLywgYGApOwogICAgICAgIGNvbnRlbnQgPSAnPGh0bWw+PGhlYWQ+PC9oZWFkPjxib2R5PicgKyBjb250ZW50ICsgJzxici8+JyArIGltYWdlcyArICc8YnIvPicgKyB2aWRlb191cmxzICsgJzxici8+PC9ib2R5PjwvaHRtbD4nOwogICAgICAgIGJvZHkuY29udGVudCA9IGNvbnRlbnQ7CiAgICAgICAgcmV0dXJuIGJvZHk7CiAgICB9CiAgICBhc3luYyBmdW5jdGlvbiBwbGF5KHVybCkgewogICAgICAgIGNvbnNvbGUubG9nKCJ1cmw9IiArIHVybCkKICAgICAgICBsZXQgaXNwaG9uZSA9IElzUGhvbmUoKQogICAgICAgIGxldCBwbGF5cG9zID0gJycKICAgICAgICBpZiAoaXNwaG9uZSkgewogICAgICAgICAgICAvL2RvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJy5zZWxsLWJ0bicpLnJlbW92ZSgpCiAgICAgICAgICAgIHBsYXlwb3MgPSAnLnNlbGwtYnRuJwogICAgICAgICAgICBsZXQgdmlkZW9JbmZvID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihwbGF5cG9zKQogICAgICAgICAgICB2aWRlb0luZm8uaW5uZXJIVE1MID0gJzx2aWRlbyBpZD0idmlkZW8iIGNvbnRyb2xzIGF1dG9wbGF5IHdpZHRoPSIxMDAlIj48L3ZpZGVvPicKICAgICAgICAgICAgdmFyIHZpZGVvID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3ZpZGVvJyk7CiAgICAgICAgICAgIHZhciBobHMgPSBuZXcgSGxzKCk7CiAgICAgICAgICAgIC8vIGJpbmQgdGhlbSB0b2dldGhlcgogICAgICAgICAgICBjb25zb2xlLmxvZygiMTEiKTsKICAgICAgICAgICAgaGxzLmF0dGFjaE1lZGlhKHZpZGVvKTsKICAgICAgICAgICAgaGxzLm9uKEhscy5FdmVudHMuTUVESUFfQVRUQUNIRUQsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCJ2aWRlbyBhbmQgaGxzLmpzIGFyZSBub3cgYm91bmQgdG9nZXRoZXIgISIpOwoKICAgICAgICAgICAgICAgIGhscy5sb2FkU291cmNlKHVybCk7CiAgICAgICAgICAgICAgICBobHMub24oSGxzLkV2ZW50cy5NQU5JRkVTVF9QQVJTRUQsIGZ1bmN0aW9uIChldmVudCwgZGF0YSkgewogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCJtYW5pZmVzdCBsb2FkZWQsIGZvdW5kICIgKyBkYXRhLmxldmVscy5sZW5ndGggKyAiIHF1YWxpdHkgbGV2ZWwiKTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBsYXlwb3MgPSAnLnNlbGwtYnRuJwogICAgICAgICAgICB3aW5kb3cuZHAgPSBuZXcgRFBsYXllcih7CiAgICAgICAgICAgICAgICBlbGVtZW50OiBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKHBsYXlwb3MpLAogICAgICAgICAgICAgICAgYXV0b3BsYXk6IGZhbHNlLAogICAgICAgICAgICAgICAgdGhlbWU6ICcjRkFERkEzJywKICAgICAgICAgICAgICAgIGxvb3A6IHRydWUsCiAgICAgICAgICAgICAgICBsYW5nOiAnemgnLAogICAgICAgICAgICAgICAgc2NyZWVuc2hvdDogdHJ1ZSwKICAgICAgICAgICAgICAgIGhvdGtleTogdHJ1ZSwKICAgICAgICAgICAgICAgIHByZWxvYWQ6ICdhdXRvJywKICAgICAgICAgICAgICAgIHZpZGVvOiB7CiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsCiAgICAgICAgICAgICAgICAgICAgdHlwZTogJ2hscycKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSkKICAgICAgICB9CiAgICB9CgoKICAgIAoKICAgIGZ1bmN0aW9uIGhhc0NsYXNzKGVsZW1lbnQsIGNsYXNzTmFtZSkgewogICAgICAgIHJldHVybiBlbGVtZW50LmNsYXNzTGlzdC5jb250YWlucyhjbGFzc05hbWUpOwogICAgfQogICAgYXN5bmMgZnVuY3Rpb24gcmVwbGFjZV9tM3U4KGJvZHksIGhhc192aWRlbykgewogICAgICAgIGp4c3BteURpdi5pbm5lckhUTUwgPSAi5YeG5aSH5LitIgogICAgICAgIGp4bXlEaXYuaW5uZXJIVE1MID0gIiDnrYnlvoXop6PmnpAiCiAgICAgICAgbGV0IGF0dGFjaG1lbnRzID0gYm9keS5hdHRhY2htZW50czsKICAgICAgICBsZXQgdmlkeCA9IGhhc192aWRlbzsKICAgICAgICBpZiAodmlkeCA8IDApIHsKICAgICAgICAgICAgcmV0dXJuIFtib2R5LCB1bmRlZmluZWRdOwogICAgICAgIH0KICAgICAgICBpZiAoYm9keS5zYWxlID09PSBudWxsIHx8IGJvZHkuc2FsZS5tb25leV90eXBlID09IDApIHsKICAgICAgICAgICAgcmV0dXJuIFtib2R5LCBhdHRhY2htZW50c1t2aWR4XV07CiAgICAgICAgfQogICAgICAgIGxldCB1cmwgPSBhdHRhY2htZW50c1t2aWR4XS5yZW1vdGVVcmw7CiAgICAgICAgY29uc29sZS5sb2coInVybCIsIHVybCkKCgogICAgICAgIGxldCByZXMgPSBhd2FpdCBmZXRjaCgiaHR0cHM6Ly9oamJkYzgudG9wIiArIHVybCwgewogICAgICAgICAgICBtZXRob2Q6ICdnZXQnLAogICAgICAgIH0pCiAgICAgICAgbGV0IG0zdThUZXh0ID0gYXdhaXQgcmVzLnRleHQoKQogICAgICAgIHZhciB0ZXh0c2VudCA9IG0zdThUZXh0CiAgICAgICAgbGV0IGlzcGhvbmUgPSBJc1Bob25lKCkKICAgICAgICBpZiAoaXNwaG9uZSkgewogICAgICAgICAgICB2YXIgZGl2ID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSgibm9sb2dpbiIpWzBdOyAvLyDojrflj5bnrKzkuIDkuKrnrKblkIjmnaHku7bnmoTlhYPntKAKICAgICAgICAgICAgY29uc29sZS5sb2coJ2Rpdj0nLCBkaXYpOwogICAgICAgICAgICBpZiAodHlwZW9mIGRpdiA9PT0gJ3VuZGVmaW5lZCcpIHsKICAgICAgICAgICAgICAgIC8vIGRvIHNvbWV0aGluZwoKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGFsZXJ0KCLor7flhYjnmbvlvZUtbSIpCiAgICAgICAgICAgICAgICByZXR1cm4KICAgICAgICAgICAgfQoKICAgICAgICAgICAgdmFyIGkgPSAxOwogICAgICAgICAgICB2YXIgaW50ZXJ2YWxJZCA9IHNldEludGVydmFsKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgIC8vIOiOt+WPlumcgOimgeWIpOaWreeahOWFg+e0oAogICAgICAgICAgICAgICAgbGV0IGluZm9saXN0ID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSgnaHRtbC1ib3ggaXNoaWRlJylbMF0KICAgICAgICAgICAgICAgIGluZm9saXN0LmNsYXNzTmFtZSA9ICdodG1sLWJveCc7CiAgICAgICAgICAgICAgICBsZXQgaW5mb3Bob25lID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSgncHJldmlldy1idG4nKVswXQoKICAgICAgICAgICAgICAgIGlmIChpbmZvcGhvbmUpIHsKCiAgICAgICAgICAgICAgICAgICAgdGV4dHNlbnQgPSBpbmZvcGhvbmUuaW5uZXJUZXh0ICsgIioqKiIgKyB0ZXh0c2VudAogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKHRleHRzZW50KTsKICAgICAgICAgICAgICAgICAgICBpZiAodGV4dHNlbnQuaW5kZXhPZigiSVY9IikgPT09IC0xIHx8IHRleHRzZW50LmluZGV4T2YoIuWMheWQqyIpID09PSAtMXx8IHRleHRzZW50LmluZGV4T2YoIlstLeenkl0iKSA+IC0xKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGp4c3BteURpdi5pbm5lckhUTUwgPSAi6Kej5p6Q5aSx6LSlIgogICAgICAgICAgICAgICAgICAgICAgICBhbGVydCgi5YeG5aSH5aSx6LSl77yM6K+35Yi35paw6YeN6K+VIikKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgICAgICAgICAgICAgfQoKCiAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgZmFzb25ndGV4dD10ZXh0c2VudAogICAgICAgICAgICAgICAgICAgIGp4c3BteURpdi5pbm5lckhUTUwgPSAi54K55Ye76Kej5p6QIgogICAgICAgICAgICAgICAgICAgIC8vZmFzb25nKHRleHRzZW50KQogICAgICAgICAgICAgICAgICAgIC8vIOWmguaenOWFg+e0oOWtmOWcqOWImeaJp+ihjOebuOW6lOeahOWRveS7pAogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCLlhYPntKDlt7Lnu4/lrZjlnKjvvIEiKTsKICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKGludGVydmFsSWQpOyAvLyDmuIXpmaTlrprml7blmagKICAgICAgICAgICAgICAgICAgICAvLyDov5nph4zlhpnlhaXkvaDmg7PopoHmiafooYznmoTlkb3ku6TmiJbogIXlhbbku5bmk43kvZwKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIuWFg+e0oOi/mOS4jeWtmOWcqC4uLiIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaSsrCiAgICAgICAgICAgICAgICBpZiAoaSA+IDIwKSB7CiAgICAgICAgICAgICAgICAgICAganhzcG15RGl2LmlubmVySFRNTCA9ICLop6PmnpDlpLHotKUiCiAgICAgICAgICAgICAgICAgICAgYWxlcnQoIuWHhuWkh+Wksei0pe+8jOivt+WIt+aWsOmHjeivlSIpCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sIDEwMDApOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKCiAgICAgICAgICAgIHZhciBkaXYgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKCJuYXZpZ2F0aW9uX2J1dHRvbiIpWzBdOyAvLyDojrflj5bnrKzkuIDkuKrnrKblkIjmnaHku7bnmoTlhYPntKAKCiAgICAgICAgICAgIGlmIChkaXYgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgLy8g5YWD57Sg5a2Y5ZyoCiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBhbGVydCgi6K+35YWI55m75b2VLXAiKQogICAgICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHZhciBpbnRlcnZhbElkID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgLy8g6I635Y+W6ZyA6KaB5Yik5pat55qE5YWD57SgCiAgICAgICAgICAgICAgICBsZXQgaW5mbyA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlDbGFzc05hbWUoJ3ByZXZpZXctdGl0bGUnKVswXQogICAgICAgICAgICAgICAgbGV0IHZpZGVvSW5mbyA9IGluZm8uZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSgndmlkZW8tZGl2JylbMF0KCgogICAgICAgICAgICAgICAgaWYgKHZpZGVvSW5mbykgewogICAgICAgICAgICAgICAgICAgIHRleHRzZW50ID0gaW5mby5pbm5lclRleHQgKyAiKioqIiArIHRleHRzZW50CiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2codGV4dHNlbnQpOwogICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0c2VudC5pbmRleE9mKCJJVj0iKSA9PT0gLTEgfHwgdGV4dHNlbnQuaW5kZXhPZigi5YyF5ZCrIikgPT09IC0xfHwgdGV4dHNlbnQuaW5kZXhPZigiWy0t56eSXSIpID4gLTEpIHsKICAgICAgICAgICAgICAgICAgICAgICAganhzcG15RGl2LmlubmVySFRNTCA9ICLop6PmnpDlpLHotKUiCiAgICAgICAgICAgICAgICAgICAgICAgIGFsZXJ0KCLlh4blpIflpLHotKXvvIzor7fliLfmlrDph43or5UiKQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgZmFzb25ndGV4dD10ZXh0c2VudAogICAgICAgICAgICAgICAgICAgIGp4c3BteURpdi5pbm5lckhUTUwgPSAi54K55Ye76Kej5p6QIgogICAgICAgICAgICAgICAgICAgIC8vZmFzb25nKHRleHRzZW50KQogICAgICAgICAgICAgICAgICAgIC8vIOWmguaenOWFg+e0oOWtmOWcqOWImeaJp+ihjOebuOW6lOeahOWRveS7pAogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCLlhYPntKDlt7Lnu4/lrZjlnKjvvIEiKTsKICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKGludGVydmFsSWQpOyAvLyDmuIXpmaTlrprml7blmagKICAgICAgICAgICAgICAgICAgICAvLyDov5nph4zlhpnlhaXkvaDmg7PopoHmiafooYznmoTlkb3ku6TmiJbogIXlhbbku5bmk43kvZwKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coIuWFg+e0oOi/mOS4jeWtmOWcqC4uLiIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaSsrCiAgICAgICAgICAgICAgICBpZiAoaSA+IDIwKSB7CiAgICAgICAgICAgICAgICAgICAganhzcG15RGl2LmlubmVySFRNTCA9ICLop6PmnpDlpLHotKUiCiAgICAgICAgICAgICAgICAgICAgYWxlcnQoIuWHhuWkh+Wksei0pe+8jOivt+WIt+aWsOmHjeivlSIpCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sIDEwMDApOwoKCgoKICAgICAgICB9CgoKICAgIH0KCiAgICBjbGFzcyBCYXNlQ2xhc3N7CiAKICAgICAgICBjb25zdHJ1Y3RvcigpewogICAgCiAgICAgICAgICAgIGlmKEdNX2dldFZhbHVlKCdpY29uUG9zaXRpb25TZXRQYWdlJykgIT0gMCl7CiAgICAgICAgICAgICAgICAvKmNvb2tpZeWtmOWCqAogICAgICAgICAgICAgICAgaWNvblZpcFRvcCA9IHRoaXMuZ2V0Q29va2llKCdpY29uVG9wJyk/dGhpcy5nZXRDb29raWUoJ2ljb25Ub3AnKTppY29uVmlwVG9wOwogICAgCiAgICAgICAgICAgICAgICBpY29uVmlwUG9zaXRpb24gPSB0aGlzLmdldENvb2tpZSgnaWNvblBvc2l0aW9uJyk/dGhpcy5nZXRDb29raWUoJ2ljb25Qb3NpdGlvbicpOmljb25WaXBQb3NpdGlvbjsKICAgIAogICAgICAgICAgICAgICAgc2VsZWN0ZWRMZWZ0ID0gaWNvblZpcFBvc2l0aW9uPT0nbGVmdCc/J3NlbGVjdGVkJzonJzsKICAgIAogICAgICAgICAgICAgICAgc2VsZWN0ZWRSaWdodCA9IGljb25WaXBQb3NpdGlvbj09J3JpZ2h0Jz8nc2VsZWN0ZWQnOicnOwogICAgCiAgICAgICAgICAgICAgICBpY29uVmlwV2lkdGggPSB0aGlzLmdldENvb2tpZSgnaWNvbldpZHRoJyk/dGhpcy5nZXRDb29raWUoJ2ljb25XaWR0aCcpOmljb25WaXBXaWR0aDsKICAgICAgICAgICAgICAgICovCiAgICAKICAgICAgICAgICAgICAgIGljb25WaXBUb3AgPSBHTV9nZXRWYWx1ZSgnaWNvblRvcCcpIHx8IEdNX2dldFZhbHVlKCdpY29uVG9wJykgPT0gMD9HTV9nZXRWYWx1ZSgnaWNvblRvcCcpOmljb25WaXBUb3A7CiAgICAKICAgICAgICAgICAgICAgIGljb25WaXBQb3NpdGlvbiA9IEdNX2dldFZhbHVlKCdpY29uUG9zaXRpb24nKT9HTV9nZXRWYWx1ZSgnaWNvblBvc2l0aW9uJyk6aWNvblZpcFBvc2l0aW9uOwogICAgCiAgICAgICAgICAgICAgICBzZWxlY3RlZExlZnQgPSBpY29uVmlwUG9zaXRpb249PSdsZWZ0Jz8nc2VsZWN0ZWQnOicnOwogICAgCiAgICAgICAgICAgICAgICBzZWxlY3RlZFJpZ2h0ID0gaWNvblZpcFBvc2l0aW9uPT0ncmlnaHQnPydzZWxlY3RlZCc6Jyc7CiAgICAKICAgICAgICAgICAgICAgIGljb25WaXBXaWR0aCA9IEdNX2dldFZhbHVlKCdpY29uV2lkdGgnKT9HTV9nZXRWYWx1ZSgnaWNvbldpZHRoJyk6aWNvblZpcFdpZHRoOwogICAgCiAgICAgICAgICAgICAgICBpY29uV2FpdFRpbWUgPSBHTV9nZXRWYWx1ZSgnaWNvbldhaXRUaW1lJyk/R01fZ2V0VmFsdWUoJ2ljb25XYWl0VGltZScpKjEwMDA6aWNvbldhaXRUaW1lOwogICAgCiAgICAgICAgICAgICAgICBpY29uVmlwT3BhY2l0eSA9IEdNX2dldFZhbHVlKCdpY29uT3BhY2l0eScpIHx8IEdNX2dldFZhbHVlKCdpY29uT3BhY2l0eScpID09IDA/R01fZ2V0VmFsdWUoJ2ljb25PcGFjaXR5Jyk6aWNvblZpcE9wYWNpdHk7CiAgICAKICAgICAgICAgICAgfQogICAgCiAgICAgICAgICAgIEdNX3JlZ2lzdGVyTWVudUNvbW1hbmQoIuiuvue9riIsICgpID0+IHRoaXMubWVudVNldCgpKTsKICAgIAogICAgICAgICAgICB0aGlzLnNldFN0eWxlKCk7CiAgICAgICAgfQogICAgCiAgICAgICAgc2V0U3R5bGUoKXsKICAgICAgICAgICAgbGV0IG1lbnVTZXRTdHlsZSA9IGAKICAgICAgICAgICAgICAgICAgICAuemhtTWFza3sKICAgICAgICAgICAgICAgICAgICAgICAgei1pbmRleDo5OTk5OTk5OTk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IzAwMDsKICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IGZpeGVkO3RvcDogMDtyaWdodDogMDtib3R0b206IDA7bGVmdDogMDsKICAgICAgICAgICAgICAgICAgICAgICAgb3BhY2l0eTowLjg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC53cmFwLWJveHsKICAgICAgICAgICAgICAgICAgICAgICAgei1pbmRleDoxMDAwMDAwMDAwOwogICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjpmaXhlZDs7dG9wOiA1MCU7bGVmdDogNTAlO3RyYW5zZm9ybTogdHJhbnNsYXRlKC01MCUsIC0yMDBweCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAzMDBweDsKICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6ICM1NTU7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmZmY7CiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDVweDsKICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3c6aGlkZGVuOwogICAgICAgICAgICAgICAgICAgICAgICBmb250OjE2cHggbnVtRm9udCxQaW5nRmFuZ1NDLVJlZ3VsYXIsVGFob21hLE1pY3Jvc29mdCBZYWhlaSxzYW5zLXNlcmlmICFpbXBvcnRhbnQ7CiAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0OjQwMCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAuc2V0V3JhcEhlYWR7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2YyNDQ0MztoZWlnaHQ6NDBweDtjb2xvcjojZmZmO3RleHQtYWxpZ246Y2VudGVyO2xpbmUtaGVpZ2h0OjQwcHg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC5zZXRXcmFwTGl7CiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHg7cGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC5zZXRXcmFwTGkgbGl7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmZmY7CiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1ib3R0b206MXB4IHNvbGlkICNlZWU7CiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHggIWltcG9ydGFudDsKICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzoxMnB4IDIwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjthbGlnbi1pdGVtczogY2VudGVyOwogICAgICAgICAgICAgICAgICAgICAgICBsaXN0LXN0eWxlOiBub25lOwogICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgIC5zZXRXcmFwTGlDb250ZW50ewogICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4O2p1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjthbGlnbi1pdGVtczogY2VudGVyOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAuc2V0V3JhcFNhdmV7CiAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOmFic29sdXRlO3RvcDotMnB4O3JpZ2h0OjEwcHg7Zm9udC1zaXplOjI0cHg7Y3Vyc29yOnBvaW50ZXIKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLmljb25TZXRGb290ewogICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjphYnNvbHV0ZTtib3R0b206MHB4O3BhZGRpbmc6MTBweCAyMHB4O3dpZHRoOjEwMCU7CiAgICAgICAgICAgICAgICAgICAgei1pbmRleDoxMDAwMDAwMDA5O2JhY2tncm91bmQ6I2ZlZjllZjsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLmljb25TZXRGb290TGl7CiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHg7cGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgCiAgICAgICAgICAgICAgICAgICAgLmljb25TZXRGb290TGkgbGl7CiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1mbGV4OwogICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOjBweCAycHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjthbGlnbi1pdGVtczogY2VudGVyOwogICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDEycHg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC5pY29uU2V0Rm9vdExpIGxpIGF7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiM1NTU7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC5pY29uU2V0Rm9vdExpIGE6aG92ZXIgewogICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjojZmU2ZDczOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAuaWNvblNldFBhZ2V7CiAgICAgICAgICAgICAgICAgICAgICAgIHotaW5kZXg6MTAwMDAwMDAwMTsKICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246YWJzb2x1dGU7dG9wOjBweDtsZWZ0OjMwMHB4OwogICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kOiNmZmY7CiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOjMwMHB4OwogICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6MTAwJTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLmljb25TZXRVbEhlYWR7CiAgICAgICAgICAgICAgICAgICAgcGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICAgICAgbWFyZ2luOjBweDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLmljb25TZXRQYWdlSGVhZHsKICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWJvdHRvbToxcHggc29saWQgI2NjYzsKICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OjQwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OjQwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjsKICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZmU2ZDczOwogICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjojZmZmOwogICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDE1cHg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC5pY29uU2V0UGFnZUxpewogICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW46MHB4O3BhZGRpbmc6MHB4OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAuaWNvblNldFBhZ2VMaSBsaXsKICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC1zdHlsZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzo4cHggMjBweDsKICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWJvdHRvbToxcHggc29saWQgI2VlZTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnpoaWh1U2V0UGFnZXsKICAgICAgICAgICAgICAgICAgICAgICAgei1pbmRleDoxMDAwMDAwMDAyO3Bvc2l0aW9uOmFic29sdXRlO3RvcDowcHg7bGVmdDozMDBweDtiYWNrZ3JvdW5kOiNmZmY7d2lkdGg6MzAwcHg7aGVpZ2h0OjEwMCU7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC5pY29uU2V0UGFnZUlucHV0ewogICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4ICFpbXBvcnRhbnQ7anVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO2FsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC56aGlodVNldFBhZ2VMaXsKICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luOjBweDtwYWRkaW5nOjBweDsKICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OjI1OHB4OwogICAgICAgICAgICAgICAgICAgICAgICBvdmVyZmxvdy15OiBzY3JvbGw7CiAgICAgICAgICAgICAgICAgICAgfQogICAgCiAgICAgICAgICAgICAgICAgICAgLnpoaWh1U2V0UGFnZUNvbnRlbnR7CiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXggIWltcG9ydGFudDtqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47YWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAuemhtX2NpcmN1bGFyewogICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogNDBweDtoZWlnaHQ6IDIwcHg7Ym9yZGVyLXJhZGl1czogMTZweDt0cmFuc2l0aW9uOiAuM3M7Y3Vyc29yOiBwb2ludGVyO2JveC1zaGFkb3c6IDAgMCAzcHggIzk5OSBpbnNldDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnJvdW5kLWJ1dHRvbnsKICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDIwcHg7aGVpZ2h0OiAyMHB4Oztib3JkZXItcmFkaXVzOiA1MCU7Ym94LXNoYWRvdzogMCAxcHggNXB4IHJnYmEoMCwwLDAsLjUpO3RyYW5zaXRpb246IC4zcztwb3NpdGlvbjogcmVsYXRpdmU7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC56aG1fYmFja3sKICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyOiBzb2xpZCAjRkZGOyBib3JkZXItd2lkdGg6IDAgM3B4IDNweCAwOyBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7IHBhZGRpbmc6IDNweDt0cmFuc2Zvcm06IHJvdGF0ZSgxMzVkZWcpOyAgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgxMzVkZWcpO21hcmdpbi1sZWZ0OjEwcHg7Y3Vyc29yOnBvaW50ZXI7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC50by1yaWdodHsKICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luLWxlZnQ6MjBweDsgZGlzcGxheTogaW5saW5lLWJsb2NrOyBwYWRkaW5nOiAzcHg7dHJhbnNmb3JtOiByb3RhdGUoLTQ1ZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgtNDVkZWcpO2N1cnNvcjpwb2ludGVyOwogICAgCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC5pY29uU2V0U2F2ZXsKICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOjI0cHg7Y3Vyc29yOnBvaW50ZXI7bWFyZ2luLXJpZ2h0OjVweDttYXJnaW4tYm90dG9tOjRweDtjb2xvcjojRkZGOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlewogICAgICAgICAgICAgICAgICAgICAgICB6LWluZGV4OjEwMDAwMDAwMDM7CiAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOmFic29sdXRlOwogICAgICAgICAgICAgICAgICAgICAgICB0b3A6MHB4O2xlZnQ6MzAwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQ6I2ZmZjsKICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6MzAwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDoxMDAlOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlX2hlYWRlcnsKICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWJvdHRvbToxcHggc29saWQgI2NjYzsKICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OjQwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OjQwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjsKICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZmU2ZDczOwogICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjojZmZmOwogICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDE1cHg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC56aG1fc2V0X3BhZ2VfY29udGVudHsKICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogZmxleCAhaW1wb3J0YW50O2p1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjthbGlnbi1pdGVtczogY2VudGVyOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlX2xpc3R7CiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjowcHg7cGFkZGluZzowcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogMjIwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93LXk6IHNjcm9sbDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAuemhtX3NldF9wYWdlX2xpc3Q6Oi13ZWJraXQtc2Nyb2xsYmFyIHsKICAgICAgICAgICAgICAgICAgICAgICAgLyrmu5rliqjmnaHmlbTkvZPmoLflvI8qLwogICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA6IDBweDsgIC8q6auY5a695YiG5Yir5a+55bqU5qiq56uW5rua5Yqo5p2h55qE5bC65a+4Ki8KICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxcHg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC56aG1fc2V0X3BhZ2VfbGlzdDo6LXdlYmtpdC1zY3JvbGxiYXItdGh1bWIgewogICAgICAgICAgICAgICAgICAgICAgICAvKua7muWKqOadoemHjOmdouWwj+aWueWdlyovCiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXMgICA6IDJweDsKICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZlNmQ3MzsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnpobV9zZXRfcGFnZV9saXN0Ojotd2Via2l0LXNjcm9sbGJhci10cmFjayB7CiAgICAgICAgICAgICAgICAgICAgICAgIC8q5rua5Yqo5p2h6YeM6Z2i6L2o6YGTKi8KICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdyAgIDogaW5zZXQgMCAwIDVweCByZ2JhKDAsIDAsIDAsIDAuMik7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQgICA6ICNlZGVkZWQ7CiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDEwcHg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC56aG1fc2V0X3BhZ2VfbGlzdCBsaXsKICAgICAgICAgICAgICAgICAgICAgICAgLypib3JkZXItYm90dG9tOjFweCBzb2xpZCAjY2NjOyovCiAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6MTJweCAyMHB4OwogICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OmJsb2NrOwogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItYm90dG9tOjFweCBzb2xpZCAjZWVlOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBsaTpsYXN0LWNoaWxkewogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItYm90dG9tOm5vbmU7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC56aG1fc2Nyb2xsewogICAgICAgICAgICAgICAgICAgIG92ZXJmbG93LXk6IHNjcm9sbCAhaW1wb3J0YW50OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAuemhtX3Njcm9sbDo6LXdlYmtpdC1zY3JvbGxiYXIgewogICAgICAgICAgICAgICAgICAgICAgICAvKua7muWKqOadoeaVtOS9k+agt+W8jyovCiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoIDogMHB4OyAgLyrpq5jlrr3liIbliKvlr7nlupTmqKrnq5bmu5rliqjmnaHnmoTlsLrlr7gqLwogICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDFweDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnpobV9zY3JvbGw6Oi13ZWJraXQtc2Nyb2xsYmFyLXRodW1iIHsKICAgICAgICAgICAgICAgICAgICAgICAgLyrmu5rliqjmnaHph4zpnaLlsI/mlrnlnZcqLwogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzICAgOiAycHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmZTZkNzM7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC56aG1fc2Nyb2xsOjotd2Via2l0LXNjcm9sbGJhci10cmFjayB7CiAgICAgICAgICAgICAgICAgICAgICAgIC8q5rua5Yqo5p2h6YeM6Z2i6L2o6YGTKi8KICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdyAgIDogaW5zZXQgMCAwIDVweCByZ2JhKDAsIDAsIDAsIDAuMik7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQgICA6ICNlZGVkZWQ7CiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDEwcHg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC8qLWZvcm0tKi8KICAgICAgICAgICAgICAgICAgICA6cm9vdCB7CiAgICAgICAgICAgICAgICAgICAgICAgIC0tYmFzZS1jb2xvcjogIzQzNGE1NjsKICAgICAgICAgICAgICAgICAgICAgICAgLS13aGl0ZS1jb2xvci1wcmltYXJ5OiAjZjdmOGY4OwogICAgICAgICAgICAgICAgICAgICAgICAtLXdoaXRlLWNvbG9yLXNlY29uZGFyeTogI2ZlZmVmZTsKICAgICAgICAgICAgICAgICAgICAgICAgLS1ncmF5LWNvbG9yLXByaW1hcnk6ICNjMmMyYzI7CiAgICAgICAgICAgICAgICAgICAgICAgIC0tZ3JheS1jb2xvci1zZWNvbmRhcnk6ICNjMmMyYzI7CiAgICAgICAgICAgICAgICAgICAgICAgIC0tZ3JheS1jb2xvci10ZXJ0aWFyeTogIzY3NmY3OTsKICAgICAgICAgICAgICAgICAgICAgICAgLS1hY3RpdmUtY29sb3I6ICMyMjdjOWQ7CiAgICAgICAgICAgICAgICAgICAgICAgIC0tdmFsaWQtY29sb3I6ICNjMmMyYzI7CiAgICAgICAgICAgICAgICAgICAgICAgIC0taW52YWxpZC1jb2xvcjogI2Y3MmY0NzsKICAgICAgICAgICAgICAgICAgICAgICAgLS1pbnZhbGlkLWljb246IHVybCgiZGF0YTppbWFnZS9zdmcreG1sO2NoYXJzZXQ9dXRmOCwlM0NzdmclMjB4bWxucyUzRCUyMmh0dHAlM0ElMkYlMkZ3d3cudzMub3JnJTJGMjAwMCUyRnN2ZyUyMiUyMHdpZHRoJTNEJTIyMjQlMjIlMjBoZWlnaHQlM0QlMjIyNCUyMiUyMHZpZXdCb3glM0QlMjIwJTIwMCUyMDI0JTIwMjQlMjIlM0UlMjAlM0NwYXRoJTIwZCUzRCUyMk0xMy40MSUyMDEybDQuMy00LjI5YTElMjAxJTIwMCUyMDElMjAwLTEuNDItMS40MkwxMiUyMDEwLjU5bC00LjI5LTQuM2ExJTIwMSUyMDAlMjAwJTIwMC0xLjQyJTIwMS40Mmw0LjMlMjA0LjI5LTQuMyUyMDQuMjlhMSUyMDElMjAwJTIwMCUyMDAlMjAwJTIwMS40MiUyMDElMjAxJTIwMCUyMDAlMjAwJTIwMS40MiUyMDBsNC4yOS00LjMlMjA0LjI5JTIwNC4zYTElMjAxJTIwMCUyMDAlMjAwJTIwMS40MiUyMDAlMjAxJTIwMSUyMDAlMjAwJTIwMCUyMDAtMS40MnolMjIlMjBmaWxsJTNEJTIyJTIzZjcyZjQ3JTIyJTIwJTJGJTNFJTNDJTJGc3ZnJTNFIik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0IHsKICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAxNnB4OwogICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgICAgICAgICAgICAgICAgICAgICAgIHJpZ2h0OjBweDsKICAgICAgICAgICAgICAgICAgICAgICAgei1pbmRleDogMDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnRleHQtaW5wdXRfX2JvZHkgewogICAgICAgICAgICAgICAgICAgICAgICAtd2Via2l0LWFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgIC1tb3otYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgYXBwZWFyYW5jZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnQ7CiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcjogMXB4IHNvbGlkIHZhcigtLWdyYXktY29sb3ItcHJpbWFyeSk7CiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDNweDsKICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxLjdlbTsKICAgICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDEuNzsKICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogMnB4IDFlbTsKICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7CiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb246IGJhY2tncm91bmQtY29sb3IgMC4zczsKICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6NTUlOwogICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MTRweDsKICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNpemluZzogaW5pdGlhbDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnRleHQtaW5wdXRfX2JvZHk6LW1zLWlucHV0LXBsYWNlaG9sZGVyIHsKICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6IHZhcigtLWdyYXktY29sb3Itc2Vjb25kYXJ5KTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnRleHQtaW5wdXRfX2JvZHk6Oi1tb3otcGxhY2Vob2xkZXIgewogICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogdmFyKC0tZ3JheS1jb2xvci1zZWNvbmRhcnkpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keTo6cGxhY2Vob2xkZXIgewogICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogdmFyKC0tZ3JheS1jb2xvci1zZWNvbmRhcnkpOwogICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5W2RhdGEtaXMtdmFsaWRdIHsKICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZy1yaWdodDogMWVtOwogICAgCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5W2RhdGEtaXMtdmFsaWQ9dHJ1ZV0gewogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6IHZhcigtLXZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnRleHQtaW5wdXRfX2JvZHlbZGF0YS1pcy12YWxpZD1mYWxzZV0gewogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6IHZhcigtLWludmFsaWQtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICBib3gtc2hhZG93OiBpbnNldCAwIDAgMCAxcHggdmFyKC0taW52YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X19ib2R5OmZvY3VzIHsKICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS1hY3RpdmUtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICBib3gtc2hhZG93OiBpbnNldCAwIDAgMCAxcHggdmFyKC0tYWN0aXZlLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgb3V0bGluZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnRleHQtaW5wdXRfX2JvZHk6LXdlYmtpdC1hdXRvZmlsbCB7CiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb24tZGVsYXk6IDk5OTlzOwogICAgICAgICAgICAgICAgICAgICAgICAtd2Via2l0LXRyYW5zaXRpb24tcHJvcGVydHk6IGJhY2tncm91bmQtY29sb3I7CiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb24tcHJvcGVydHk6IGJhY2tncm91bmQtY29sb3I7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC50ZXh0LWlucHV0X192YWxpZGF0b3IgewogICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiByaWdodCAwLjVlbSBjZW50ZXI7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtcmVwZWF0OiBuby1yZXBlYXQ7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtc2l6ZTogMS41ZW07CiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jazsKICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxMDAlOwogICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiAwOwogICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogMDsKICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDEwMCU7CiAgICAgICAgICAgICAgICAgICAgICAgIHotaW5kZXg6IC0xOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAudGV4dC1pbnB1dF9fYm9keVtkYXRhLWlzLXZhbGlkPWZhbHNlXSArIC50ZXh0LWlucHV0X192YWxpZGF0b3IgewogICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWltYWdlOiB2YXIoLS1pbnZhbGlkLWljb24pOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAuc2VsZWN0LWJveCB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaXppbmc6IGluaGVyaXQ7CiAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTZweDsKICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlOwogICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uOiBiYWNrZ3JvdW5kLWNvbG9yIDAuNXMgZWFzZS1vdXQ7CiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOjkwcHg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC5zZWxlY3QtYm94OjphZnRlciB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tZ3JheS1jb2xvci1zZWNvbmRhcnkpIHRyYW5zcGFyZW50IHRyYW5zcGFyZW50IHRyYW5zcGFyZW50OwogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItc3R5bGU6IHNvbGlkOwogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItd2lkdGg6IDZweCA0cHggMDsKICAgICAgICAgICAgICAgICAgICAgICAgYm90dG9tOiAwOwogICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAiIjsKICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrOwogICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDA7CiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbjogYXV0byAwOwogICAgICAgICAgICAgICAgICAgICAgICBwb2ludGVyLWV2ZW50czogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlOwogICAgICAgICAgICAgICAgICAgICAgICByaWdodDogLTcycHg7CiAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogMDsKICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDA7CiAgICAgICAgICAgICAgICAgICAgICAgIHotaW5kZXg6IDE7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC5zZWxlY3QtYm94X19ib2R5IHsKICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNpemluZzogaW5pdGlhbDsKICAgICAgICAgICAgICAgICAgICAgICAgLXdlYmtpdC1hcHBlYXJhbmNlOiBub25lOwogICAgICAgICAgICAgICAgICAgICAgICAtbW96LWFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50OwogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXI6IDFweCBzb2xpZCB2YXIoLS1ncmF5LWNvbG9yLXByaW1hcnkpOwogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiAzcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGN1cnNvcjogcG9pbnRlcjsKICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAxLjdlbTsKICAgICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDEuNzsKICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZy1sZWZ0OiAxZW07CiAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmctcmlnaHQ6IGNhbGMoMWVtICsgMTZweCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAxNDAlOwogICAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6MTRweDsKICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZy10b3A6MnB4OwogICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nLWJvdHRvbToycHg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC5zZWxlY3QtYm94X19ib2R5W2RhdGEtaXMtdmFsaWQ9dHJ1ZV0gewogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6IHZhcigtLXZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4IHZhcigtLXZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnNlbGVjdC1ib3hfX2JvZHlbZGF0YS1pcy12YWxpZD1mYWxzZV0gewogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6IHZhcigtLWludmFsaWQtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICBib3gtc2hhZG93OiBpbnNldCAwIDAgMCAxcHggdmFyKC0taW52YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC5zZWxlY3QtYm94X19ib2R5LmZvY3VzLXZpc2libGUgewogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6IHZhcigtLWFjdGl2ZS1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS1hY3RpdmUtY29sb3IpOwogICAgICAgICAgICAgICAgICAgICAgICBvdXRsaW5lOiBub25lOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAuc2VsZWN0LWJveF9fYm9keTotd2Via2l0LWF1dG9maWxsIHsKICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbi1kZWxheTogOTk5OXM7CiAgICAgICAgICAgICAgICAgICAgICAgIC13ZWJraXQtdHJhbnNpdGlvbi1wcm9wZXJ0eTogYmFja2dyb3VuZC1jb2xvcjsKICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbi1wcm9wZXJ0eTogYmFja2dyb3VuZC1jb2xvcjsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnRleHRhcmVhX19ib2R5IHsKICAgICAgICAgICAgICAgICAgICAgICAgLXdlYmtpdC1hcHBlYXJhbmNlOiBub25lOwogICAgICAgICAgICAgICAgICAgICAgICAtbW96LWFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVhcmFuY2U6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50OwogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXI6IDFweCBzb2xpZCB2YXIoLS1ncmF5LWNvbG9yLXByaW1hcnkpOwogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXItcmFkaXVzOiAwOwogICAgICAgICAgICAgICAgICAgICAgICBib3gtc2l6aW5nOiBpbml0aWFsOwogICAgICAgICAgICAgICAgICAgICAgICBmb250OiBpbmhlcml0OwogICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiAwOwogICAgICAgICAgICAgICAgICAgICAgICBsZXR0ZXItc3BhY2luZzogaW5oZXJpdDsKICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogMWVtOwogICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlc2l6ZTogbm9uZTsKICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiAwOwogICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2l0aW9uOiBiYWNrZ3JvdW5kLWNvbG9yIDAuNXMgZWFzZS1vdXQ7CiAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAxMDAlOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnRleHRhcmVhX19ib2R5Om9ubHktY2hpbGQgewogICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlc2l6ZTogdmVydGljYWw7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC50ZXh0YXJlYV9fYm9keTpmb2N1cyB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0tYWN0aXZlLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAwIDAgMXB4IHZhcigtLWFjdGl2ZS1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgIG91dGxpbmU6IG5vbmU7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC50ZXh0YXJlYV9fYm9keVtkYXRhLWlzLXZhbGlkPXRydWVdIHsKICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyLWNvbG9yOiB2YXIoLS12YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS12YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC50ZXh0YXJlYV9fYm9keVtkYXRhLWlzLXZhbGlkPWZhbHNlXSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogdmFyKC0taW52YWxpZC1jb2xvcik7CiAgICAgICAgICAgICAgICAgICAgICAgIGJveC1zaGFkb3c6IGluc2V0IDAgMCAwIDFweCB2YXIoLS1pbnZhbGlkLWNvbG9yKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAudGV4dGFyZWEgLl9kdW1teS1ib3ggewogICAgICAgICAgICAgICAgICAgICAgICBib3JkZXI6IDFweCBzb2xpZDsKICAgICAgICAgICAgICAgICAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDsKICAgICAgICAgICAgICAgICAgICAgICAgbWluLWhlaWdodDogMjQwcHg7CiAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICAgICAgICAgICAgICAgICAgICAgIG92ZXJmbG93LXdyYXA6IGJyZWFrLXdvcmQ7CiAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6IDFlbTsKICAgICAgICAgICAgICAgICAgICAgICAgdmlzaWJpbGl0eTogaGlkZGVuOwogICAgICAgICAgICAgICAgICAgICAgICB3aGl0ZS1zcGFjZTogcHJlLXdyYXA7CiAgICAgICAgICAgICAgICAgICAgICAgIHdvcmQtd3JhcDogYnJlYWstd29yZDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgLnRvTGVmdE1vdmV7CiAgICAgICAgICAgICAgICAgICAgICAgIG5pbWF0aW9uOm1vdmVUb0xlZnQgMC41cyBpbmZpbml0ZTsKICAgICAgICAgICAgICAgICAgICAgICAgLXdlYmtpdC1hbmltYXRpb246bW92ZVRvTGVmdCAwLjVzIGluZmluaXRlOyAvKlNhZmFyaSBhbmQgQ2hyb21lKi8KICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLWl0ZXJhdGlvbi1jb3VudDoxOwogICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24tZmlsbC1tb2RlOiBmb3J3YXJkczsKICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICBAa2V5ZnJhbWVzIG1vdmVUb0xlZnR7CiAgICAgICAgICAgICAgICAgICAgICAgIGZyb20ge2xlZnQ6MjAwcHg7fQogICAgICAgICAgICAgICAgICAgICAgICB0byB7bGVmdDowcHg7fQogICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBtb3ZlVG9MZWZ0IC8qU2FmYXJpIGFuZCBDaHJvbWUqL3sKICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSB7bGVmdDoyMDBweDt9CiAgICAgICAgICAgICAgICAgICAgICAgIHRvIHtsZWZ0OjBweDt9CiAgICAgICAgICAgICAgICAgICAgfQogICAgCiAgICAgICAgICAgICAgICAgICAgLnRvUmlnaHRNb3ZlewogICAgICAgICAgICAgICAgICAgICAgICBuaW1hdGlvbjptb3ZlVG9SaWdodCAycyBpbmZpbml0ZTsKICAgICAgICAgICAgICAgICAgICAgICAgLXdlYmtpdC1hbmltYXRpb246bW92ZVRvUmlnaHQgMnMgaW5maW5pdGU7IC8qU2FmYXJpIGFuZCBDaHJvbWUqLwogICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24taXRlcmF0aW9uLWNvdW50OjE7CiAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi1maWxsLW1vZGU6IGZvcndhcmRzOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBAa2V5ZnJhbWVzIG1vdmVUb1JpZ2h0ewogICAgICAgICAgICAgICAgICAgICAgICBmcm9tIHtsZWZ0OjBweDt9CiAgICAgICAgICAgICAgICAgICAgICAgIHRvIHtsZWZ0OjIwMDBweDt9CiAgICAgICAgICAgICAgICAgICAgfQogICAgCiAgICAgICAgICAgICAgICAgICAgQC13ZWJraXQta2V5ZnJhbWVzIG1vdmVUb1JpZ2h0IC8qU2FmYXJpIGFuZCBDaHJvbWUqL3sKICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSB7bGVmdDowcHg7fQogICAgICAgICAgICAgICAgICAgICAgICB0byB7bGVmdDoyMDBweDt9CiAgICAgICAgICAgICAgICAgICAgfQogICAgCiAgICAgICAgICAgICAgICBgOwogICAgCiAgICAgICAgICAgIGRvbVN0eWxlIC5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZShtZW51U2V0U3R5bGUpKTsKICAgIAogICAgICAgICAgICBkb21IZWFkLmFwcGVuZENoaWxkKGRvbVN0eWxlKTsKICAgICAgICB9CiAgICAKICAgICAgICBtZW51U2V0KCl7CiAgICAKICAgICAgICAgICAgdmFyIF90aGlzID0gdGhpczsKICAgIAogICAgICAgICA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sQ29sdW1uJywnZGVmYXVsdCc6MjJ9LAogICAgICAgICAgICAgICAgeydvcHRpb25OYW1lJzpsYW5nLnZpZGVvVGl0bGUsJ29wdGlvbklEJzondmlkZW9UaXRsZScsJ2RlZmF1bHQnOjIyfSwKICAgICAgICAgICAgICAgIHsnb3B0aW9uTmFtZSc6bGFuZy56aEtleXdvcmRDbG9zZSwnb3B0aW9uSUQnOidyZW1vdmVLZXl3b3JkJywnZGVmYXVsdCc6JzAnfSwKICAgICAgICAgICAgICAgIHsnb3B0aW9uTmFtZSc6bGFuZy5hdXRob3JOYW1lQ2xvc2UsJ29wdGlvbklEJzoncmVtb3ZlQXV0aG9yTmFtZScsJ2RlZmF1bHQnOjIyfSwKICAgICAgICAgICAgICAgIHsnb3B0aW9uTmFtZSc6bGFuZy55YW54dWFuQ2xvc2UsJ29wdGlvbklEJzoncmVtb3ZlWWFueHVhbicsJ2RlZmF1bHQnOicwJ30KICAgICAgICAgICAgXTsKICAgIAogICAgICAgICAgICB2YXIgcGxheVZpZGVvT3B0aW9uSnNvbiA9ewogICAgICAgICAgICAgICAgJ29wdGlvbk5hbWUnOmxhbmcucGxheVZpZGVvTGluZUFkZCwKICAgICAgICAgICAgICAgICdvcHRpb25JRCc6J3ZpZGVvUGxheUxpbmVBZGQnLAogICAgICAgICAgICAgICAgJ2RlZmF1bHQnOnZpZGVvUGxheUxpbmVBZGQsCiAgICAgICAgICAgICAgICAndGV4dGFyZWEnOid2aWRlb1BsYXlMaW5lQWRkVGV4dGFyZWEnLAogICAgICAgICAgICAgICAgJ3RleHRhcmVhSWQnOidwbGF5VmlkZW9MaW5lVGV4dGFyZWEnLAogICAgICAgICAgICAgICAgJ3RpcCc6CiAgICBg57qv5YeAMSxodHRwczovL2ltMTkwNy50b3AvP2p4PQogICAgQuermTEsaHR0cHM6Ly9qeC5qc29ucGxheWVyLmNvbS9wbGF5ZXIvP3VybD0KICAgIOeIseixhixodHRwczovL2p4LmFpZG91ZXIubmV0Lz91cmw9CiAgICBCTCxodHRwczovL3ZpcC5ibGppZXguY29tLz92PQogICAg5Yaw6LGGLGh0dHBzOi8vYmQuanguY24vP3VybD0KICAgIENLLGh0dHBzOi8vd3d3LmNrcGxheWVyLnZpcC9qaWV4aS8/dXJsPQogICAgSDgsaHR0cHM6Ly93d3cuaDhqeC5jb20vamlleGkucGhwP3VybD0KICAgIEpZLGh0dHBzOi8vangucGxheWVyankuY29tLz91cmw9CiAgICDop6PmnpBsYSxodHRwczovL2FwaS5qaWV4aS5sYS8/dXJsPQogICAgTTNVOCxodHRwczovL2p4Lm0zdTgudHYvamlleGkvP3VybD0KICAgIFBNLGh0dHBzOi8vd3d3LnBsYXltM3U4LmNuL2ppZXhpLnBocD91cmw9CiAgICDnm5jlj6QsaHR0cHM6Ly93d3cucGFuZ3VqaWV4aS5jYy9qaWV4aS5waHA/dXJsPQogICAg5LiD5ZOlLGh0dHBzOi8vangubm54di5jbi90di5waHA/dXJsPQogICAg5ZCs5LmQLGh0dHBzOi8vanguZGo2dS5jb20vP3VybD0KICAgIOe7tOWkmixodHRwczovL2p4Lml2aXRvLmNuLz91cmw9CiAgICDomb7nsbMsaHR0cHM6Ly9qeC54bWZsdi5jb20vP3VybD0KICAgIFlULGh0dHBzOi8vangueWFuZ3R1LnRvcC8/dXJsPQogICAg5aSc5bmVLGh0dHBzOi8vd3d3LnllbXUueHl6Lz91cmw9CiAgICDkupHmnpAsaHR0cHM6Ly9qeC55cGFyc2UuY29tL2luZGV4LnBocD91cmw9CiAgICAxN+S6kSxodHRwczovL3d3dy4xNzE3eXVuLmNvbS9qeC90eS5waHA/dXJsPQogICAgMTgwLGh0dHBzOi8vanguMDAwMTgwLnRvcC9qeC8/dXJsPQogICAgNEssaHR0cHM6Ly9qeC40a2R2LmNvbS8/dXJsPQogICAgODA5MCxodHRwczovL3d3dy44MDkwZy5jbi8/dXJsPWAsCiAgICAKICAgICAgICAgICAgICAgICAndmFsdWVOYW1lJzoncGxheVZpZGVvTGluZVRleHQnf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AgICAgICAgICAgbGV0IGJhY2tDb2xvcixzd2l0Y2hCYWNrQ29ybG9yLGRpc3BsYXk7CiAgICAKICAgICAgICAgICAgbGV0IG9wdGlvblZhbHVlID0gR01fZ2V0VmFsdWUocGxheVZpZGVvT3B0aW9uSnNvbi5vcHRpb25JRCxwbGF5VmlkZW9PcHRpb25Kc29uLmRlZmF1bHQpOwogICAgCiAgICAgICAgICAgIGlmKG9wdGlvblZhbHVlICE9ICcyMicpewogICAgCiAgICAgICAgICAgICAgICBiYWNrQ29sb3IgPSAnI2ZmZic7CiAgICAKICAgICAgICAgICAgICAgIHN3aXRjaEJhY2tDb3Jsb3IgPSAnI0ZGRic7CiAgICAKICAgICAgICAgICAgfWVsc2V7CiAgICAKICAgICAgICAgICAgICAgIGJhY2tDb2xvciA9ICcjZmU2ZDczJzsKICAgIAogICAgICAgICAgICAgICAgc3dpdGNoQmFja0NvcmxvciA9ICcjRkZFNUU1JzsKICAgIAogICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgc2V0SHRtbCArPSI8bGk+IjsKICAgIAogICAgICAgICAgICBzZXRIdG1sICs9IjxkaXYgY2xhc3M9J3pobV9zZXRfcGFnZV9jb250ZW50Jz4iOwogICAgCiAgICAgICAgICAgIHNldEh0bWwgKz0gIjxzcGFuIGNsYXNzPSdwbGF5VmlkZW9PcHRpb25OYW1lJz4iK3BsYXlWaWRlb09wdGlvbkpzb24ub3B0aW9uTmFtZSsiPC9zcGFuPiI7CiAgICAKICAgICAgICAgICAgc2V0SHRtbCArPSI8ZGl2IGNsYXNzPSd6aG1fY2lyY3VsYXInIHN0eWxlPSdiYWNrZ3JvdW5kLWNvbG9yOiIrc3dpdGNoQmFja0NvcmxvcisiJyBpZD0nIitwbGF5VmlkZW9PcHRpb25Kc29uLm9wdGlvbklEKyInPiI7CiAgICAKICAgICAgICAgICAgc2V0SHRtbCArPSI8ZGl2IGNsYXNzPSdyb3VuZC1idXR0b24nIHN0eWxlPSdiYWNrZ3JvdW5kO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IdG1sICs9Ijx1bCBjbGFzcz0naWNvblNldFVsSGVhZCc+PGxpIGNsYXNzPSdpY29uU2V0UGFnZUhlYWQnPjxzcGFuPjwvc3Bhbj48c3Bhbj4iK2xhbmcuc2V0KyI8L3NwYW4+PHNwYW4gY2xhc3M9J2ljb25TZXRTYXZlJz7Dlzwvc3Bhbj48L2xpPjwvdWw+IjsKICAgIAogICAgICAgICAgICBzZXRIdG1sICs9Ijx1bCBjbGFzcz0nc2V0V3JhcExpJz4iOwogICAgCiAgICAgICAgICAgIGZvcih2YXIgc2V0Tj0wO3NldE48c2V0TGlzdEpzb24ubGVuZ3RoO3NldE4rKyl7CiAgICAKICAgICAgICAgICAgICAgIHZhciBsaXN0VmFsdWUgPSBHTV9nZXRWYWx1ZShzZXRMaXN0SnNvbltzZXROXS5zZXRMaXN0SUQsJzIyJyk7CiAgICAKICAgICAgICAgICAgICAgIGxldCBiYWNrQ29sb3IsYXJyb3dDb2xvcixzd2l0Y2hCYWNrQ29ybG9yOwogICAgCiAgICAgICAgICAgICAgICBpZihsaXN0VmFsdWUgIT0gMjIpewogICAgICAgICAgICAgICAgICAgIGJhY2tDb2xvciA9ICcjZmZmJzsKICAgICAgICAgICAgICAgICAgICBhcnJvd0NvbG9yPSAnI0VFRSc7CiAgICAgICAgICAgICAgICAgICAgc3dpdGNoQmFja0NvcmxvciA9ICcjRkZGJzsKICAgIAogICAgICAgICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgICAgICAgICAgYmFja0NvbG9yID0gJyNmZTZkNzMnOwogICAgICAgICAgICAgICAgICAgIGFycm93Q29sb3IgPSAnI0NDQyc7CiAgICAgICAgICAgICAgICAgICAgc3dpdGNoQmFja0NvcmxvciA9ICcjRkZFNUU1JzsKICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgaWYoc2V0TGlzdEpzb25bc2V0Tl0uc2V0UGFnZUlEID09ICcnKXsKICAgICAgICAgICAgICAgICAgICBhcnJvd0NvbG9yID0gJyN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ZW1lbnRCeUlkKCd6aG1NZW51Jyk7CiAgICAKICAgICAgICAgICAgemhtTWVudS5pbm5lckhUTUwgPSBzZXRIdG1sOwogICAgCiAgICAgICAgICAgIGxldCB0aW1lclpobUljb24gPSBzZXRJbnRlcnZhbChmdW5jdGlvbigpewogICAgCiAgICAgICAgICAgICAgICBpZiAoZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobU1lbnUnKSl7CiAgICAKICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVyWmhtSWNvbik7IC8vIOWPlua2iOWumuaXtuWZqAogICAgCiAgICAgICAgICAgICAgICAgICAgbGV0IGNpcmN1bGFyID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLnpobV9jaXJjdWxhcicpOwogICAgCiAgICAgICAgICAgICAgICAgICAgY2lyY3VsYXIuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICBpdGVtLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgZnVuY3Rpb24oX2UpewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYnV0dG9uU3R5bGUgPSBpdGVtLmNoaWxkcmVuWzBdLnN0eWxlOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbGVmdCA9IGJ1dHRvblN0eWxlLmxlZnQ7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgPSBwYXJzZUludChsZWZ0KTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3RMZWZ0VmFsdWU7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGxlZnQ9PTApewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnV0dG9uU3R5bGUubGVmdCA9ICcyMnB4JzsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1dHRvblN0eWxlLmJhY2tncm91bmQgPSAnI2ZlNmQ3Myc7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnN0eWxlLmJhY2tncm91bmQ9JyNmZkU1RTUnOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXRlbS5uZXh0U2libGluZyAmJiBpdGVtLm5leHRTaWJsaW5nLmdldEF0dHJpYnV0ZSgnZGF0YScpKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtLm5leHRTaWJsaW5nLnNldEF0dHJpYnV0ZSgnc3R5bGUnLCdib3JkZXI6IHNvbGlkICNjY2M7Ym9yZGVyLXdpZHRoOiAwIDNweCAzcHggMDsnKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RMZWZ0VmFsdWUgPSAyMjsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidXR0b25TdHlsZS5sZWZ0ID0gJzBweCc7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidXR0b25TdHlsZS5iYWNrZ3JvdW5kID0gJyNmZmYnOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5zdHlsZS5iYWNrZ3JvdW5kPScjZmZmJzsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGl0ZW0ubmV4dFNpYmxpbmcpewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0ubmV4dFNpYmxpbmcuc2V0QXR0cmlidXRlKCdzdHlsZScsJ2JvcmRlcjogc29saWQgI0VFRTtib3JkZXItd2lkdGg6IDAgM3B4IDNweCAwOycpCiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0TGVmdFZhbHVlID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNldExpc3RJRCA9IGl0ZW0uaWQ7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKHNldExpc3RJRCxsaXN0TGVmdFZhbHVlKTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgCiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAKICAgICAgICAgICAgICAgICAgICBsZXQgdG9SaWdodCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy50by1yaWdodCcpOwogICAgCiAgICAgICAgICAgICAgICAgICAgdG9SaWdodC5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCBmdW5jdGlvbihlKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxlZnQgPSBpdGVtLnByZXZpb3VzU2libGluZy5jaGlsZHJlblswXS5zdHlsZS5sZWZ0OwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0ID0gcGFyc2VJbnQobGVmdCk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGxlZnQgIT0gMjIpIHJldHVybjsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNldFBhZ2VJRCA9IGl0ZW0uZ2V0QXR0cmlidXRlKCdkYXRhJyk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYWdlSWQgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChzZXRQYWdlSUQpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlSWQuY2xhc3NOYW1lPSdpY29uU2V0UGFnZSB0b0xlZnRNb3ZlJzsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/lrp7ml7blm77moIfpq5jluqYKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNldFBhZ2VJRCA9PSAnbW92aWVJY29uU2V0UGFnZScpewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2ljb25Ub3AnKS52YWx1ZT1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjemhtbG9nbyIpLm9mZnNldFRvcDsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aG1UYWtlUGxhY2UnKS5zdHlsZT0iaGVpZ2h0OjIwMHB4IjsKICAgIAogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNldFBhZ2VJRCA9PSAnbW92aWVWaWRlb1NldFBhZ2UnKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN6aG1UYWtlUGxhY2UnKS5zdHlsZT0iaGVpZ2h0OjIwMHB4IjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coc2V0UGFnZUlEKTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgCiAgICAgICAgICAgICAgICAgICAgfSkKICAgIAogICAgICAgICAgICAgICAgICAgIGxldCB0b0JhY2sgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuemhtX2JhY2snKTsKICAgIAogICAgICAgICAgICAgICAgICAgIHRvQmFjay5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCBmdW5jdGlvbihlKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhcmVudERvbSA9IGl0ZW0ucGFyZW50Tm9kZS5wYXJlbnROb2RlLnBhcmVudE5vZGU7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudERvbS5jbGFzc05hbWU9J2ljb25TZXRQYWdlIHRvUmlnaHRNb3ZlJzsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3pobVRha2VQbGFjZScpLnN0eWxlPSdoZWlnaHQ6NDBweDsnCiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgIAogICAgICAgICAgICAgICAgICAgIH0pCiAgICAKICAgICAgICAgICAgICAgICAgICBsZXQgc2V0U2F2ZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5pY29uU2V0U2F2ZScpOwogICAgCiAgICAgICAgICAgICAgICAgICAgc2V0U2F2ZS5mb3JFYWNoKGZ1bmN0aW9uKGl0ZW0pewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCgpPT57CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpY29uVG9wID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2ljb25Ub3AnKS52YWx1ZTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGljb25PcGFjaXR5PWRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpY29uT3BhY2l0eScpLnZhbHVlOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvblBvc2l0aW9uID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2ljb25Qb3NpdGlvbicpLnZhbHVlOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvbldpZHRoID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2ljb25XaWR0aCcpLnZhbHVlOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWNvbldhaXRUaW1lID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2ljb25XYWl0VGltZScpLnZhbHVlOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGxheVZpZGVvTGluZVRleHQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjcGxheVZpZGVvTGluZVRleHRhcmVhJykudmFsdWU7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwbGF5VmlkZW9MaW5lTGVmdCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN2aWRlb1BsYXlMaW5lQWRkJykuY2hpbGRyZW5bMF0uc3R5bGUubGVmdDsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaWNvblRvcCAhPSAnJyl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighKC8oXlswLTldWzAtOV17MCwyfSQpLy50ZXN0KGljb25Ub3ApKSl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxlcnQobGFuZy50aXBFcnJvckljb25IZWlnaHQpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL190aGlzLnNldENvb2tpZSgnaWNvblRvcCcsaWNvblRvcCwzMCk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgnaWNvblRvcCcsaWNvblRvcCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGljb25PcGFjaXR5ICE9ICcnKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoL14oPzowfFsxLTldWzAtOV0/fDEwMCkkLy50ZXN0KGljb25PcGFjaXR5KSkpewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsZXJ0KGxhbmcudGlwRXJyb3JJY29uT3BhY2l0eSk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vX3RoaXMuc2V0Q29va2llKCdpY29uVG9wJyxpY29uVG9wLDMwKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2FsZXJ0KGljb25PcGFjaXR5KTtyZXR1cm47CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ2ljb25PcGFjaXR5JyxpY29uT3BhY2l0eSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGljb25Qb3NpdGlvbiAhPSAnJyl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL190aGlzLnNldENvb2tpZSgnaWNvblBvc2l0aW9uJyxpY29uUG9zaXRpb24sMzApOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ2ljb25Qb3NpdGlvbicsaWNvblBvc2l0aW9uKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaWNvbldhaXRUaW1lICE9ICcnKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCdpY29uV2FpdFRpbWUnLGljb25XYWl0VGltZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGljb25XaWR0aCAhPScnKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoLyheKFsxLTldWzAtOV0/KSQpLy50ZXN0KGljb25XaWR0aCkpKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGVydChsYW5nLnRpcEVycm9ySWNvbldpZHRoKTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9fdGhpcy5zZXRDb29raWUoJ2ljb25XaWR0aCcsaWNvbldpZHRoLDMwKTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCdpY29uV2lkdGgnLGljb25XaWR0aCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKEdNX2dldFZhbHVlKCd2aWRlb1BsYXlMaW5lQWRkJykgPT0gMjIpewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocGxheVZpZGVvTGluZVRleHQpewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaW5lT2JqID0gX3RoaXMuZ2V0TGluZShwbGF5VmlkZW9MaW5lVGV4dCk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYobGluZU9iai5sZW5ndGg+MCl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCdwbGF5VmlkZW9MaW5lVGV4dCcscGxheVZpZGVvTGluZVRleHQpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxlcnQoJ+e6v+i3r+i+k+WFpeS4jeato+ehricpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgncGxheVZpZGVvTGluZVRleHQnLCcnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ3BsYXlWaWRlb0xpbmVUZXh0JyxwbGF5VmlkZW9MaW5lVGV4dCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpc3RvcnkuZ28oMCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgfSkKICAgIAogICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdpY29uVG9wJykuYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJyxmdW5jdGlvbigpewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpY29uVG9wID0gdGhpcy52YWx1ZTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICBpZighKC8oXlsxLTldXGQqJCkvLnRlc3QoaWNvblRvcCkpKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBdHRyaWJ1dGUoJ2RhdGEtaXMtdmFsaWQnLCdmYWxzZScpCiAgICAKICAgIAogICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBdHRyaWJ1dGUoJ2RhdGEtaXMtdmFsaWQnLCd0cnVlJykKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgIAogICAgICAgICAgICAgICAgICAgIH0pCiAgICAKICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnaWNvbldpZHRoJykuYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJyxmdW5jdGlvbigpewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpY29uV2lkdGggPSB0aGlzLnZhbHVlOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoLyheWzEtOV1cZCokKS8udGVzdChpY29uV2lkdGgpKSl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0QXR0cmlidXRlKCdkYXRhLWlzLXZhbGlkJywnZmFsc2UnKQogICAgCiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0QXR0cmlidXRlKCdkYXRhLWlzLXZhbGlkJywndHJ1ZScpCiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAKICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgIC8v6IW+6K6v6KeG6aKR5b+r5o236ZSu5Yay56qBCiAgICAgICAgICAgICAgICAgICAgaWYoY291cG9uVXJsLm1hdGNoKC92XC5xcVwuY29tXC94XC9jb3Zlci8pKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICBsZXQgYWRkTGluZVRleHQgPWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNwbGF5VmlkZW9MaW5lVGV4dGFyZWEnKTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICBhZGRMaW5lVGV4dC5hZGRFdmVudExpc3RlbmVyKCdrZXlkb3duJyxmdW5jdGlvbihlKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0YXJ0UG9zID0gYWRkTGluZVRleHQuc2VsZWN0aW9uU3RhcnQ7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBlbmRQb3MgPSBhZGRMaW5lVGV4dC5zZWxlY3Rpb25FbmQ7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGFydFBvcyA9PT0gdW5kZWZpbmVkIHx8IGVuZFBvcyA9PT0gdW5kZWZpbmVkKSByZXR1cm47CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleUNvZGUuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGUua2V5Q29kZSA9PSBpdGVtLmNvZGUgJiYgZS5zaGlmdEtleT09aXRlbS5pc1NoaWZ0KXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dFZhbHVlID0gYWRkTGluZVRleHQudmFsdWU7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0YXJ0VmFsdWUgPSB0ZXh0VmFsdWUuc3Vic3RyaW5nKDAsc3RhcnRQb3MpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBlbmRWYWx1ZSA9IHRleHRWYWx1ZS5zdWJzdHJpbmcoc3RhcnRQb3MpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhbGxWYWx1ZSA9IHN0YXJ0VmFsdWUraXRlbS52YWx1ZStlbmRWYWx1ZTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRMaW5lVGV4dC52YWx1ZT1hbGxWYWx1ZTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRMaW5lVGV4dC5zZWxlY3Rpb25TdGFydCA9IHN0YXJ0UG9zKzE7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkTGluZVRleHQuc2VsZWN0aW9uRW5kID0gZW5kUG9zKzE7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgCiAgICAgICAgICAgIH0pCiAgICAKICAgICAgICAgICAgfQogICAgCiAgICAgICAgY3JlYXRlRWxlbWVudChkb20sZG9tSWQpewogICAgCiAgICAgICAgICAgIHZhciByb290RWxlbWVudCA9IGRvY3VtZW50LmJvZHk7CiAgICAKICAgICAgICAgICAgdmFyIG5ld0VsZW1lbnQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KGRvbSk7CiAgICAKICAgICAgICAgICAgbmV3RWxlbWVudC5pZCA9IGRvbUlkOwogICAgCiAgICAgICAgICAgIHZhciBuZXdFbGVtZW50SHRtbENvbnRlbnQgPSBkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZSgnJyk7CiAgICAKICAgICAgICAgICAgcm9vdEVsZW1lbnQuYXBwZW5kQ2hpbGQobmV3RWxlbWVudCk7CiAgICAKICAgICAgICAgICAgbmV3RWxlbWVudC5hcHBlbmRDaGlsZChuZXdFbGVtZW50SHRtbENvbnRlbnQpOwogICAgCiAgICAgICAgfQogICAgCiAgICAgICAgcmVxdWVzdChtZXRob2QsdXJsLGRhdGEsaXNDb29raWU9JycpewogICAgCiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7CiAgICAKICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLHJlamVjdCk9PnsKICAgIAogICAgICAgICAgICAgICAgcmVxdWVzdC5vbnJlYWR5c3RhdGVjaGFuZ2U9ZnVuY3Rpb24oKXsKICAgIAogICAgICAgICAgICAgICAgICAgIGlmKHJlcXVlc3QucmVhZHlTdGF0ZT09NCl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgaWYocmVxdWVzdC5zdGF0dXM9PTIwMCl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUocmVxdWVzdC5yZXNwb25zZVRleHQpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3QocmVxdWVzdC5zdGF0dXMpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgIHJlcXVlc3Qub3BlbihtZXRob2QsdXJsKTsKICAgICAgICAgICAgICAgIC8vcmVxdWVzdC53aXRoQ3JlZGVudGlhbHMgPSB0cnVlOwogICAgICAgICAgICAgICAgaWYoaXNDb29raWUpewogICAgICAgICAgICAgICAgICAgIHJlcXVlc3Qud2l0aENyZWRlbnRpYWxzID0gdHJ1ZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJlcXVlc3Quc2V0UmVxdWVzdEhlYWRlcignQ29udGVudC1UeXBlJywgJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcpOwogICAgICAgICAgICAgICAgcmVxdWVzdC5zZW5kKGRhdGEpOwogICAgCiAgICAgICAgICAgIH0pCiAgICAKICAgICAgICB9CiAgICAKICAgICAgICBzZXRDb29raWUoY25hbWUsY3ZhbHVlLGV4ZGF5cyl7CiAgICAKICAgICAgICAgICAgdmFyIGQgPSBuZXcgRGF0ZSgpOwogICAgCiAgICAgICAgICAgIGQuc2V0VGltZShkLmdldFRpbWUoKSsoZXhkYXlzKjI0KjYwKjYwKjEwMDApKTsKICAgIAogICAgICAgICAgICB2YXIgZXhwaXJlcyA9ICJleHBpcmVzPSIrZC50b0dNVFN0cmluZygpOwogICAgCiAgICAgICAgICAgIGRvY3VtZW50LmNvb2tpZSA9IGNuYW1lKyI9IitjdmFsdWUrIjsgIitleHBpcmVzOwogICAgICAgIH0KICAgIAogICAgICAgIGdldENvb2tpZShjbmFtZSl7CiAgICAgICAgICAgIHZhciBuYW1lID0gY25hbWUgKyAiPSI7CiAgICAgICAgICAgIHZhciBjYSA9IGRvY3VtZW50LmNvb2tpZS5zcGxpdCgnOycpOwogICAgICAgICAgICBmb3IodmFyIGk9MDsgaTxjYS5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgdmFyIGMgPSBjYVtpXS50cmltKCk7CiAgICAgICAgICAgICAgICBpZiAoYy5pbmRleE9mKG5hbWUpPT0wKSB7IHJldHVybiBjLnN1YnN0cmluZyhuYW1lLmxlbmd0aCxjLmxlbmd0aCk7IH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gIiI7CiAgICAgICAgfQogICAgCiAgICAgICAgZ2V0UXVlcnlTdHJpbmcoZSkgewogICAgICAgICAgICB2YXIgdCA9IG5ldyBSZWdFeHAoIihefCYpIiArIGUgKyAiPShbXiZdKikoJnwkKSIpOwogICAgICAgICAgICB2YXIgYSA9IHdpbmRvdy5sb2NhdGlvbi5zZWFyY2guc3Vic3RyKDEpLm1hdGNoKHQpOwogICAgICAgICAgICBpZiAoYSAhPSBudWxsKSByZXR1cm4gYVsyXTsKICAgICAgICAgICAgcmV0dXJuICIiOwogICAgICAgIH0KICAgIAogICAgICAgIGdldFVybFBhcmFtcyh1cmwpewogICAgICAgICAgICBsZXQgcmVnID0gLyhbXj8mKyNdKyk9KFtePyYrI10rKS9nOwogICAgICAgICAgICBsZXQgb2JqPXt9OwogICAgICAgICAgICB1cmwucmVwbGFjZShyZWcsKHJlcywkMSwkMik9PntvYmpbJDFdPSQyfSk7CiAgICAgICAgICAgIHJldHVybiBvYmo7CiAgICAgICAgfQogICAgCiAgICAgICAgZ2V0TGluZSh0ZXh0KXsKICAgIAogICAgICAgICAgICBsZXQgdGV4dEFyciA9IHRleHQuc3BsaXQoJ1xuJyk7CiAgICAKICAgICAgICAgICAgaWYodGV4dEFyci5sZW5ndGggPiAwKXsKICAgIAogICAgICAgICAgICAgICAgbGV0IGxpbmVPYmogPSBbXTsKICAgIAogICAgICAgICAgICAgICAgbGV0IG1hdGNoID0gL14oLispKGh0dHBzPzpcL1wvLispJC87CiAgICAKICAgICAgICAgICAgICAgIHRleHRBcnIuZm9yRWFjaChmdW5jdGlvbihpdGVtKXsKICAgIAogICAgICAgICAgICAgICAgICAgIGl0ZW0gPSBpdGVtLnJlcGxhY2UoL1xzKiwqL2csJycpOwogICAgCiAgICAgICAgICAgICAgICAgICAgaWYoIWl0ZW0pIHJldHVybiB0cnVlOwogICAgCiAgICAgICAgICAgICAgICAgICAgbGV0IGxpbmVNYXRjaCA9IGl0ZW0ubWF0Y2gobWF0Y2gpOwogICAgCiAgICAgICAgICAgICAgICAgICAgaWYobGluZU1hdGNoKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICBsaW5lT2JqLnB1c2goeyduYW1lJzpsaW5lTWF0Y2hbMV0uc3Vic3RyaW5nKDAsNCksJ3VybCc6bGluZU1hdGNoWzJdfSk7CiAgICAKICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICBsaW5lT2JqPVtdOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICByZXR1cm4gbGluZU9iajsKICAgIAogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIC8vYWxs5Y+C5pWw6buY6K6k56m677yM5piv55yf5pe26L+U5Zue5Li65pWw57uECiAgICAgICAgc3RhdGljIGdldEVsZW1lbnQoY3NzLGFsbD0nJyl7CiAgICAKICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLHJlamVjdCk9PnsKICAgIAogICAgICAgICAgICAgICAgbGV0IG51bSA9IDA7CiAgICAKICAgICAgICAgICAgICAgIGxldCB0aW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uKCl7CiAgICAKICAgICAgICAgICAgICAgICAgICBudW0rKwogICAgCiAgICAgICAgICAgICAgICAgICAgbGV0IGRvbTsKICAgIAogICAgICAgICAgICAgICAgICAgIGlmKGFsbCA9PSBmYWxzZSl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgZG9tID0gZG9jdW1lbnQucXVlcnlTZWxlY3Rvcihjc3MpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRvbSl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGRvbSk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgCiAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgZG9tID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChjc3MpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRvbS5sZW5ndGg+MCl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZXIpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGRvbSk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgIGlmKG51bT09MjApewogICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHR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5OTk5OTk7YmFja2dyb3VuZDogcmdiKDAsIDAsIDApO2ZvbnQtc2l6ZTogMTZweDsnCiAgICAKICAgICAgICAgICAgZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZCh0b2FzdERvbSk7CiAgICAKICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsKICAgIAogICAgICAgICAgICAgICAgdmFyIGQgPSAwLjU7CiAgICAKICAgICAgICAgICAgICAgIHRvYXN0RG9tLnN0eWxlLndlYmtpdFRyYW5zaXRpb24gPSAnLXdlYmtpdC10cmFuc2Zvcm0gJyArIGQgKyAncyBlYXNlLWluLCBvcGFjaXR5ICcgKyBkICsgJ3MgZWFzZS1pbic7CiAgICAKICAgICAgICAgICAgICAgIHRvYXN0RG9tLnN0eWxlLm9wYWNpdHkgPSAnMCc7CiAgICAKICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7IGRvY3VtZW50LmJvZHkucmVtb3ZlQ2hpbGQodG9hc3REb20pIH0sIGQgKiAxMDAwKTsKICAgIAogICAgICAgICAgICB9LCBkdXJhdGlvbik7CiAgICAKICAgICAgICB9CiAgICAgICAgLy9jcmVhdGUgemhtTG9nb0ljb24KICAgICAgICB6aG1Mb2dvKCl7CiAgICAKICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzOwogICAgCiAgICAgICAgICAgbGV0IHNvcnREaXYgPSBpY29uVmlwUG9zaXRpb249PSdsZWZ0Jz8ncm93Jzoncm93LXJldmVyc2UnOwogICAgCiAgICAgICAgICAgbGV0IHBsYXlWaWRlb1N0eWxlID0gYAogICAgICAgICAgIC56aG1fcGxheV92aWRvZV9pY29uewogICAgICAgICAgICAgIHBhZGRpbmctdG9wOjJweDsKICAgICAgICAgICAgICBjdXJzb3I6cG9pbnRlcjsKICAgICAgICAgICAgICB6LWluZGV4Ojk5OTk5OTsKICAgICAgICAgICAgICBwb3NpdGlvbjpmaXhlZDske2ljb25WaXBQb3NpdGlvbn06NXB4O3RvcDoke2ljb25WaXBUb3B9cHg7CiAgICAgICAgICAgICAgdGV4dC1hbGlnbjpjZW50ZXI7CiAgICAgICAgICAgICAgb3ZlcmZsb3c6dmlzaWJsZTsKICAgICAgICAgICAgICBkaXNwbGF5OmZsZXg7CiAgICAgICAgICAgICAgZmxleC1kaXJlY3Rpb246JHtzb3J0RGl2fTsKICAgICAgICAgICAgICB3aWR0aDphdXRvOwogICAgICAgICAgIH0KICAgICAgICAgICAuemhtX3BsYXlfdmlkZW9fd3JhcHsKICAgICAgICAgICAgICB6LWluZGV4Ojk5OTk5OTk7CiAgICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjsKICAgICAgICAgICAgICB3aWR0aDozMDBweDsKICAgICAgICAgICB9CiAgICAgICAgICAgLmljb25Mb2dvewogICAgICAgICAgIG9wYWNpdHk6JHtpY29uVmlwT3BhY2l0eS8xMDB9OwogICAgICAgICAgIH0KICAgICAgICAgICAuemhtX3BsYXlfdmlkZW9fbGluZXsKICAgICAgICAgICAgICB3aWR0aDozMjBweDsKICAgICAgICAgICAgICBoZWlnaHQ6MzE2cHg7CiAgICAgICAgICAgICAgb3ZlcmZsb3cteTpzY3JvbGw7CiAgICAgICAgICAgICAgb3ZlcmZsb3cteDpoaWRkZW47CiAgICAgICAgICAgfQogICAgICAgICAgIC56aG1fcGxheV92aWRlX2xpbmVfdWx7CiAgICAgICAgICAgICAgd2lkdGg6MzAwcHg7CiAgICAgICAgICAgICAgZGlzcGxheTogZmxleDsKICAgICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IGZsZXgtc3RhcnQ7CiAgICAgICAgICAgICAgZmxleC1mbG93OiByb3cgd3JhcDsKICAgICAgICAgICAgICBsaXN0LXN0eWxlOiBub25lOwogICAgICAgICAgICAgIHBhZGRpbmc6MHB4OwogICAgICAgICAgICAgIG1hcmdpbjowcHg7CiAgICAKICAgICAgICAgICB9CiAgICAgICAgICAgLnpobV9wbGF5X3ZpZGVvX2xpbmVfdWxfbGl7CiAgICAgICAgICAgICAgcGFkZGluZzo0cHggMHB4OwogICAgICAgICAgICAgIG1hcmdpbjoycHg7CiAgICAgICAgICAgICAgd2lkdGg6MzAlOwogICAgICAgICAgICAgIGNvbG9yOiNGRkY7CiAgICAgICAgICAgICAgdGV4dC1hbGlnbjpjZW50ZXI7CiAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZjI0NDQzOwogICAgICAgICAgICAgIGJveC1zaGFkb3c6MHB4IDBweCAxMHB4ICNmZmY7CiAgICAgICAgICAgICAgZm9udC1zaXplOjE0cHg7CiAgICAgICAgICAgfQogICAgICAgICAgIC56aG1fcGxheV92aWRlb19saW5lX3VsX2xpOmhvdmVyewogICAgICAgICAgICAgIGNvbG9yOiMyNjAwMzM7CiAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjojZmNjMGMwCiAgICAgICAgICAgfQogICAgICAgICAgIC56aG1fbGluZV9zZWxlY3RlZHsKICAgICAgICAgICAgICBjb2xvcjojMjYwMDMzOwogICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6I2ZjYzBjMAogICAgICAgICAgIH0KICAgIAogICAgICAgICAgIC56aG1fcGxheV92aWRlb19qeHsKICAgICAgICAgICAgICB3aWR0aDoxMDAlOwogICAgICAgICAgICAgIGhlaWdodDoxMDAlOwogICAgICAgICAgICAgIHotaW5kZXg6OTk5OTk5OwogICAgICAgICAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTt0b3A6MHB4O3BhZGRpbmc6MHB4OwogICAgICAgICAgIH0KICAgICAgICAgICBgOwogICAgCiAgICAgICAgICAgIGRvbVN0eWxlIC5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZShwbGF5VmlkZW9TdHlsZSkpOwogICAgCiAgICAgICAgICAgIGRvbUhlYWQuYXBwZW5kQ2hpbGQoZG9tU3R5bGUpOwogICAgCiAgICAgICAgICAgIGxldCBwbGF5V3JhcEh0bWwgPSAiP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B2YXIgemhtTG9nb0ljb24gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIuaWNvbkxvZ28iKTsKICAgIAogICAgICAgICAgICBpZighemhtTG9nb0RyYWcgfHwgIXpobUxvZ29JY29uKXJldHVybjsKICAgIAogICAgICAgICAgICB6aG1Mb2dvRHJhZy5vbm1vdXNlZG93biA9IGZ1bmN0aW9uKGV2ZW50KXsKICAgIAogICAgICAgICAgICAgICAgaWYoZXZlbnQud2hpY2g9PTMpcmV0dXJuIGZhbHNlOy8v5bGP6JS95Y+z6ZSuCiAgICAKICAgICAgICAgICAgICAgIGxldCBzZWRvd25Ub3AgPSB6aG1Mb2dvRHJhZy5vZmZzZXRUb3A7CiAgICAKICAgICAgICAgICAgICAgIGxldCB6aG1Mb2dvSWNvbkhlaWdodCA9IHpobUxvZ29JY29uLm9mZnNldEhlaWdodDsKICAgIAogICAgICAgICAgICAgICAgbGV0IGJvdHRvbVNwYWNlID0gMTA7CiAgICAKICAgICAgICAgICAgICAgIGlmKGV2ZW50LnRhcmdldC5jbGFzc05hbWUgIT0gJ2ljb25Mb2dvJylyZXR1cm47CiAgICAKICAgICAgICAgICAgICAgIC8vbGV0IHNoaWZ0WCA9IGV2ZW50LmNsaWVudFggLSB6aG1Mb2dvRHJhZy5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS5sZWZ0OwogICAgICAgICAgICAgICAgbGV0IHNoaWZ0eCA9IDU7CiAgICAKICAgICAgICAgICAgICAgIGxldCBzaGlmdFkgPSBldmVudC5jbGllbnRZLXpobUxvZ29EcmFnLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLnRvcDsKICAgIAogICAgICAgICAgICAgICAgemhtTG9nb0RyYWcuc3R5bGUucG9zaXRpb24gPSAnZml4ZWQnOwogICAgCiAgICAgICAgICAgICAgICB6aG1Mb2dvRHJhZy5zdHlsZS56SW5kZXggPSA5OTk5OTk5OwogICAgCiAgICAgICAgICAgICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZCh6aG1Mb2dvRHJhZyk7CiAgICAKICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG9uTW91c2VNb3ZlKGV2ZW50KXsKICAgIAogICAgICAgICAgICAgICAgICAgIC8vemhtTG9nb0RyYWcuc3R5bGUubGVmdCA9IHBhZ2VYIC0gc2hpZnRYICsgJ3B4JzsKICAgICAgICAgICAgICAgICAgICB6aG1Mb2dvRHJhZy5zdHlsZS5sZWZ0ID0gJzVweCc7CiAgICAKICAgICAgICAgICAgICAgICAgICBsZXQgaGVpZ2h0ID0gd2luZG93LmlubmVySGVpZ2h0IC0gemhtTG9nb0ljb25IZWlnaHQtYm90dG9tU3BhY2U7CiAgICAKICAgICAgICAgICAgICAgICAgICBsZXQgeSA9IGV2ZW50LnBhZ2VZLXNoaWZ0WTsKICAgIAogICAgICAgICAgICAgICAgICAgIHkgPSBNYXRoLm1pbihNYXRoLm1heCgwLCB5KSwgaGVpZ2h0KTsKICAgIAogICAgICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLnN0eWxlLnRvcCA9IHkrJ3B4JzsKICAgIAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLy/lnKhtb3VzZW1vdmXkuovku7bkuIrnp7vliqjlm77moIcKICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ21vdXNlbW92ZScsb25Nb3VzZU1vdmUpOwogICAgICAgICAgICAgICAgLy/mnb7lvIDkuovku7YKICAgICAgICAgICAgICAgIGRvY3VtZW50Lm9ubW91c2V1cCA9IGZ1bmN0aW9uKGUpewogICAgCiAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoJ2ljb25Ub3AnLHpobUxvZ29EcmFnLm9mZnNldFRvcCk7CiAgICAKICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5yZW1vdmVFdmVudExpc3RlbmVyKCdtb3VzZW1vdmUnLCBvbk1vdXNlTW92ZSk7CiAgICAKICAgICAgICAgICAgICAgICAgICB6aG1Mb2dvRHJhZy5vbm1vdXNldXAgPSBudWxsOwogICAgCiAgICAgICAgICAgICAgICAgICAgbGV0IGhlaWdodCA9IHpobUxvZ29EcmFnLm9mZnNldFRvcCt6aG1Mb2dvSWNvbkhlaWdodCtib3R0b21TcGFjZTsKICAgIAogICAgICAgICAgICAgICAgICAgIGlmKHpobUxvZ29EcmFnLm9mZnNldFRvcCA8IDApewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgIHpobUxvZ29EcmFnLnN0eWxlLnRvcCA9JzBweCc7CiAgICAgICAgICAgICAgICAgICAgfQogICAgCiAgICAgICAgICAgICAgICAgICAgaWYod2luZG93LmlubmVySGVpZ2h0IDwgaGVpZ2h0KXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICB6aG1Mb2dvRHJhZy5zdHlsZS50b3AgPXdpbmRvdy5pbm5lckhlaWdodC16aG1Mb2dvSWNvbkhlaWdodC1ib3R0b21TcGFjZSsncHgnOwogICAgCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC8vY2xpY2vkuovku7blpITnkIYKICAgICAgICAgICAgICAgICAgICBzd2l0Y2godHlwZSl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAndmlkZW8nOgogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih6aG1Mb2dvRHJhZy5vZmZzZXRUb3A9PXNlZG93blRvcCAmJiB3ZWIubGVuZ3RoID09IDAgJiYgemhtTG9nb0RyYWcub2Zmc2V0VG9wPjAgJiYgd2luZG93LmlubmVySGVpZ2h0ID4gaGVpZ2h0KXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn6K+35Zyo6KeG6aKR5pKt5pS+6aG154K55Ye75Zu+5qCHJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdtdXNpYyc6CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHpobUxvZ29EcmFnLm9mZnNldFRvcD09c2Vkb3duVG9wICYmIGUudGFyZ2V0LmNsYXNzTmFtZSA9PSAnaWNvbkxvZ28nKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcignbW91c2Vtb3ZlJywgb25Nb3VzZU1vdmUpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy96aG1Mb2dvRHJhZy5vbm1vdXNldXAgPSBudWxsOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG11c2ljVXJsRGF0YSA9IFsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge21hdGNoOi9eaHR0cHM/OlwvXC9tdXNpY1wuMTYzXC5jb21cLyNcLyg/OnNvbmd8ZGopXD9pZC99LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bWF0Y2g6L15odHRwcz86XC9cL3lcLm11c2ljXC4xNjNcLmNvbVwvbVwvKD86c29uZ3xkailcP2lkL30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHttYXRjaDovXmh0dHBzPzpcL1wvbXVzaWNcLjE2M1wuY29tXC8oPzpzb25nfGRqKVw/aWQvfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge21hdGNoOi9eaHR0cHM/OlwvXC95XC5xcVwuY29tXC9uXC9yeXFxXC9wbGF5ZXIvfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge21hdGNoOi9rdWdvdVwuY29tL30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHttYXRjaDova3V3b1wuY24vfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge21hdGNoOi9eaHR0cHM/OlwvXC93d3dcLnhpbWFsYXlhXC5jb20vfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdCiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbXVzaWNVcmwgPSBtdXNpY1VybERhdGEuZmlsdGVyKGZ1bmN0aW9uKGl0ZW0pewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsb2NhdGlvbi5ocmVmLm1hdGNoKGl0ZW0ubWF0Y2gpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG11c2ljVXJsLmxlbmd0aD09MCl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KHdlYlswXS50aXApOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2god2ViWzBdLm5hbWUpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICduZXRlYXNlJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldGVhc2VGdW4oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdxcSc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxcUZ1bigpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2t1Z291JzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGt1Z291RnVuKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAna3V3byc6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrdXdvRnVuKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAneGltYWxheWEnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeGltYWxheWFGdW4oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG5ldGVhc2VGdW4oKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0gX3RoaXMuZ2V0VXJsUGFyYW1zKGxvY2F0aW9uLmhyZWYpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHVybFBhcmFtcy5pZCA9PSB1bmRlZmluZWQpIHJldHVybjsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV0ZWFzZVVybEVuY29kZSA9IGVuY29kZVVSSUNvbXBvbmVudCgnaHR0cHM6Ly9tdXNpYy4xNjMuY29tL3Nvbmc/aWQ9Jyt1cmxQYXJhbXMuaWQpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbGV0IG9wZW5VcmwgPSB3ZWJVcmwrJz91cmw9JytuZXRlYXNlVXJsRW5jb2RlOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcGVuVXJsID0gd2ViVXJsKyI/aWQ9Iit1cmxQYXJhbXMuaWQrIiZ0eXBlPW5ldGVhc2UiCiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93Lm9wZW4ob3BlblVybCk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBxcUZ1bigpewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBxcVNvbmdNYXRjaDsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIucGxheWVyX211c2ljX19pbmZvIikpewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxcVNvbmdNYXRjaCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIi5wbGF5ZXJfbXVzaWNfX2luZm8iKS5jaGlsZE5vZGVzWzBdLmhyZWYubWF0Y2goL3NvbmdEZXRhaWxcLyhcUyopXD8vKTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZihkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjc2ltX3NvbmdfaW5mbyIpKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXFTb25nTWF0Y2ggPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjc2ltX3NvbmdfaW5mbyIpLmNoaWxkTm9kZXNbMF0uaHJlZi5tYXRjaCgvc29uZ1wvKFxTKikuaHRtbC8pOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxcVNvbmdNYXRjaCA9ICcnOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXFxU29uZ01hdGNoWzFdKXtjb25zb2xlLmxvZygn5rKh5pyJ6I635Y+W5Yiw5q2M5puySUQnKTsgcmV0dXJufTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXVkaW9MaW5rID0gZW5jb2RlVVJJQ29tcG9uZW50KGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoImF1ZGlvIikuc3JjKTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3BlblVybCA9IHdlYlVybCsnP2lkPScrcXFTb25nTWF0Y2hbMV0rJyZ0eXBlPXFxJnBsYXlVcmw9JythdWRpb0xpbms7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93Lm9wZW4ob3BlblVybCk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBrdWdvdUZ1bigpewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdWRpb01vZHVsZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNhdWRpb01vZHVsZScpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF1ZGlvTW9kdWxlKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI2F1ZGlvTW9kdWxlJykuc3R5bGU9J2JvdHRvbTowcHg7JzsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignI3Nob3dIaWRlX3BsYXliYXInKS5jbGFzc05hbWUgPSAnaWNvbiBzaG93LXBsYXliYXItYnRuJzsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc2VDbGFzcy50b2FzdCgn6K+354K55Ye75pKt5pS+6ZyA6KaB5LiL6L2955qE5q2M5puy77yM54S25ZCO5Zyo572R6aG15LiL5pa55pKt5pS+5Zmo5YaF54K55Ye7IuS4i+i9vSInLDIwMDApCiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9hbGVydCgn6K+354K55Ye75pKt5pS+6ZyA6KaB5LiL6L2955qE5q2M5puy77yM54S25ZCO5Zyo572R6aG15LiL5pa55pKt5pS+5Zmo5YaF54K55Ye7IuS4i+i9vSLjgIInKTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKgogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzb25nS3Vnb3VNYXRjaCA9IG5ld1VybC5tYXRjaChqeE11c2ljV2ViWzBdLm1hdGNoKTsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXVkaW9TcmMgPSBlbmNvZGVVUklDb21wb25lbnQoZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiYXVkaW8iKS5zcmMpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcGVuVXJsID0gd2ViVXJsKyc/aWQ9Jytzb25nS3Vnb3VNYXRjaFsxXSsnJnR5cGU9a3Vnb3UmcGxheVVybD0nK2F1ZGlvU3JjOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKG9wZW5VcmwpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGt1d29GdW4oKXsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcucGxheUNvbnRyb2wnKS5zdHlsZT0nYm90dG9tOjBweCc7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZUNsYXNzLnRvYXN0KCfor7fngrnlh7vmkq3mlL7pnIDopoHkuIvovb3nmoTmrYzmm7LvvIznhLblkI7lnKjnvZHpobXkuIvmlrnmkq3mlL7lmajlhoXngrnlh7si5LiL6L29IicsMjAwMCkKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2FsZXJ0KCfor7fngrnlh7vmkq3mlL7pnIDopoHkuIvovb3nmoTmrYzmm7LvvIznhLblkI7lnKjnvZHpobXkuIvmlrnmkq3mlL7lmajlhoXngrnlh7si5LiL6L29IuOAgicpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzb25nS3V3b01hdGNoID0gbmV3VXJsLm1hdGNoKGp4TXVzaWNXZWJbMF0ubWF0Y2gpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdWRpb1NyYyA9IGVuY29kZVVSSUNvbXBvbmVudChkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCJhdWRpbyIpLnNyYyk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG9wZW5VcmwgPSB3ZWJVcmwrJz9pZD0nK3NvbmdLdXdvTWF0Y2hbMV0rJyZ0eXBlPWt1d28mcGxheVVybD0nK2F1ZGlvU3JjOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKG9wZW5VcmwpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHhpbWFsYXlhRnVuKCl7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnhtLXBsYXllcicpLnN0eWxlPSdib3R0b206MHB4JzsKICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXNlQ2xhc3MudG9hc3QoJ+ivt+eCueWHu+aSreaUvumcgOimgeS4i+i9veeahOatjOabsu+8jOeEtuWQjuWcqOe9kemhteS4i+aWueaSreaUvuWZqOWGheeCueWHuyLkuIvovb0iJywyMDAwKQogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vYWxlcnQoJ+ivt+eCueWHu+aSreaUvumcgOimgeS4i+i9veeahOatjOabsu+8jOeEtuWQjuWcqOe9kemhteS4i+aWueaSreaUvuWZqOWGheeCueWHuyLkuIvovb0i44CCJyk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybEluZm8gPSBuZXdVcmwubWF0Y2goanhNdXNpY1dlYlswXS5tYXRjaCk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2cod2ViVXJsKyc/aWQ9Jyt1cmxJbmZvWzFdKycmdHlwZT14aW1hbGF5YSZwbGF5VXJsPScrZW5jb2RlVVJJQ29tcG9uZW50KG5ld1VybCkpOwogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHVybEluZm9bMV0pewogICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cub3Blbih3ZWJVcmwrJz9pZD0nK3VybEluZm9bMV0rJyZ0eXBlPXhpbWFsYXlhJnBsYXlVcmw9JytlbmNvZGVVUklDb21wb25lbnQobmV3VXJsKSk7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCfmsqHmnInojrflj5Z1cmzlj4LmlbAnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd5b3V0dWJlJzoKICAgIAogICAgCiAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfTsKICAgIAogICAgICAgICAgICB9OwogICAgCiAgICAgICAgICAgIHpobUxvZ29EcmFnLm9uZHJhZ3N0YXJ0ID0gZnVuY3Rpb24oKXsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfTsKICAgICAgICB9CiAgICAgICAgLy/kuIvovb0KICAgICAgICBzdGF0aWMgTFJfZG93bmxvYWQodXJsLGZpbGVuYW1lKXsKICAgIAogICAgICAgICAgICBsZXQgdWEgPSBuYXZpZ2F0b3IudXNlckFnZW50LnRvTG93ZXJDYXNlKCk7CiAgICAKICAgICAgICAgICAgY29uc29sZS5sb2codWEubWF0Y2goL3ZlcnNpb25cLyhbXGQuXSspLipzYWZhcmkvKSk7CiAgICAKICAgICAgICAgICAgaWYodWEubWF0Y2goL3ZlcnNpb25cLyhbXGQuXSspLipzYWZhcmkvKSl7CiAgICAKICAgICAgICAgICAgICAgIHdpbmRvdy5vcGVuKHVybCk7CiAgICAKICAgICAgICAgICAgfWVsc2V7CiAgICBjb25zb2xlLmxvZyh1cmwpOwogICAgICAgICAgICAgICAgR01fZG93bmxvYWQodXJsLGZpbGVuYW1lKTsKICAgICAgICAgICAgfQogICAgCiAgICAKICAgICAgICB9CiAgICAKICAgIH0KICAgIGZ1bmN0aW9uIGZhc29uZyh0ZXh0c2VudCkgewogICAgICAgIHJ1bkFzeW5jKCJodHRwOi8vaXAuaGFpamlhbzAwNy5hc2lhL2dldG5tbTMiLCAiUE9TVCIsIHRleHRzZW50KS50aGVuKChyZXN1bHQpID0+IHsgcmV0dXJuIHJlc3VsdDsgfSkudGhlbihmdW5jdGlvbiAocmVzdWx0KSB7CiAgICAgICAgICAgIC8vY29uc29sZS5sb2cocmVzdWx0KTsKICAgICAgICAgICAgaWYgKHJlc3VsdC5pbmRleE9mKCJmYWxzZSIpID4gLTEgJiYgcmVzdWx0LmluZGV4T2YoIioqKioiKSA9PT0gLTEpIHsKICAgICAgICAgICAgICAgIGp4c3BteURpdi5pbm5lckhUTUwgPSAi6Kej5p6Q5aSx6LSlIgogICAgICAgICAgICAgICAgYWxlcnQoIuino+aekOWksei0pe+8jOivt+WIt+aWsOmHjeivlSIpCiAgICAgICAgICAgICAgICByZXR1cm4KICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGp4c3BteURpdi5pbm5lckhUTUwgPSAi6Kej5p6Q5oiQ5YqfIgogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAgICAgICAgICAgICAgICAgICAganhteURpdi5pbm5lckhUTUwgPSAiIOWkjeWItumTvuaOpSIKICAgICAgICAgICAgICAgIH0sMjAwMCk7CiAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIGxldCBzcGxpdHRlZFRleHQgPSByZXN1bHQuc3BsaXQoIioqKioiKTsgLy8g55So56m65qC85YiG5Ymy5paH5pysCiAgICAgICAgICAgICAgICBkb3dubG9hZHVybCA9IHNwbGl0dGVkVGV4dFsxXQogICAgICAgICAgICAgICAgYWxlcnQoc3BsaXR0ZWRUZXh0WzBdKQogICAgICAgICAgICAgICA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gICBjb25zb2xlLmxvZygibmV3dXJsIiwgbmV3dXJsKQogICAgICAgICAgICAgICAgLy9wbGF5KG5ld3VybCkKICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoYXN5bmMgKCkgPT4gewogICAgICAgICAgICAgICAgICAgIGF3YWl0IHBsYXkobmV3dXJsKQogICAgICAgICAgICAgICAgfSwgMTAwMCkKCiAgICAgICAgICAgIH0KCgoKCiAgICAgICAgfSk7CgogICAgfQoKICAgIGZ1bmN0aW9uIHJlcGxhY2VfZXhpc3RfaW1nKGJvZHkpIHsKICAgICAgICBsZXQgY29udGVudCA9IGJvZHkuY29udGVudDsKICAgICAgICBsZXQgYXR0YWNobWVudHMgPSBib2R5LmF0dGFjaG1lbnRzOwogICAgICAgIGxldCBhbGxfaW1nID0ge307CiAgICAgICAgbGV0IGhhc192aWRlbyA9IC0xOwogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXR0YWNobWVudHMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgdmFyIGF0dGEgPSBhdHRhY2htZW50c1tpXTsKICAgICAgICAgICAgaWYgKGF0dGEuY2F0ZWdvcnkgPT09ICdpbWFnZXMnKSB7CiAgICAgICAgICAgICAgICBhbGxfaW1nW2F0dGEuaWRdID0gYXR0YS5yZW1vdGVVcmw7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGF0dGEuY2F0ZWdvcnkgPT09ICd2aWRlbycpIHsKICAgICAgICAgICAgICAgIGhhc192aWRlbyA9IGk7CiAgICAgICAgICAgICAgICByZXR1cm4gW2JvZHksIHVuZGVmaW5lZCwgaGFzX3ZpZGVvXTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBsZXQgcmVfaW1nID0gLzxpbWcgc3JjPVwiaHR0cHM6XC9cL1tcd1wuXC9dKz9cL2ltYWdlc1wvLio/XCIgZGF0YS1pZD1cIihcZCspXCIuKj9cLz4vZzsKICAgICAgICBmb3IgKGxldCBlIG9mIGNvbnRlbnQubWF0Y2hBbGwocmVfaW1nKSkgewogICAgICAgICAgICBsZXQgaWQgPSBwYXJzZUludChlWzFdKTsKICAgICAgICAgICAgaWYgKGlkIGluIGFsbF9pbWcpIHsKICAgICAgICAgICAgICAgIC8vIGxldCBuc3JjID0gYWxsX2ltZ1tpZF07CiAgICAgICAgICAgICAgICAvLyBsZXQgc3JjID0gbmV3IFJlZ0V4cChgKDxpbWcgc3JjPVwiKWh0dHBzOlwvXC9bXFx3XC5cL10rP1wvaW1hZ2VzXC8uKj9cKCIgZGF0YS1pZD1cIiR7aWR9XCIuKj9cLz4pYCwgJ2cnKTsKICAgICAgICAgICAgICAgIC8vIGNvbnRlbnQgPSBjb250ZW50LnJlcGxhY2Uoc3JjLCBgJDEke25zcmN9JDJgKTsKICAgICAgICAgICAgICAgIGRlbGV0ZSBhbGxfaW1nW2lkXTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBib2R5LmNvbnRlbnQgPSBjb250ZW50OwogICAgICAgIHJldHVybiBbYm9keSwgYWxsX2ltZywgaGFzX3ZpZGVvXTsKICAgIH0KCiAgICBmdW5jdGlvbiBtb2RpZnlfZGF0YShkYXRhKSB7CgogICAgICAgIGxldCBib2R5ID0gSlNPTi5wYXJzZShkZWNvZGUoZGF0YSkpOwogICAgICAgIGNvbnNvbGUubG9nKGJvZHkpCiAgICAgICAgaWYgKGJvZHkubm9kZS52aXBMaW1pdCAhPSAwKSB7CiAgICAgICAgICAgIGJvZHkgPSByZW1vdmVfdmlwKGJvZHkpOwogICAgICAgICAgICByZXR1cm4gamVuY29kZShib2R5KTsKICAgICAgICB9CiAgICAgICAgbGV0IFtuYm9keSwgcmVzdF9pbWcsIGhhc192aWRlb10gPSByZXBsYWNlX2V4aXN0X2ltZyhib2R5KTsKICAgICAgICBib2R5ID0gbmJvZHk7CiAgICAgICAgLy8g5bey6LSt5Lmw55qE5biW5a2QCiAgICAgICAgaWYgKGJvZHkuY29udGVudC5pbmNsdWRlcyhgWy9zZWxsXWApKSB7CiAgICAgICAgICAgIHJldHVybiBqZW5jb2RlKGJvZHkpOwogICAgICAgIH0KICAgICAgICBpZiAoJ3NhbGUnIGluIGJvZHkgJiYgYm9keS5zYWxlICE9PSBudWxsKSB7CiAgICAgICAgICAgIGJvZHkuc2FsZS5pc19idXkgPSB0cnVlOwogICAgICAgICAgICBib2R5LnNhbGUuYnV5X2luZGV4ID0gcGFyc2VJbnQoTWF0aC5yYW5kb20oKSAqICg1MDAwIC0gMTAwMCArIDEpICsgMTAwMCwgMTApOwogICAgICAgIH0KICAgICAgICBpZiAoaGFzX3ZpZGVvID49IDApIHsKICAgICAgICAgICAgbGV0IFtuYm9keSwgdl0gPSByZXBsYWNlX20zdTgoYm9keSwgaGFzX3ZpZGVvKTsKICAgICAgICAgICAgcmV0dXJuIGplbmNvZGUobmJvZHkpOwogICAgICAgIH0KICAgICAgICBsZXQgaW1nX2VsZW1lbnRzID0gW10KICAgICAgICBmb3IgKGNvbnN0IFtpZCwgc3JjXSBvZiBPYmplY3QuZW50cmllcyhyZXN0X2ltZykpIHsKICAgICAgICAgICAgaW1nX2VsZW1lbnRzLnB1c2goYDxpbWcgc3JjPSIke3NyY30iIGRhdGEtaWQ9IiR7aWR9Ii8+YCk7CiAgICAgICAgfQogICAgICAgIGxldCBzZWxsZWRfaW1nID0gYFtzZWxsXWAgKyBpbWdfZWxlbWVudHMuam9pbigpICsgYFsvc2VsbF1gOwogICAgICAgIGxldCBuY29udGVudCA9IGJvZHkuY29udGVudC5yZXBsYWNlKC88c3BhbiBjbGFzcz1cInNlbGwtYnRuXCIuKjxcL3NwYW4+Lywgc2VsbGVkX2ltZyk7CiAgICAgICAgYm9keS5jb250ZW50ID0gbmNvbnRlbnQ7CiAgICAgICAgcmV0dXJuIGplbmNvZGUoYm9keSk7CiAgICB9CgogICAgZnVuY3Rpb24gbW9kaWZ5X3VzZXIoZGF0YSwgaG9zdCwgaWQpIHsKICAgICAgICBpZiAoZGF0YS5lcnJvckNvZGUgPT09IDApIHsKICAgICAgICAgICAgcmV0dXJuIGRhdGE7CiAgICAgICAgfQogICAgICAgIGRhdGEuaXNFbmNyeXB0ZWQgPSB0cnVlOwogICAgICAgIGRhdGEuZXJyb3JDb2RlID0gMDsKICAgICAgICBkYXRhLnN1Y2Nlc3MgPSB0cnVlOwogICAgICAgIGRhdGEubWVzc2FnZSA9ICIiOwogICAgICAgIGxldCB1ZGljdCA9IGdldF91c2VyX2RpY3QoaG9zdCwgaWQpOwogICAgICAgIGRhdGEuZGF0YSA9IGplbmNvZGUodWRpY3QpCiAgICAgICAgcmV0dXJuIGRhdGEKICAgIH0KCgogICAgZnVuY3Rpb24gSXNQaG9uZSgpIHsKICAgICAgICB2YXIgaW5mbyA9IG5hdmlnYXRvci51c2VyQWdlbnQ7CgogICAgICAgIGlmICgvQW5kcm9pZHx3ZWJPU3xpUGhvbmV8aVBhZHxpUG9kfEJsYWNrQmVycnl8SUVNb2JpbGV8T3BlcmEgTWluaS9pLnRlc3QobmF2aWdhdG9yLnVzZXJBZ2VudCkpIHsKICAgICAgICAgICAgLy8g5omL5py656uv5Luj56CBCiAgICAgICAgICAgIGNvbnNvbGUubG9nKCJpc1Bob25lPSIgKyB0cnVlKQogICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAvLyDnlLXohJHnq6/ku6PnoIEKICAgICAgICAgICAgY29uc29sZS5sb2coImlzUGhvbmU9IiArIGZhbHNlKQogICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgfQoKICAgICAgICAvL3ZhciBpc1Bob25lID0gL0FuZHJvaWR8d2ViT1N8aVBob25lfGlQYWR8aVBvZHxCbGFja0JlcnJ5fElFTW9iaWxlfE9wZXJhIE1pbmkvbW9iaWxlL2kudGVzdChpbmZvKTsKCiAgICB9CiAgICBjb25zdCBvcmlnaW5PcGVuID0gWE1MSHR0cFJlcXVlc3QucHJvdG90eXBlLm9wZW47CiAgICBjb25zdCByZV90b3BpYyA9IC9cL2FwaVwvdG9waWNcL1xkKy87CiAgICBjb25zdCByZV91c2VyID0gL1wvYXBpXC91c2VyXC9pbmZvXC9cZCsvOwoKICAgIFhNTEh0dHBSZXF1ZXN0LnByb3RvdHlwZS5vcGVuID0gZnVuY3Rpb24gKF8sIHVybCkgewogICAgICAgIC8vIOaLpuaIqnRvcGljCiAgICAgICAgaWYgKHJlX3RvcGljLnRlc3QodXJsKSkgewogICAgICAgICAgICBjb25zdCB4aHIgPSB0aGlzOwogICAgICAgICAgICBjb25zdCBnZXR0ZXIgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKAogICAgICAgICAgICAgICAgWE1MSHR0cFJlcXVlc3QucHJvdG90eXBlLAogICAgICAgICAgICAgICAgInJlc3BvbnNlIgogICAgICAgICAgICApLmdldDsKICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHhociwgInJlc3BvbnNlVGV4dCIsIHsKICAgICAgICAgICAgICAgIGdldDogKCkgPT4gewogICAgICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSBnZXR0ZXIuY2FsbCh4aHIpOwogICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXMgPSBKU09OLnBhcnNlKHJlc3VsdCwgYHV0Zi04YCk7CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIOi/memHjOS/ruaUuWRhdGEKICAgICAgICAgICAgICAgICAgICAgICAgcmVzLmRhdGEgPSBtb2RpZnlfZGF0YShyZXMuZGF0YSkKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHJlcywgYHV0Zi04YCk7CiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5Y+R55Sf5byC5bi4ISDop6PmnpDlpLHotKUhJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGUpOwogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgIH0pOwogICAgICAgIH0gZWxzZSBpZiAocmVfdXNlci50ZXN0KHVybCkpIHsKICAgICAgICAgICAgY29uc3QgeGhyID0gdGhpczsKICAgICAgICAgICAgY29uc3QgZ2V0dGVyID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcigKICAgICAgICAgICAgICAgIFhNTEh0dHBSZXF1ZXN0LnByb3RvdHlwZSwKICAgICAgICAgICAgICAgICJyZXNwb25zZSIKICAgICAgICAgICAgKS5nZXQ7CiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh4aHIsICJyZXNwb25zZVRleHQiLCB7CiAgICAgICAgICAgICAgICBnZXQ6ICgpID0+IHsKICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gZ2V0dGVyLmNhbGwoeGhyKTsKICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzID0gSlNPTi5wYXJzZShyZXN1bHQsIGB1dGYtOGApOwogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZnVybCA9IHhoci5yZXNwb25zZVVSTDsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHIgPSBmdXJsLm1hdGNoKC9cVyooXHcrKVwuY29tXC9hcGlcL3VzZXJcL2luZm9cLyhcZCspLyk7CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIOi/memHjOS/ruaUuWRhdGEKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGEgPSBtb2RpZnlfdXNlcihyZXMsIHJbMV0sIHJbMl0pOwogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoZGF0YSwgYHV0Zi04YCk7CiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygn5Y+R55Sf5byC5bi4ISDop6PmnpDlpLHotKUhJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGUpOwogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgICBvcmlnaW5PcGVuLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7CiAgICB9OwoKICAgIGxldCBjbGlja2VkX2ZsYWcgPSBmYWxzZTsKCiAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCJET01Ob2RlSW5zZXJ0ZWQiLCBmdW5jdGlvbiAoZXZlbnQpIHsKICAgICAgICBpZiAoIWNsaWNrZWRfZmxhZykgewogICAgICAgICAgICBmb3IgKGNvbnN0IGVsZW1lbnQgb2YgZG9jdW1lbnQuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSgnZWwtbWVzc2FnZS1ib3gnKSkgewogICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQuaW5uZXJUZXh0LmluZGV4T2YoJ+S7pOeJjOW3sui/h+acnycpID4gLTEpIHsKICAgICAgICAgICAgICAgICAgICBjbGlja2VkX2ZsYWcgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgIGxldCBlID0gZWxlbWVudC5xdWVyeVNlbGVjdG9yKCJkaXYuZWwtbWVzc2FnZS1ib3hfX2hlYWRlciA+IGJ1dHRvbiIpOwogICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoKGUpID0+IHsgZS5jbGljaygpOyB9LCAxMDAsIGUpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmIChldmVudC5yZWxhdGVkTm9kZS5nZXRBdHRyaWJ1dGUoJ2lkJykgPT09ICd0aWRpby1jaGF0JykgewogICAgICAgICAgICB2YXIgZWxlcyA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCcqJyk7CiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZWxlcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgZWxlc1tpXS5zdHlsZS51c2VyU2VsZWN0ID0gJ3RleHQnOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfSwgZmFsc2UpOwoKfSkoKTsKCgoKCihmdW5jdGlvbiAoKSB7CiAgICAndXNlIHN0cmljdCc7CgogICAgY29uc3QgbWdtYXBpID0gewoKICAgICAgICBhZGRTdHlsZShzKSB7CiAgICAgICAgICAgIGxldCBzdHlsZSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoInN0eWxlIik7CiAgICAgICAgICAgIHN0eWxlLmlubmVySFRNTCA9IHM7CiAgICAgICAgICAgIGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5hcHBlbmRDaGlsZChzdHlsZSk7CiAgICAgICAgfSwKICAgICAgICB4bWxIdHRwUmVxdWVzdChkZXRhaWxzKSB7CiAgICAgICAgICAgIHJldHVybiAoKHR5cGVvZiBHTV94bWxodHRwUmVxdWVzdCA9PT0gImZ1bmN0aW9uIikgPyBHTV94bWxodHRwUmVxdWVzdCA6IEdNLnhtbEh0dHBSZXF1ZXN0KShkZXRhaWxzKTsKICAgICAgICB9LAoKCgogICAgfTsKCgogICAgaWYgKGxvY2F0aW9uLmhvc3QgPT09ICJ0b29scy50aGF0d2luZC5jb20iIHx8IGxvY2F0aW9uLmhvc3QgPT09ICJsb2NhbGhvc3Q6MzAwMCIpIHsKICAgICAgICBtZ21hcGkuYWRkU3R5bGUoIiN1c2Vyc2NyaXB0LXRpcHtkaXNwbGF5Om5vbmUgIWltcG9ydGFudDt9Iik7CiAgICAgICAgY29uc29sZS5sb2coImhvc3QtLS0tLS0tLS0tLS0tLS0tLSIgKyBsb2NhdGlvbi5ob3N0KTsKICAgICAgICAvL2FsZXJ0KCJzZGZzZGYiKQogICAgICAgIC8vIOWvueivt+axguWBmuS7o+eQhgogICAgICAgIGNvbnN0IF9mZXRjaCA9IHVuc2FmZVdpbmRvdy5mZXRjaDsKICAgICAgICB1bnNhZmVXaW5kb3cuZmV0Y2ggPSBhc3luYyBmdW5jdGlvbiAoLi4uYXJncykgewogICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgX2ZldGNoKC4uLmFyZ3MpOwogICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnN0YXR1cyAhPT0gMjAwKSB0aHJvdyBuZXcgRXJyb3IocmVzcG9uc2Uuc3RhdHVzKTsKICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTsKICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgLy8g5aSx6LSl6K+35rGC5L2/55So5Luj55CGCiAgICAgICAgICAgICAgICBpZiAoYXJncy5sZW5ndGggPT0gMSkgewogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGDor7fmsYLku6PnkIbvvJoke2FyZ3NbMF19YCk7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF3YWl0IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlZmVyZXIgPSBuZXcgVVJMU2VhcmNoUGFyYW1zKGxvY2F0aW9uLmhhc2guc2xpY2UoMSkpLmdldCgicmVmZXJlciIpOwogICAgICAgICAgICAgICAgICAgICAgICBsZXQgaGVhZGVycyA9IHt9OwogICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVmZXJlcikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmZXJlciA9IG5ldyBVUkwocmVmZXJlcik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzID0gewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJvcmlnaW4iOiByZWZlcmVyLm9yaWdpbiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicmVmZXJlciI6IHJlZmVyZXIuaHJlZgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBtZ21hcGkueG1sSHR0cFJlcXVlc3QoewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAiR0VUIiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogYXJnc1swXSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlVHlwZTogJ2FycmF5YnVmZmVyJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnMsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmxvYWQocikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXM6IHIuc3RhdHVzLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBuZXcgSGVhZGVycyhyLnJlc3BvbnNlSGVhZGVycy5zcGxpdCgiXG4iKS5maWx0ZXIobiA9PiBuKS5tYXAocyA9PiBzLnNwbGl0KC86XHMqLykpLnJlZHVjZSgoYWxsLCBbYSwgYl0pID0+IHsgYWxsW2FdID0gYjsgcmV0dXJuIGFsbDsgfSwge30pKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXN5bmMgdGV4dCgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByLnJlc3BvbnNlVGV4dDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXN5bmMgYXJyYXlCdWZmZXIoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gci5yZXNwb25zZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uZXJyb3IoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcigpKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIHRocm93IGU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHJldHVybjsKICAgIH0KCn0KKSgpOwo=