Advertisement
xiaomianao666

邀您一起看:测试

Jan 14th, 2022
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥测试@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS4gOe6p3N0dWktdm9kbGlzdFwiLFwicGF0aFwiOlwic3R1aS12b2RsaXN0XCIsXCJydWxlXCI6XCJ2YXIgZCA9IFtdO1xcbnZhciBodG1sID0gZ2V0UmVzQ29kZSgpO1xcbnZhciBsaXN0ID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnLnN0dWktdm9kbGlzdCYmbGknKTtcXG5mb3IgKHZhciBqIGluIGxpc3QpIHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJnRpdGxlJyksXFxuICAgICAgICBkZXNjOiBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJy5waWMtdGV4dCYmVGV4dCcpLFxcbiAgICAgICAgaW1nOiBwYXJzZURvbShsaXN0W2pdLCAnLmxhenlsb2FkfHxhJiZkYXRhLW9yaWdpbmFsJykrJ0BSZWZlcmVyPScsXFxuICAgICAgICB1cmw6IHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJykgKyAnI2ltb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AgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCIuanBnXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCIuanBlZ1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiLnBuZ1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiLm1wNFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiLm0zdThcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIi5naWZcXFwiXFxuICAgICAgICAgICAgICAgIF1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbn1cXG5zZXRUYWJzKHRhYnMsIE1ZX1VSTCk7XFxuc2V0TGlzdHMobGlzdHMsIGdldFZhcihNWV9VUkwsICcwJykpO1xcblxcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaQnOe0om15dWktdm9kbGlzdF9fbWVkaWFcIixcInBhdGhcIjpcIm15dWktdm9kbGlzdF9fbWVkaWFcIixcInJ1bGVcIjpcInZhciBkID0gW107XFxyXFxudmFyIGxpc3QgPSBwYXJzZURvbUZvckFycmF5KGdldFJlc0NvZGUoKSwgJyNzZWFyY2hMaXN0JiZsaScpO1xcbmxvZygn5pCc57Si57uT5p6cJylcXG5sb2cobGlzdClcXG5pZiAobGlzdC5sZW5ndGggPT0gMCkgdGhyb3cgXFxcIuaQnOe0ouS4uuepuu+8jOWPr+iDveWMuemFjemUmeivr1xcXCJcXHJcXG5mb3IgKHZhciBqIGluIGxpc3QpIHtcXHJcXG4gICAgZC5wdXNoKHtcXHJcXG4gICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJnRpdGxlJyksXFxyXFxuICAgICAgICBkZXNjOiBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ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zaFBhZ2UoKTsndG9hc3Q6Ly/liIfmjaLmjpLluo/miJDlip8nYCxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxuICAgIH0pXFxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRhYnMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICB2YXIgdXJsID0gXFxcIkBsYXp5UnVsZT0uanM6cHV0VmFyKCdcXFwiICsgdmFyaSArIFxcXCInLCAnXFxcIiArIGkgKyBcXFwiJyk7cmVmcmVzaFBhZ2UoZmFsc2UpOyd0b2FzdDovL+WIh+aNouaIkOWKn++8gSdcXFwiO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAoZ2V0VmFyKHZhcmksICcwJykgPT0gaSA/ICfigJzigJwnICsgdGFic1tpXSArICfigJ3igJ0nIDogdGFic1tpXSkucmVwbGFjZSgn7qK0JywnJyksXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJ1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxufVxcblxcbmZ1bmN0aW9uIHNldExpc3RzKGxpc3RzLCBpbmRleCkge1xcbiAgICB2YXIgbGlzdCA9IGxpc3RzW2luZGV4XTtcXG4gICAgaWYgKGdldFZhcignc2hzb3J0JykgPT0gJzEnKSB7XFxuICAgICAgICB2YXIgbGlzdCA9IGxpc3RzW2luZGV4XS5yZXZlcnNlKCk7XFxuICAgIH1cXG4gICAgZm9yICh2YXIgaiBpbiBsaXN0KSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJlRleHQnKS5yZXBsYWNlKC/nrKwoXFxcXGQrKembhi8sJyQxJykucmVwbGFjZSgn56ysJywgJycpLnJlcGxhY2UoJ+acnycsICcnKSxcXG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wZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiI01hcHBpbmdcIixcInBhdGhcIjpcIk1hcHBpbmdcIixcInJ1bGVcIjpcImpzOlxcbiQuZXhwb3J0cyA9IHtcXG4gICAgXFxcImhvbWVcXFwiOiBbXFxuICAgICAgICAvL1xcbiAgICAgICAge1xcbiAgICAgICAgICAgIGtleXM6IFtcXFwiIGIgXFxcIl0sXFxuICAgICAgICAgICAgdXJsOiBcXFwiLmJcXFwiLFxcbiAgICAgICAgICAgIC8vICAgICBhbGxLZXk6IHRydWUsXFxuICAgICAgICB9LFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIGtleXM6IFtcXFwibmF2LXRhYnNcXFwiXSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJuYXYtdGFic1xcXCIsXFxuICAgICAgICB9LFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIGtleXM6IFtcXFwibXl1aS1jb250ZW50X19saXN0XFxcIl0sXFxuICAgICAgICAgICAgdXJsOiBcXFwibXl1aS1jb250ZW50X19saXN0XFxcIixcXG4gICAgICAgIH0sXFxuICAgICAgICB7XFxuICAgICAgICAgICAga2V5czogW1xcXCJuYXYtdGFic1xcXCIsXFxcInN0dWktY29udGVudF9fcGxheWxpc3RcXFwiXSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJuYXYtdGFiczFcXFwiLFxcbiAgICAgICAgICAgIGFsbEtleTogdHJ1ZSxcXG4gICAgICAgIH0sXFxuICAgICAgICB7XFxuICAgICAgICAgICAga2V5czogW1xcXCJoM1xcXCIsXFxcInN0dWktY29udGVudF9fcGxheWxpc3RcXFwiXSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoM1xcXCIsXFxuICAgICAgICAgICAgYWxsS2V5OiB0cnVlLFxcbiAgICAgICAgfSxcXG4gICAgICAgIHtcXG4gICAgICAgICAgICBrZXlzOiBbXFxcIm15dWktdm9kbGlzdCBcXFwiXSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJteXVpLXZvZGxpc3RcXFwiLFxcbiAgICAgICAgfSxcXG4gICAgICAgIHtcXG4gICAgICAgICAgICBrZXlzOiBbXFxcIm1vLW1vdnMtaXRlbVxcXCJdLFxcbiAgICAgICAgICAgIHVybDogXFxcIm1vLW1vdnMtaXRlbVxcXCIsXFxuICAgICAgICB9LFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIGtleXM6IFtcXFwibW9kdWxlLXRhYi1pdGVtXFxcIl0sXFxuICAgICAgICAgICAgdXJsOiBcXFwibW9kdWxlLXRhYi1pdGVtXFxcIixcXG4gICAgICAgICAgICAvLyAgICAgYWxsS2V5OiB0cnVlLFxcbiAgICAgICAgfSxcXG4gICAgICAgIHtcXG4gICAgICAgICAgICBrZXlzOiBbXFxcInN0dWktdm9kbGlzdCBcXFwiXSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJzdHVpLXZvZGxpc3RcXFwiLFxcbiAgICAgICAgICAgIC8vICAgICBhbGxLZXk6IHRydWUsXFxuICAgICAgICB9LFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIGtleXM6IFtcXFwicGxheV9zb3VyY2VfdGFiXFxcIl0sXFxuICAgICAgICAgICAgdXJsOiBcXFwicGxheV9zb3VyY2VfdGFiXFxcIixcXG4gICAgICAgIH0sXFxuICAgICAgICB7XFxuICAgICAgICAgICAga2V5czogW1xcXCJmZWQtcGxheS1pdGVtXFxcIl0sXFxuICAgICAgICAgICAgdXJsOiBcXFwiZmVkLXBsYXktaXRlbVxcXCIsXFxuICAgICAgICB9LFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIGtleXM6IFtcXFwibW9kdWxlLWl0ZW1zXFxcIl0sXFxuICAgICAgICAgICAgdXJsOiBcXFwibW9kdWxlLWl0ZW1zXFxcIixcXG4gICAgICAgIH0sXFxuICAgICAgICB7XFxuICAgICAgICAgICAga2V5czogW1xcXCJ2b2RsaXN0IFxcXCIsXFxcImxhenlsb2FkXFxcIl0sXFxuICAgICAgICAgICAgdXJsOiBcXFwidm9kbGlzdFxcXCIsXFxuICAgICAgICAgICAgYWxsS2V5OiB0cnVlLFxcbiAgICAgICAgfSxcXG4gICAgICAgIHtcXG4gICAgICAgICAgICBrZXlzOiBbXFxcIm1vLXBsYXktbG9hZFxcXCJdLFxcbiAgICAgICAgICAgIHVybDogXFxcIm1vLXBsYXktbG9hZFxcXCIsXFxuICAgICAgICB9LFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIGtleXM6IFtcXFwiZmVkLWxpc3QtdGl0bGVcXFwiXSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJmZWQtbGlzdC10aXRsZVxcXCIsXFxuICAgICAgICAgICAgLy9hbGxLZXk6IHRydWUsXFxuICAgICAgICB9LFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIGtleXM6IFtcXFwicGFjay15a3BhY2tcXFxcXFxcIlxcXCJdLFxcbiAgICAgICAgICAgIHVybDogXFxcInBhY2steWtwYWNrXFxcIixcXG4gICAgICAgIH0sLypcXG4gICAgICAgIHtcXG4gICAgICAgICAgICBrZXlzOiBbXFxcIml0ZW1cXFwiXSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJpdGVtXFxcIixcXG4gICAgICAgIH0sKi9cXG4gICAgICAgIHtcXG4gICAgICAgICAgICBrZXlzOiBbXFxcImRhdGFfbGlzdFxcXCJdLFxcbiAgICAgICAgICAgIHVybDogXFxcImRhdGFfbGlzdFxcXCIsXFxuICAgICAgICB9LFxcbiAgICBdLFxcbiAgICBcXFwic2VhcmNoXFxcIjogW1xcbiAgICAgICAgLy8gc2VhcmNoIOmHjOWGmeaQnOe0oueahOWtkOmhtemdouaYoOWwhFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIGtleXM6IFtcXFwic3R1aS12b2RsaXN0X19tZWRpYVxcXCJdLFxcbiAgICAgICAgICAgIHVybDogXFxcInN0dWktdm9kbGlzdF9fbWVkaWFcXFwiLFxcbiAgICAgICAgfSxcXG4gICAgICAgIHtcXG4gICAgICAgICAgICBrZXl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xuICAgICAgICBsb2coXFxcIuato+WcqOWMuemFje+8mlxcXCIgKyBwYWdlUnVsZS51cmwpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBldmFsLmNhbGwobnVsbCwgXFxcIjsoZnVuY3Rpb24oKXtcXFwiICsgZ2V0UGFnZVNvdXJjZShwYWdlUnVsZS51cmwpICsgXFxcIn0pKClcXFwiKTtcXG4gICAgICAgICAgICBsb2coXFxcIuWMuemFjeaooeadv+aIkOWKn++8jOato+WcqOe7k+adn+WMuemFjei/m+eoi1xcXCIpO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhcXFwi5Yy56YWN5qih5p2/6ZSZ6K+vXFxcIik7XFxuICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICBsb2coXFxcIuato+WcqOWMuemFjeS4i+S4gOS4quaooeadvy4uLi4uLlxcXCIpXFxuICAgICAgICAgICAgaWYgKHBhZ2VSdWxlLnVybCA9PSBwYWdlUnVsZXNbcGFnZVJ1bGVzLmxlbmd0aCAtIDFdLnVybCkge1xcbiAgICAgICAgICAgICAgICBsb2coXFxcIuW3suWMuemFjeWIsOacgOWQjuS4gOS4quaooeadv++8jOaaguaXoOWQiOmAgueahOaooeadv1xcXCIpO1xcbiAgICAgICAgICAgICAgICBzZXRSZXN1bHQoW10pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfVxcblxcbn1cXG4kLmV4cG9ydHMuYXV0b1BhZ2UgPSBhdXRvUGFnZTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS4gOe6p3BhY2steWtwYWNrXCIsXCJwYXRoXCI6XCJwYWNrLXlrcGFja1wiLFwicnVsZVwiOlwidmFyIGQgPVtdO1xcbnZhciBsaXN0ID0gcGFyc2VEb21Gb3JBcnJheShnZXRSZXNDb2RlKCksIC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/ICd0ZXh0XzQnIDogJ3RleHRfMicsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogW1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIi5qcGdcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIi5qcGVnXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCIucG5nXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCIubXA0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCIubTN1OFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiLmdpZlxcXCJcXG4gICAgICAgICAgICAgICAgXVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcbnRyeSB7XFxuICAgIHNldFRhYnModGFicywgTVlfVVJMKTtcXG4gICAgc2V0TGlzdHMobGlzdHMsIGdldFZhcihNWV9VUkwsICcwJykpO1xcbn0gY2F0Y2ggKGUpIHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn5rKh5pyJ6YCJ6ZuGJyxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgfSlcXG59XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6ICc8YnI+JyxcXG4gICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxufSk7XFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5pCc57SibW9kdWxlLXNlYXJjaC1pdGVtXCIsXCJwYXRoXCI6XCJtb2R1bGUtc2VhcmNoLWl0ZW1cIixcInJ1bGVcIjpcInZhciBkID0gW107XFxudmFyIGxpc3QgPSBwYXJzZURvbUZvckFycmF5KGdldFJlc0NvZGUoKSwgJ2JvZHkmJi5tb2R1bGUtc2VhcmNoLWl0ZW0nKTtcXG5sb2coJ+aQnOe0oue7k+a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ICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wLmZvckVhY2goKGNhdGUsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkobmV3X2NhdGUpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnVybCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGZvbGQgPT09ICcxJykge1xcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIOWIhuexu+agh+mimClcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICcgKyDliIbnsbvpopzoibIgKyAnXFxcIj4nICsgdGl0bGUgKyAnPC9zcGFuPjwvYj4nIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQocGQoaXRlbSwg5YiG57G76ZO+5o6lKSArICcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3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M6YKj5pyA57uI57uT5p6c5bCx5pivIHsgdGl0bGU6XFxcIuagh+mimDFcXFwiLCB1cmw6XFxcInh4eFxcXCIsIGNvbF90eXBlOlxcXCJ0ZXh0XzFcXFwiIH1cXG4gICAgICogQHJldHVybnMge0NhdGVnb3JpZXNIZWFkZXJ9XFxuICAgICAqL1xcbiAgICBmb2xkTGF5b3V0KGxheW91dCkge1xcbiAgICAgICAgaWYgKHR5cGVvZiBsYXlvdXQgPT09ICdvYmplY3QnKSB7XFxuICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyhsYXlvdXQpXFxuICAgICAgICAgICAgbGV0IGluamVjdEluZGV4ID0gbGF5b3V0LmluamVjdEluZGV4IHx8IGxheW91dFsn5oqY5Y+g5oyJ6ZKu5o+S5YWl6KGMJ11cXG4gICAgICAgICAgICBpZiAobGF5b3V0LnRpdGxlIHx8IGxheW91dC51cmwgfHwgbGF5b3V0LmNvbF90eXBlIHx8IGluamVjdEluZGV4KSB7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qga2V5ID0ga2V5c1tpXVxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUZvbGRMYXlvdXRdW2tleV0gPSBsYXlvdXRba2V5XTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl5q2j56Gu55qE5oqY5Y+g55WM6Z2i5YWD57Sg77yBXFxcIilcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy8gaW5qZWN0SW5kZXgg5oqY5Y+g5oyJ6ZKu5o+S5YWl56ysIGluamVjdEluZGV4IOihjFxcbiAgICAgICAgICAgIGlmIChpbmplY3RJbmRleCkge1xcbiAgICAgICAgICAgICAgICBpZiAoISh0eXBlb2YgKGluamVjdEluZGV4KSA9PT0gJ251bWJlcicpKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuaKmOWPoOaMiemSruaPkuWFpeihjOivt+S8oOWFpeaVsOWtl++8gVxcXCIpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGluamVjdEluZGV4IDwgMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLmipjlj6DmjInpkq7mj5LlhaXooYzor7fkvKDlhaXlpKfkuo4gMCDnmoTmlbTmlbDvvIFcXFwiKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChpbmplY3RJbmRleCA+IHRoaXNbc3ltYm9sTWFwLm1Gb2xkSW5kZXhdKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuaKmOWPoOaMiemSruaPkuWFpeihjOS4jeW+l+Wkp+S6juaYvuekuuaKmOWPoOihjOaVsO+8geivt+iwg+eUqCAuZm9sZEluZGV4KGluZGV4KSDmiJYgLuesrOWHoOihjOW8gOWni+aKmOWPoChpbmRleCkg5Lyg5YWl5q2j56Gu55qE5pi+56S65oqY5Y+g6KGM5pWwXFxcIilcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tRm9sZExheW91dF0uaW5qZWN0SW5kZXggPSBpbmplY3RJbmRleCB8fCAxO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLor7fkvKDlhaXmraPnoa7nmoTmipjlj6DnlYzpnaLlhYPntKDvvIFcXFwiKVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgIH0sXFxuICAgIC8vIOW9k+WJjeaYr+WQpuaKmO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IjtcXG4gICAgfSxcXG4gICAgZ2V0VXJsKHNyYywgY2F0ZWdvcnkpIHtcXG4gICAgICAgIGxldCB1cmwgPSAnJ1xcbiAgICAgICAgbGV0IHVybFJ1bGUgPSBjYXRlZ29yeS51cmxSdWxlIHx8ICdhJiZocmVmJ1xcbiAgICAgICAgaWYgKHR5cGVvZiB1cmxSdWxlID09PSAnb2JqZWN0Jykge1xcbiAgICAgICAgICAgIGxldCBtVXJsUnVsZSA9IHVybFJ1bGUucnVsZSB8fCB1cmxSdWxlWyfop6PmnpDop4TliJknXSB8fCAnYSYmaHJlZic7XFxuICAgICAgICAgICAgaWYgKG1VcmxSdWxlLnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB0aGlzLmV2YWxKU1J1bGUoc3JjLCBtVXJsUnVsZSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgbGV0IHBhcnNlID0gcGFyc2VEb207XFxuICAgICAgICAgICAgICAgIGlmICh1cmxSdWxlLnBhcnNlT3B0aW9uKSB7XFxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHVybFJ1bGUucGFyc2VPcHRpb24pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwYXJzZURvbVxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGRcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwYXJzZURvbUZvckh0bWxcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBkZmhcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tRm9ySHRtbDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh1cmxSdWxlW1xcXCLop6PmnpDmlrnms5VcXFwiXSkge1xcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh1cmxSdWxlW1xcXCLop6PmnpDmlrnms5VcXFwiXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBhcnNlRG9tXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwZFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBhcnNlRG9tRm9ySHRtbFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGRmaFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb21Gb3JIdG1sO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHVybCA9IHBhcnNlKHNyYywgbVVybFJ1bGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodXJsUnVsZS5kZWFsVXJsKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHVybFJ1bGUuZGVhbFVybCh1cmwpXFxuICAgICAgICAgICAgfSBlbHNlIGlmICh1cmxSdWxlWyfkuozmrKHlpITnkIYnXSkge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB1cmxSdWxlWyfkuozmrKHlpITnkIYnXSh1cmwpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBpZiAodXJsUnVsZS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdGhpcy5ldmFsSlNSdWxlKHNyYywgdXJsUnVsZSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gcGFyc2VEb20oc3JjLCB1cmxSdWxlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gdXJsIHx8IFxcXCJcXFwiO1xcbiAgICB9LFxcbiAgICBidWlsZCgpIHtcXG4gICAgICAgIC8vIOajgOa1i+aYr+WQpuS8oOWFpemcgOimgeeahOWPguaVsFxcbiAgICAgICAgdGhpcy5jaGVja1BhcmFtcygpXFxuICAgICAgICAvLyDmr4/kuIDkuKrliIbnsbvnmoTllK/kuIDmoIfor4ZcXG4gICAgICAgIGxldCBtVGFnID0gdGhpc1tzeW1ib2xNYXAubVRhZ10gfHwgXFxcIlxcXCJcXG4gICAgICAgIC8v57+76aG1IOmcgOimgeagueaNruWunumZheabv+aNolxcbiAgICAgICAgY29uc3QgaHRtbCA9IHRoaXNbc3ltYm9sTWFwLnNyY10gfHwgcmVxdWVzdCh0aGlzW3N5bWJvbE1hcC50cnVlX3VybF0pXFxuICAgICAgICBjb25zdCBlbXB0eSA9IFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgLy/ojrflj5bliJfooahcXG4gICAgICAgIGNvbnN0IGNhdGVnb3JpZXMgPSBbXVxcbiAgICAgICAgdGhpc1tzeW1ib2xNYXAucnVsZU9iakxpc3RdLm1hcChydWxlT2JqID0+IHtcXG4gICAgICAgICAgICBsZXQgbGlzdCA9IFtdXFxuICAgICAgICAgICAgbGV0IGxpc3RSdWxlID0gcnVsZU9iai5saXN0UnVsZSB8fCBydWxlT2JqW1xcXCLkuIDnuqfliIbnsbtcXFwiXVxcbiAgICAgICAgICAgIGlmIChsaXN0UnVsZS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgLy8gbG9nKCQuc3RyaW5naWZ5KGxpc3RSdWxlKSlcXG4gICAgICAgICAgICAgICAgbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShodG1sLCBsaXN0UnVsZSlcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCBsaXN0UnVsZSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy8gbG9nKGxpc3QpXFxuICAgICAgICAgICAgbGlzdC5tYXAoY2F0ZWdvcnkgPT4ge1xcbiAgICAgICAgICAgICAgICBjYXRlZ29yaWVzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdDogY2F0ZWdvcnksXFxuICAgICAgICAgICAgICAgICAgICBzdWJMaXN0UnVsZTogcnVsZU9iai5zdWJMaXN0UnVsZSB8fCBydWxlT2JqW1xcXCLlrZDliIbnsbtcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlUnVsZTogcnVsZU9iai50aXRsZVJ1bGUgfHwgcnVsZU9ialtcXFwi5YiG57G75qCH6aKYXFxcIl0sXFxuICAgICAgICAgICAgICAgICAgICB1cmxSdWxlOiBydWxlT2JqLnVybFJ1bGUgfHwgcnVsZU9ialtcXFwi5YiG57G76ZO+5o6lXFxcIl0sXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcblxcbiAgICAgICAgLy8gbG9nKCQuc3RyaW5naWZ5KGNhdGVnb3JpZX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AgICAgICAgICAgICAgIHVybDogdGhpc1tzeW1ib2xNYXAubUZvbGRMYXlvdXRdLnVybCB8fCAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5tVGFnICsgcGFyYW1zLlZBUk1BUC5GT0xELCBnZXRNeVZhcihwYXJhbXMubVRhZyArIHBhcmFtcy5WQVJNQVAuRk9MRCwgcGFyYW1zLmlzRm9sZCkgPT09ICcxJyA/ICcwJyA6ICcxJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGFnOiBtVGFnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0ZvbGQ6IHRoaXNbc3ltYm9sTWFwLm1Gb2xkXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiB0aGlzW3N5bWJvbE1hcC5tRm9sZExheW91dF0uY29sX3R5cGUgfHwgXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaChmb2xkTGF5b3V0KVxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8v5YW35L2T5YiX6KGo5LiL55qE5YiG57G7XFxuICAgICAgICAgICAgICAgIGxldCBzdWJfY2F0ZWdvcmllcyA9IFtdO1xcbiAgICAgICAgICAgICAgICBpZiAoY2F0ZWdvcnkuc3ViTGlzdFJ1bGUuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcyA9IHRoaXMuZXZhbEpTUnVsZShjYXRlZ29yeS5saXN0LCBjYXRlZ29yeS5zdWJMaXN0UnVsZSlcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gcGFyc2VEb21Gb3JBcnJheShjYXRlZ29yeS5saXN0LCBjYXRlZ29yeS5zdWJMaXN0UnVsZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGluZGV4IDwgKHRoaXNbc3ltYm9sTWFwLm1Gb2xkSW5kZXhdIHx8IDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIGNhdGVnb3J5KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSB0aGlzLmdldFVybChpdGVtLCBjYXRlZ29yeSlcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxmb250IGNvbG9yPScgKyB0aGlzW3N5bWJvbE1hcC5tQ29sb3JdICsgJz4nICsgdGl0bGUgKyAnIDwvZm9udD48L2I+JyA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3X2NhdGUgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5pbmRleCA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2NhdGUucHVzaChpbmRleCA9PT0gMCA/IHBhcmFtcy5rZXkudG9TdHJpbmcoKSA6IFxcXCIwXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5DQVRFR09SWSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmluZGV4ID09PSAwID8gbmV3X2NhdGUgOiBwYXJhbXMuY2F0ZV90ZW1wKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLlVSTCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZBUk1BUDogdGhpcy5WQVJNQVAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWc6IG1UYWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHRoaXNbc3ltYm9sTWFwLm1QYWdlXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpc1tzeW1ib2xNYXAubUZvbGRdID09PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHRoaXMuZ2V0VGl0bGUoaXRlbSwgY2F0ZWdvcnkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IHRoaXMuZ2V0VXJsKGl0ZW0sIGNhdGVnb3J5KVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PGZvbnQgY29sb3I9JyArIHRoaXNbc3ltYm9sTWFwLm1Db2xvcl0gKyAnPicgKyB0aXRsZSArICcgPC9mb250PjwvYj4nIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJCh1cmwpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuQ0FURUdPUlksIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuVVJMLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhZzogbVRhZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogdGhpc1tzeW1ib2xNYXAubVBhZ2VdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9LFxcblxcbiAgICDnlYzpnaIobGF5b3V0KSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5sYXlvdXQobGF5b3V0KVxcbiAgICB9LFxcbiAgICDliIbnsbvpk77mjqUodHJ1ZVVybCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMudHJ1ZVVybCh0cnVlVXJsKTtcXG4gICAgfSxcXG4gICAg6aG156CBKHBhZ2UpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLnBhZ2UocGFnZSk7XFxuICAgIH0sXFxuICAgIOa6kOeggShodG1sKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5odG1sKGh0bWwpO1xcbiAgICB9LFxcbiAgICDlrprkvY3kuIDnuqfliIbnsbsobGlzdCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMubGlzdChsaXN0KTtcXG4gICAgfSxcXG4gICAg5a6a5L2N5a2Q5YiG57G7KHN1Ykxpc3QpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLnN1Ykxpc3Qoc3ViTGlzdCk7XFxuICAgIH0sXFxuICAgIOWumuS9jeWIhuexu+agh+mimCh0aXRsZSkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMudGl0bGUodGl0bGUpO1xcbiAgICB9LFxcbiAgICDlrprkvY3liIbnsbvpk77mjqUodXJsKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy51cmwodXJsKTtcXG4gICAgfSxcXG4gICAg5byA5ZCv5YaF572u5oqY5Y+g5Yqf6IO9KCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMuZm9sZElubmVyKHRydWUpO1xcbiAgICB9LFxcbiAgICDlhbPpl63lhoXnva7mipjlj6Dlip/og70oKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5mb2xkSW5uZXIoZmFsc2UpO1xcbiAgICB9LFxcbiAgICDnrKzlh6DooYzlvIDlp4vmipjlj6AoaW5kZXgpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLmZvbGRJbmRleChpbmRleCk7XFxuICAgIH0sXFxuICAgIOaKmOWPoOaMiemSruagt+W8jyhsYXlvdXQpIHtcXG4gICAgICAgIHJldHVybiB0aGlzLmZvbGRMYXlvdXQobGF5b3V0KVxcbiAgICB9LFxcbiAgICDmipjlj6AoZm9sZCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMuZm9sZChmb2xkKTtcXG4gICAgfSxcXG4gICAg6YCJ5Lit55qE5YiG57G76aKc6ImyKGNvbG9yKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5jb2xvcihjb2xvcik7XFxuICAgIH0sXFxuICAgIOWUr+S4gOagh+ivhihtVGFnKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy50YWcobVRhZylcXG4gICAgfSxcXG4gICAg5re75Yqg5YiG57G75a6a5L2NKHJ1bGVPYmopIHtcXG4gICAgICAgIHJldHVybiB0aGlzLmFkZChydWxlT2JqKTtcXG4gICAgfSxcXG4gICAg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gfVxcbiAgICB9LFxcbiAgICBiYXNlVXJsKHVybCl7XFxuICAgICAgICB0aGlzLnBhcmFtcy51cmwgPSB1cmxcXG4gICAgICAgIHJldHVybiB0aGlzXFxuICAgIH0sXFxuICAgIHBhZ2UocGFnZSl7XFxuICAgICAgICB0aGlzLnBhcmFtcy5wYWdlID0gcGFnZVxcbiAgICAgICAgcmV0dXJuIHRoaXNcXG4gICAgfSxcXG4gICAgYWRkRXh0cmEocmVnRXhwKSB7XFxuICAgICAgICBpZiAocmVnRXhwLmNvbnN0cnVjdG9yID09PSBBcnJheSkge1xcbiAgICAgICAgICAgIHRoaXMucmVnZXhNYXAgPSB0aGlzLnJlZ2V4TWFwLmNvbmNhdChyZWdFeHApXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHRoaXMucmVnZXhNYXAucHVzaChyZWdFeHApXFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgfSxcXG4gICAgZGVidWcoKSB7XFxuICAgICAgICB0aGlzLnBhcmFtcy5kZWJ1ZyA9IHRydWVcXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICBleGVjKCkge1xcbiAgICAgICAgdGhpcy5jaGVja1BhcmFtcygpXFxuICAgICAgICBsZXQgdHJ1ZV91cmwgPSAnJ1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLnJlZ2V4TWFwLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgbGV0IHJlZ09iaiA9IHRoaXMucmVnZXhNYXBbaV07XFxuICAgICAgICAgICAgbGV0IHVybEV4cCA9IHJlZ09iai5yZWc7XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB1cmxFeHAgPT09ICdzdHJpbmcnKSB7XFxuICAgICAgICAgICAgICAgIHVybEV4cCA9IG5ldyBSZWdFeHAodXJsRXhwKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodXJsRXhwLnRlc3QodGhpcy5wYXJhbXMudXJsKSkge1xcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5wYXJhbXMuZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh1cmxFeHAudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB0cnVlX3VybCA9IHJlZ09iai5leGVjKCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0cnVlX3VybCkge1xcbiAgICAgICAgICAgIHJldHVybiB0cnVlX3VybDtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyYW1zLnVybFxcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICDojrflj5blpITnkIbnu5PmnpwoKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5leGVjKClcXG4gICAgfSxcXG4gICAg6ZO+5o6lKHVybCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMuYmFzZVVybCh1cmwpXFxuICAgIH0sXFxuICAgIOmhteeggShwYWdlKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5wYWdlKHBhZ2UpXFxuICAgIH0sXFxuICAgIOaPkuWFpeaWsOWkhOeQhuinhOWImShyZWdFeHApIHtcXG4gICAgICAgIHJldHVybiB0aGlzLmFkZEV4dHJhKHJlZ0V4cClcXG4gICAgfSxcXG4gICAg6LCD6K+V5qih5byPKCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVidWcoKTtcXG4gICAgfVxcbn0pXFxuJC5leHBvcnRzPW5ldyBVcmxQcm9jZXNzb3IoKVxcbiQuZXhwb3J0c1xcblwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Ye95pWwXCIsXCJwYXRoXCI6XCJqeGhzXCIsXCJydWxlXCI6XCJ2YXIgZmZ0dCA9ICdNdzhnaXl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AgfSxcXFxcbiAgICAgICAge1xcXFxuICAgICAgICAgICAga2V5czogW1xcXFxcXFwibmF2LXRhYnNcXFxcXFxcIl0sXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwibmF2LXRhYnNcXFxcXFxcIixcXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAge1xcXFxuICAgICAgICAgICAga2V5czogW1xcXFxcXFwibXl1aS1jb250ZW50X19saXN0XFxcXFxcXCJdLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcIm15dWktY29udGVudF9fbGlzdFxcXFxcXFwiLFxcXFxuICAgICAgICB9LFxcXFxuICAgICAgICB7XFxcXG4gICAgICAgICAgICBrZXlzOiBbXFxcXFxcXCJuYXYtdGFic1xcXFxcXFwiLFxcXFxcXFwic3R1aS1jb250ZW50X19wbGF5bGlzdFxcXFxcXFwiXSxcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJuYXYtdGFiczFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGFsbEtleTogdHJ1ZSxcXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAge1xcXFxuICAgICAgICAgICAga2V5czogW1xcXFxcXFwiaDNcXFxcXFxcIixcXFxcXFxcInN0dWktY29udGVudF9fcGxheWxpc3RcXFxcXFxcIl0sXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwiaDNcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGFsbEtleTogdHJ1ZSxcXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAge1xcXFxuICAgICAgICAgICAga2V5czogW1xcXFxcXFwibXl1aS12b2RsaXN0IFxcXFxcXFwiXSxcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJteXVpLXZvZGxpc3RcXFxcXFxcIixcXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAge1xcXFxuICAgICAgICAgICAga2V5czogW1xcXFxcXFwibW8tbW92cy1pdGVtXFxcXFxcXCJdLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcIm1vLW1vdnMtaXRlbVxcXFxcXFwiLFxcXFxuICAgICAgICB9LFxcXFxuICAgICAgICB7XFxcXG4gICAgICAgICAgICBrZXlzOiBbXFxcXFxcXCJtb2R1bGUtdGFiLWl0ZW1cXFxcXFxcIl0sXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwibW9kdWxlLXRhYi1pdGVtXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAvLyAgICAgYWxsS2V5OiB0cnVlLFxcXFxuICAgICAgICB9LFxcXFxuICAgICAgICB7XFxcXG4gICAgICAgICAgICBrZXlzOiBbXFxcXFxcXCJzdHVpLXZvZGxpc3QgXFxcXFxcXCJdLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcInN0dWktdm9kbGlzdFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgLy8gICAgIGFsbEtleTogdHJ1ZSxcXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAge1xcXFxuICAgICAgICAgICAga2V5czogW1xcXFxcXFwicGxheV9zb3VyY2VfdGFiXFxcXFxcXCJdLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcInBsYXlfc291cmNlX3RhYlxcXFxcXFwiLFxcXFxuICAgICAgICB9LFxcXFxuICAgICAgICB7XFxcXG4gICAgICAgICAgICBrZXlzOiBbXFxcXFxcXCJmZWQtcGxheS1pdGVtXFxcXFxcXCJdLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImZlZC1wbGF5LWl0ZW1cXFxcXFxcIixcXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAge1xcXFxuICAgICAgICAgICAga2V5czogW1xcXFxcXFwibW9kdWxlLWl0ZW1zXFxcXFxcXCJdLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcIm1vZHVsZS1pdGVtc1xcXFxcXFwiLFxcXFxuICAgICAgICB9LFxcXFxuICAgICAgICB7XFxcXG4gICAgICAgICAgICBrZXlzOiBbXFxcXFxcXCJ2b2RsaXN0IFxcXFxcXFwiLFxcXFxcXFwibGF6eWxvYWRcXFxcXFxcIl0sXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwidm9kbGlzdFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgYWxsS2V5OiB0cnVlLFxcXFxuICAgICAgICB9LFxcXFxuICAgICAgICB7XFxcXG4gICAgICAgICAgICBrZXlzOiBbXFxcXFxcXCJtby1wbGF5LWxvYWRcXFxcXFxcIl0sXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwibW8tcGxheS1sb2FkXFxcXFxcXCIsXFxcXG4gICAgICAgIH0sXFxcXG4gICAgICAgIHtcXFxcbiAgICAgICAgICAgIGtleXM6IFtcXFxcXFxcImZlZC1saXN0LXRpdGxlXFxcXFxcXCJdLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImZlZC1saXN0LXRpdGxlXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAvL2FsbEtleTogdHJ1ZSxcXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAge1xcXFxuICAgICAgICAgICAga2V5czogW1xcXFxcXFwicGFjay15a3BhY2tcXFxcXFxcXFxcXFxcXFwiXFxcXFxcXCJdLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcInBhY2steWtwYWNrXFxcXFxcXCIsXFxcXG4gICAgICAgIH0sLypcXFxcbiAgICAgICAge1xcXFxuICAgICAgICAgICAga2V5czogW1xcXFxcXFwiaXRlbVxcXFxcXFwiXSxcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJpdGVtXFxcXFxcXCIsXFxcXG4gICAgICAgIH0sKi9cXFxcbiAgICAgICAge1xcXFxuICAgICAgICAgICAga2V5czogW1xcXFxcXFwiZGF0YV9saXN0XFxcXFxcXCJdLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImRhdGFfbGlzdFxcXFxcXFwiLFxcXFxuICAgICAgIC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V4dCcpLnJlcGxhY2UoL+esrChcXFxcXFxcXGQrKembhi8sICckMScpLnJlcGxhY2UoJ+esrCcsICcnKS5yZXBsYWNlKCfmnJ8nLCAnJyksXFxcXG4gICAgICAgICAgICB1cmw6IHBkKGxpc3Rbal0sICdhJiZocmVmJykgKyBsYXp5LFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IGxpc3QubGVuZ3RoID4gMyA/ICd0ZXh0XzQnIDogJ3RleHRfMicsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCIuanBnXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiLmpwZWdcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCIucG5nXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiLm1wNFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIi5tM3U4XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiLmdpZlxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgXVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcbiAgICB9XFxcXG59XFxcXG50cnkge1xcXFxuICAgIHNldFRhYnModGFicywgTVlfVVJMKTtcXFxcbiAgICBzZXRMaXN0cyhsaXN0cywgZ2V0VmFyKE1ZX1VSTCwgJzAnKSk7XFxcXG59IGNhdGNoIChlKSB7XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfmsqHmnInpgInpm4YnLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxcXG4gICAgfSlcXFxcbn1cXFxcbmQucHVzaCh7XFxcXG4gICAgdGl0bGU6ICc8YnI+J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xcXFxuICAgICAgICBsZXQgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0pO1xcXFxuICAgICAgICBpZiAoaW5kZXggPT09IDApIHtcXFxcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKVxcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiAnICsg5YiG57G76aKc6ImyICsgJ1xcXFxcXFwiPicgKyB0aXRsZSArICc8L3NwYW4+PC9iPicgOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3X2NhdGUgPSBbXVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFxcXFxcIjBcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkobmV3X2NhdGUpKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCBpbnB1dClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBlbHNlIGlmIChmb2xkID09PSAnMScpIHtcXFxcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKVxcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiAnICsg5YiG57G76aKc6ImyICsgJ1xcXFxcXFwiPicgKyB0aXRsZSArICc8L3NwYW4+PC9iPicgOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCBpbnB1dClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgICAg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SB7XFxcXG4gICAgICAgIGlmICh0eXBlb2YgbGF5b3V0ID09PSAnb2JqZWN0Jykge1xcXFxuICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyhsYXlvdXQpXFxcXG4gICAgICAgICAgICBsZXQgaW5qZWN0SW5kZXggPSBsYXlvdXQuaW5qZWN0SW5kZXggfHwgbGF5b3V0Wyfmipjlj6DmjInpkq7mj5LlhaXooYwnXVxcXFxuICAgICAgICAgICAgaWYgKGxheW91dC50aXRsZSB8fCBsYXlvdXQudXJsIHx8IGxheW91dC5jb2xfdHlwZSB8fCBpbmplY3RJbmRleCkge1xcXFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBrZXlzW2ldXFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1Gb2xkTGF5b3V0XVtrZXldID0gbGF5b3V0W2tleV07XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcXFxcXCLor7fkvKDlhaXmraPnoa7nmoTmipjlj6DnlYzpnaLlhYPntKDvvIFcXFxcXFxcIilcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIC8vIGluamVjdEluZGV4IOaKmOWPoOaMiemSruaPkuWFpeesrCBpbmplY3RJbmRleCDooYxcXFxcbiAgICAgICAgICAgIGlmIChpbmplY3RJbmRleCkge1xcXFxuICAgICAgICAgICAgICAgIGlmICghKHR5cGVvZiAoaW5qZWN0SW5kZXgpID09PSAnbnVtYmVyJykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXFxcXFwi5oqY5Y+g5oyJ6ZKu5o+S5YWl6KGM6K+35Lyg5YWl5pWw5a2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G9tO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcInBhcnNlRG9tRm9ySHRtbFxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcInBkZmhcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tRm9ySHRtbDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodXJsUnVsZVtcXFxcXFxcIuino+aekOaWueazlVxcXFxcXFwiXSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHVybFJ1bGVbXFxcXFxcXCLop6PmnpDmlrnms5VcXFxcXFxcIl0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwYXJzZURvbVxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcInBkXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwYXJzZURvbUZvckh0bWxcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwZGZoXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbUZvckh0bWw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgdXJsID0gcGFyc2Uoc3JjLCBtVXJsUnVsZSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpZiAodXJsUnVsZS5kZWFsVXJsKSB7XFxcXG4gICAgICAgICAgICAgICAgdXJsID0gdXJsUnVsZS5kZWFsVXJsKHVybClcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodXJsUnVsZVsn5LqM5qyh5aSE55CGJ10pIHtcXFxcbiAgICAgICAgICAgICAgICB1cmwgPSB1cmxSdWxlWyfkuozmrKHlpITnkIYnXSh1cmwpXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBpZiAodXJsUnVsZS5zdGFydHNXaXRoKFxcXFxcXFwiQGpzOlxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgIHVybCA9IHRoaXMuZXZhbEpTUnVsZShzcmMsIHVybFJ1bGUpO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB1cmwgPSBwYXJzZURvbShzcmMsIHVybFJ1bGUpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiB1cmwgfHwgXFxcXFxcXCJcXFxcXFxcIjtcXFxcbiAgICB9LFxcXFxuICAgIGJ1aWxkKCkge1xcXFxuICAgICAgICAvLyDmo4DmtYvmmK/lkKbkvKDlhaXpnIDopoHnmoTlj4LmlbBcXFxcbiAgICAgICAgdGhpcy5jaGVja1Bh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A9PT0gJzEnID8gJzAnIDogJzEnKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGFnOiBtVGFnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRm9sZDogdGhpc1tzeW1ib2xNYXAubUZvbGRdLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZBUk1BUDogdGhpcy5WQVJNQVBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IHRoaXNbc3ltYm9sTWFwLm1Gb2xkTGF5b3V0XS5jb2xfdHlwZSB8fCBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKGZvbGRMYXlvdXQpXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgLy/lhbfkvZPliJfooajkuIvnmoTliIbnsbtcXFxcbiAgICAgICAgICAgICAgICBsZXQgc3ViX2NhdGVnb3JpZXMgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoY2F0ZWdvcnkuc3ViTGlzdFJ1bGUuc3RhcnRzV2l0aChcXFxcXFxcIkBqczpcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSB0aGlzLmV2YWxKU1J1bGUoY2F0ZWdvcnkubGlzdCwgY2F0ZWdvcnkuc3ViTGlzdFJ1bGUpXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwYXJzZURvbUZvckFycmF5KGNhdGVnb3J5Lmxpc3QsIGNhdGVnb3J5LnN1Ykxpc3RSdWxlKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKGluZGV4IDwgKHRoaXNbc3ltYm9sTWFwLm1Gb2xkSW5kZXhdIHx8IDEpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gdGhpcy5nZXRUaXRsZShpdGVtLCBjYXRlZ29yeSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSB0aGlzLmdldFVybChpdGVtLCBjYXRlZ29yeSlcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxmb250IGNvbG9yPScgKyB0aGlzW3N5bWJvbE1hcC5tQ29sb3JdICsgJz4nICsgdGl0bGUgKyAnIDwvZm9udD48L2I+JyA6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJCh1cmwpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW11cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5pbmRleCA9PT0gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFxcXFxcIjBcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuQ0FURUdPUlksIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5pbmRleCA9PT0gMCA/IG5ld19jYXRlIDogcGFyYW1zLmNhdGVfdGVtcCkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLlVSTCwgaW5wdXQpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFnOiBtVGFnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogdGhpc1tzeW1ib2xNYXAubVBhZ2VdLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJsYW5rX2Jsb2NrXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzW3N5bWJvbE1hcC5tRm9sZF0gPT09ICcwJykge1xcXFxuICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHRoaXMuZ2V0VGl0bGUoaXRlbSwgY2F0ZWdvcnkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgY2F0ZWdvcnkpXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48Zm9udCBjb2xvcj0nICsgdGhpc1tzeW1ib2xNYXAubUNvbG9yXSArICc+JyArIHRpdGxlICsgJyA8L2ZvbnQ+PC9iPicgOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLkNBVEVHT1JZLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuVVJMLCBpbnB1dClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQVJNQVA6IHRoaXMuVkFSTUFQLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWc6IG1UYWcsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiB0aGlzW3N5bWJvbE1hcC5tUGFnZV0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYmxhbmtfYmxvY2tcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0sXFxcXG5cXFxcbiAgICDnlYzpnaIobGF5b3V0KSB7XFxcXG4gICAgICAgIHJldHVybiB0aGlzLmxheW91dChsYXlvdXQpXFxcXG4gICAgfSxcXFxcbiAgICDliIbnsbvpk77mjqUodHJ1ZVVybCkge1xcXFxuICAgICAgICByZXR1cm4gdGhpcy50cnVlVXJsKHRydWVVcmwpO1xcXFxuICAgIH0sXFxcXG4gICAg6aG156CBKHBhZ2UpIHtcXFxcbiAgICAgICAgcmV0dXJuIHRoaXMucGFnZShwYWdlKTtcXFxcbiAgICB9LFxcXFxuICAgIOa6kOeggShodG1sKSB7XFxcXG4gICAgICAgIHJldHVybiB0aGlzLmh0bWwoaHRtbCk7XFxcXG4gICAgfSxcXFxcbiAgICDlrprkvY3kuIDnuqfliIbnsbsobGlzdCkge1xcXFxuICAgICAgICByZXR1cm4gdGhpcy5saXN0KG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gICAgdGhpcy5wYXJhbXMucGFnZSA9IHBhZ2VcXFxcbiAgICAgICAgcmV0dXJuIHRoaXNcXFxcbiAgICB9LFxcXFxuICAgIGFkZEV4dHJhKHJlZ0V4cCkge1xcXFxuICAgICAgICBpZiAocmVnRXhwLmNvbnN0cnVjdG9yID09PSBBcnJheSkge1xcXFxuICAgICAgICAgICAgdGhpcy5yZWdleE1hcCA9IHRoaXMucmVnZXhNYXAuY29uY2F0KHJlZ0V4cClcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIHRoaXMucmVnZXhNYXAucHVzaChyZWdFeHApXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxcXG4gICAgfSxcXFxcbiAgICBkZWJ1ZygpIHtcXFxcbiAgICAgICAgdGhpcy5wYXJhbXMuZGVidWcgPSB0cnVlXFxcXG4gICAgICAgIHJldHVybiB0aGlzO1xcXFxuICAgIH0sXFxcXG4gICAgZXhlYygpIHtcXFxcbiAgICAgICAgdGhpcy5jaGVja1BhcmFtcygpXFxcXG4gICAgICAgIGxldCB0cnVlX3VybCA9ICcnXFxcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy5yZWdleE1hcC5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgbGV0IHJlZ09iaiA9IHRoaXMucmVnZXhNYXBbaV07XFxcXG4gICAgICAgICAgICBsZXQgdXJsRXhwID0gcmVnT2JqLnJlZztcXFxcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdXJsRXhwID09PSAnc3RyaW5nJykge1xcXFxuICAgICAgICAgICAgICAgIHVybEV4cCA9IG5ldyBSZWdFeHAodXJsRXhwKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHVybEV4cC50ZXN0KHRoaXMucGFyYW1zLnVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5wYXJhbXMuZGVidWcpIHtcXFx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nMsIE1ZX1VSTCk7XFxcXG5zZXRMaXN0cyhsaXN0cywgZ2V0VmFyKE1ZX1VSTCwgJzAnKSk7XFxcXG5zZXRSZXN1bHQoZCk7XFxcIn1dXCJ9IiwidGl0bGUiOiLmtYvor5UifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement