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JveENvbnRhaW5lci5jbGFzc0xpc3QuYWRkKCJjaGF0Ym94LWxlYXZlZ1RDYjdZa2JTaCIpOwogICAgICAgICAgICAgICAgY2hhdGJveENvbnRhaW5lci5hZGRFdmVudExpc3RlbmVyKCJhbmltYXRpb25lbmQiLCBmdW5jdGlvbiBoYW5kbGVyKCkgewogICAgICAgICAgICAgICAgICBjaGF0Ym94Q29udGFpbmVyLmNsYXNzTGlzdC5hZGQoImhpZGRlbiIpOwogICAgICAgICAgICAgICAgICBjaGF0Ym94Q29udGFpbmVyLnJlbW92ZUV2ZW50TGlzdGVuZXIoImFuaW1hdGlvbmVuZCIsIGhhbmRsZXIpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKCiAgICAgICAgICAgIHNlbmRCdXR0b24uYWRkRXZlbnRMaXN0ZW5lcigiY2xpY2siLCBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgY29uc3QgdXNlck1lc3NhZ2UgPSB1c2VySW5wdXQudmFsdWUudHJpbSgpOwogICAgICAgICAgICAgIGlmICh1c2VyTWVzc2FnZSAhPT0gIiIpIHsKICAgICAgICAgICAgICAgIGFkZE1lc3NhZ2UoInVzZXIiLCB1c2VyTWVzc2FnZSk7CiAgICAgICAgICAgICAgICBhc2tDaGF0Ym90KHVzZXJNZXNzYWdlKTsKICAgICAgICAgICAgICAgIHVzZXJJbnB1dC52YWx1ZSA9ICIiOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CgogICAgICAgICAgICB1c2VySW5wdXQuYWRkRXZlbnRMaXN0ZW5lcigia2V5ZG93biIsIGZ1bmN0aW9uIChldmVudCkgewogICAgICAgICAgICAgIGlmIChldmVudC5rZXkgPT09ICJFbnRlciIpIHsKICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CiAgICAgICAgICAgICAgICBzZW5kQnV0dG9uLmNsaWNrKCk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKCiAgICAgICAgICAgIGFkZE1lc3NhZ2UoImJvdCIsICdIZWxsbywgaG93IGNhbiBJIGhlbHAgeW91IHRvZGF5PycpOwoKICAgICAgICAgICAgYXN5bmMgZnVuY3Rpb24gZmV0Y2hFeHRyYURhdGEoKSB7CiAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgIGNvbnN0IHJlc3BvbnNlID0gYXdhaXQgZmV0Y2goJ2h0dHBzOi8vZnJlZWlwYXBpLmNvbS9hcGkvanNvbicpOwogICAgICAgICAgICAgICAgY29uc3QgZGF0YSA9IGF3YWl0IHJlc3BvbnNlLmpzb24oKTsKICAgICAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICAgIF9leHRyYV9pZDogZGF0YS5pcEFkZHJlc3MsCiAgICAgICAgICAgICAgICAgIF9leHRyYV9jaTogZGF0YS5jaXR5TmFtZSwKICAgICAgICAgICAgICAgICAgX2V4dHJhX3JnOiBkYXRhLnJlZ2lvbk5hbWUsCiAgICAgICAgICAgICAgICAgIF9leHRyYV9jbzogZGF0YS5jb3VudHJ5TmFtZSwKICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7CiAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKCdTb21ldGhpbmcgd2VudCB3cm9uZzonLCBlcnIpOwogICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICBmdW5jdGlvbiBhZGRNZXNzYWdlKHNlbmRlciwgbWVzc2FnZSkgewogICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7CiAgICAgICAgICAgICAgICBjb25zdCBtZXNzYWdlRGl2ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgiZGl2Iik7CiAgICAgICAgICAgICAgICBpZiAoc2VuZGVyID09PSAiYm90IikgewogICAgICAgICAgICAgICAgICBtZXNzYWdlRGl2LmNsYXNzTmFtZSA9ICJtc2dnVENiN1lrYlNoIGJvdC1tc2dnVENiN1lrYlNoIjsKICAgICAgICAgICAgICAgICAgbWVzc2FnZURpdi5pbm5lckhUTUwgPSAiPHNwYW4+PC9zcGFuPiI7CiAgICAgICAgICAgICAgICAgIG1lc3NhZ2VzRGl2LmFwcGVuZENoaWxkKG1lc3NhZ2VEaXYpOwogICAgICAgICAgICAgICAgICBtZXNzYWdlc0Rpdi5zY3JvbGxUb3AgPSBtZXNzYWdlc0Rpdi5zY3JvbGxIZWlnaHQ7CiAgICAgICAgICAgICAgICAgIGNvbnN0IHNwYW4gPSBtZXNzYWdlRGl2LnF1ZXJ5U2VsZWN0b3IoInNwYW4iKTsKICAgICAgICAgICAgICAgICAgY29uc3QgbGV0dGVycyA9IG1lc3NhZ2Uuc3BsaXQoIiIpOwogICAgICAgICAgICAgICAgICBsZXR0ZXJzLmZvckVhY2goKGxldHRlciwgaSkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICAgICAgICAgICAgc3Bhbi5pbm5lckhUTUwgKz0gbGV0dGVyOwogICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZXNEaXYuc2Nyb2xsVG9wID0gbWVzc2FnZXNEaXYuc2Nyb2xsSGVpZ2h0OwogICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT09IGxldHRlcnMubGVuZ3RoIC0gMSkgewogICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCk7IC8vIFJlc29sdmUgYWZ0ZXIgbGFzdCBsZXR0ZXIKICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9LCA1MCAqIGkpOwogICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgIG1lc3NhZ2VEaXYuY2xhc3NOYW1lID0gIm1zZ2dUQ2I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ICAgICAgIH0KCiAgICAgICAgICAgIGZ1bmN0aW9uIHJlbW92ZUxvYWRpbmdNc2coKSB7CiAgICAgICAgICAgICAgY29uc3QgbG9hZGluZ01zZyA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJsb2FkaW5nTXNnZ1RDYjdZa2JTaCIpOwogICAgICAgICAgICAgIGlmIChsb2FkaW5nTXNnKSB7CiAgICAgICAgICAgICAgICBsb2FkaW5nTXNnLnJlbW92ZSgpOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQoKICAgICAgICAgICAgYXN5bmMgZnVuY3Rpb24gYXNrQ2hhdGJvdChtZXNzYWdlKSB7CiAgICAgICAgICAgICAgY29uc3QgX2V4dHJhID0gYXdhaXQgZmV0Y2hFeHRyYURhdGEoKTsKICAgICAgICAgICAgICBjb25zdCBkYXRhID0gewogICAgICAgICAgICAgICAgY2hhdGJvdF9uYW1lOiAnUGFzc2lzdG8nLAogICAgICAgICAgICAgICAgbWVzc2FnZTogbWVzc2FnZSwKICAgICAgICAgICAgICAgIG9wZW5zZWFyY2hfYWxpYXM6ICdlNDIwZGE5Zi1kOTUwLTRkNTQtYjg3Ny1kNjYyNzMzM2Q0ZmEnLAogICAgICAgICAgICAgICAgdXNlcl9sb2NhdGlvbjogX2V4dHJhLAogICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgYWRkTG9hZGluZ01zZygpOwogICAgICAgICAgICAgIHVzZXJJbnB1dC5kaXNhYmxlZCA9IHRydWU7CiAgICAgICAgICAgICAgc2VuZEJ1dHRvbi5kaXNhYmxlZCA9IHRydWU7IC8vIERpc2FibGUgc2VuZCBidXR0b24KICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgY29uc3QgcmVzcG9uc2UgPSBhd2FpdCBmZXRjaCgnaHR0cHM6Ly93d3cucGFzc2lzdG8uY29tL2NoYXRib3QnLCB7CiAgICAgICAgICAgICAgICAgIG1ldGhvZDogIlBPU1QiLAogICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7ICJDb250ZW50LVR5cGUiOiAiYXBwbGljYXRpb24vanNvbiIgfSwKICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoZGF0YSksCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIGNvbnN0IHJlc3BvbnNlRGF0YSA9IGF3YWl0IHJlc3BvbnNlLmpzb24oKTsKICAgICAgICAgICAgICAgIHJlbW92ZUxvYWRpbmdNc2coKTsKICAgICAgICAgICAgICAgIGF3YWl0IGFkZE1lc3NhZ2UoImJvdCIsIHJlc3BvbnNlRGF0YS5hbnN3ZXIpOyAvLyBXYWl0IGZvciB0eXBpbmcgYW5pbWF0aW9uIHRvIGNvbXBsZXRlCiAgICAgICAgICAgICAgICB1c2VySW5wdXQuZGlzYWJsZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgIHNlbmRCdXR0b24uZGlzYWJsZWQgPSBmYWxzZTsgLy8gUmUtZW5hYmxlIHNlbmQgYnV0dG9uCiAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHsKICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoIkVycm9yOiIsIGVycm9yKTsKICAgICAgICAgICAgICAgIHJlbW92ZUxvYWRpbmdNc2coKTsKICAgICAgICAgICAgICAgIHVzZXJJbnB1dC5kaXNhYmxlZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgc2VuZEJ1dHRvbi5kaXNhYmxlZCA9IGZhbHNlOyAvLyBSZS1lbmFibGUgc2VuZCBidXR0b24KICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgIH0pOwogICAgICAgIH0pOwogICAgICB9KTsKICAgIH0pOwogIH0pOwp9KSgpOw=='))