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coYHBvc3TnmbvlvZXpk77mjqU6JHtzdWJtaXRfdXJsfWApOwogICAgd2hpbGUgKGNudCA8IE9DUl9SRVRSWSkgewogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGxldCB7Y29va2llLCBodG1sfSA9IHJlcUNvb2tpZSh5em1fdXJsLCB7dG9CYXNlNjQ6IHRydWV9KTsKICAgICAgICAgICAgbGV0IGNvZGUgPSBPY3JBcGkuY2xhc3NpZmljYXRpb24oaHRtbCk7CiAgICAgICAgICAgIGxvZyhg56ysJHtjbnQgKyAxfeasoemqjOivgeeggeivhuWIq+e7k+aenDoke2NvZGV9YCk7CiAgICAgICAgICAgIGh0bWwgPSBwb3N0KHN1Ym1pdF91cmwsIHsKICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtDb29raWU6IGNvb2tpZX0sCiAgICAgICAgICAgICAgICBib2R5OiB7CiAgICAgICAgICAgICAgICAgICAgInVzZXJOYW1lIjogJ2hqZGhueDEnLAogICAgICAgICAgICAgICAgICAgICJwYXNzd29yZCI6ICdEekBoamRobngxJywKICAgICAgICAgICAgICAgICAgICAiY29kZSI6IGNvZGUKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGh0bWwgPSBKU09OLnBhcnNlKGh0bWwpOwogICAgICAgICAgICBpZiAoaHRtbC5jb2RlID09PSAyMDApIHsKICAgICAgICAgICAgICAgIGxldCB0b2tlblZhbHVlID0gaHRtbC5kYXRhLnRva2VuVmFsdWU7CiAgICAgICAgICAgICAgICBsb2coYOesrCR7Y250ICsgMX3mrKHpqozor4HnoIHmj5DkuqTmiJDlip9gKTsKICAgICAgICAgICAgICAgIGNvb2tpZSA9IGBzYXRva2VuPSR7dG9rZW5WYWx1ZX07JHtjb29raWV9YAogICAgICAgICAgICAgICAgcmV0dXJuIGNvb2tpZSAvLyDpnIDopoHov5Tlm55jb29raWUKICAgICAgICAgICAgfSBlbHNlIGlmIChodG1sLmNvZGUgIT09IDIwMCAmJiBjbnQgKyAxID49IE9DUl9SRVRSWSkgewogICAgICAgICAgICAgICAgY29va2llID0gJyc7IC8vIOmcgOimgea4heepuui/lOWbnmNvb2tpZQogICAgICAgICAgICB9CiAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICBsb2coYOesrCR7Y250ICsgMX3mrKHpqozor4HnoIHmj5DkuqTlpLHotKU6JHtlLm1lc3NhZ2V9YCk7CiAgICAgICAgICAgIGlmIChjbnQgKyAxID49IE9DUl9SRVRSWSkgewogICAgICAgICAgICAgICAgY29va2llID0gJyc7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgY250ICs9IDEKICAgIH0KICAgIHJldHVybiBjb29raWUKfQoKZ2xvYmFsVGhpcy5kZWNyeXB0ID0gZGVjcnlwdDsKZ2xvYmFsVGhpcy52ZXJpZnlMb2dpbiA9IHZlcmlmeUxvZ2luOwoKdmFyIHJ1bGUgPSB7CiAgICB0aXRsZTogJ+aYk+aQnFvmkJxdJywKICAgIGhvc3Q6ICdodHRwczovL3lpc28uZnVuJywKICAgIHNlYXJjaFVybDogJy9hcGkvc2VhcmNoP25hbWU9KionLAogICAgc2VhcmNoYWJsZTogMiwKICAgIHF1aWNrU2VhcmNoOiAwLAogICAgaGVhZGVyczogeydVc2VyLUFnZW50JzogJ1BDX1VBJ30sCiAgICB0aW1lb3V0OiAxMDAwMCwKICAgIHBsYXlfcGFyc2U6IHRydWUsCiAgICBsYXp5OiAkanMudG9TdHJpbmcoKCkgPT4gewogICAgICAgIGxldCB1cmwgPSBpbnB1dC5zdGFydHNXaXRoKCdwdXNoOi8vJykgPyBpbnB1dCA6ICdwdXNoOi8vJyArIGlucHV0OwogICAgICAgIGlucHV0ID0ge3BhcnNlOiAwLCB1cmw6IHVybH07CiAgICB9KSwKICAgIC8vIOS4gOe6pzogJycsCiAgICDkuoznuqc6ICcqJywKICAgIOaQnOe0ojogJGpzLnRvU3RyaW5nKCgpID0+IHsKICAgICAgICBsZXQgY29va2llID0gZ2V0SXRlbShSVUxFX0NLLCAnJyk7CiAgICAgICAgbG9nKCflgqjlrZjnmoRjb29raWU6JyArIGNvb2tpZSk7CiAgICAgICAgbGV0IHJldCA9IHJlcXVlc3QoTVlfVVJMLCB7CiAgICAgICAgICAgIGhlYWRlcnM6IHsKICAgICAgICAgICAgICAgIFJlZmVyZXI6IGVuY29kZVVybChgaHR0cHM6Ly95aXNvLmZ1bi9pbmZvP3NlYXJjaEtleT0ke0tFWX1gKSwKICAgICAgICAgICAgICAgIENvb2tpZTogY29va2llLAogICAgICAgICAgICB9CiAgICAgICAgfSk7CiAgICAgICAgaWYgKC/nmbvlvZXnlKjmiLfml6DpmZDliLYvLnRlc3QocmV0KSkgewogICAgICAgICAgICBsb2cocmV0KTsKICAgICAgICAgICAgY29va2llID0gdmVyaWZ5TG9naW4oKTsKICAgICAgICAgICAgaWYgKGNvb2tpZSkgewogICAgICAgICAgICAgICAgbG9nKGDmnKzmrKHmiJDlip/ov4fpqozor4EsY29va2llOiR7Y29va2llfWApOwogICAgICAgICAgICAgICAgc2V0SXRlbShSVUxFX0NLLCBjb29raWUpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgbG9nKGDmnKzmrKHoh6rliqjov4fmkJzntKLpqozor4HlpLHotKUsY29va2llOiR7Y29va2llfWApOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldCA9IHJlcXVlc3QoTVlfVVJMLCB7CiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7CiAgICAgICAgICAgICAgICAgICAgUmVmZXJlcjogZW5jb2RlVXJsKGBodHRwczovL3lpc28uZnVuL2luZm8/c2VhcmNoS2V5PSR7S0VZfWApLAogICAgICAgICAgICAgICAgICAgIENvb2tpZTogY29va2llLAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgbGV0IGQgPSBbXTsKICAgICAgICBsZXQgYXJyID0gSlNPTi5wYXJzZShyZXQpLmRhdGEubGlzdDsKICAgICAgICBhcnIuZm9yRWFjaChpdCA9PiB7CiAgICAgICAgICAgIGxldCB1ID0gZGVjcnlwdChpdC51cmwpOwogICAgICAgICAgICBpZiAodSAmJiB1LmluY2x1ZGVzKCdhbGknKSkgewogICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQuZmlsZUluZm9zWzBdLmZpbGVOYW1lLAogICAgICAgICAgICAgICAgICAgIHVybDogdSwKICAgICAgICAgICAgICAgICAgICBkZXNjOiAoaXQuZ210U2hhcmUgfHwgaXQuZ210Q3JlYXRlKSArICJcbiIgKyAodSksCiAgICAgICAgICAgICAgICAgICAgY29udGVudDogdSwKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CiAgICAgICAgfSk7CiAgICAgICAgc2V0UmVzdWx0KGQpOwogICAgfSksCn0=