Advertisement
xiaomianao666

邀您一起看:天翼云盘

Sep 9th, 2022
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥天翼云盘@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIjEyM3BhblwiLFwicGF0aFwiOlwiMTIzcGFuXCIsXCJydWxlXCI6XCJqczpcXG52YXIgZCA9IFtdO1xcbnRyeSB7XFxuICAgIGNvbnN0IHtcXG4gICAgICAgIGZpbGVMaXN0LFxcbiAgICAgICAgZ2V0SWNvblxcbiAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvY29kZVxcXCIpXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuKame+4j+iuvue9rlxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2Uvc2V0dGluZ3NcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIlxcbiAgICB9KVxcbiAgICBpZiAoZ2V0SXRlbShcXFwidG9rZW5cXFwiLCBcXFwiXFxcIikgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgIHZhciBwYXRocyA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJwYXRoczEyM1xcXCIsIFt7XFxuICAgICAgICAgICAgbmFtZTogXFxcIuagueebruW9lVxcXCIsXFxuICAgICAgICAgICAgaWQ6IFxcXCIwXFxcIlxcbiAgICAgICAgfV0pXFxuICAgICAgICBpZiAocGF0aHMubGVuZ3RoID4gMSkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiPFxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChwYXRocykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcGF0aHMucG9wKClcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJwYXRoczEyM1xcXCIsIHBhdGhzKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9LCBwYXRocylcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgcGF0aHMuZm9yRWFjaCgoaXRlbSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaXRlbSwgcGF0aHMsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaWRcXFwiLCBpdGVtLmlkKVxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBhdGhzMTIzXFxcIiwgcGF0aHMuc2xpY2UoMCwgaW5kZXggKyAxKSlcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgcGF0aHMsIGluZGV4KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICAgICAgZmlsZUxpc3QocGF0aHNbcGF0aHMubGVuZ3RoIC0gMV0uaWQpLmRhdGEuSW5mb0xpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICB2YXIgaW1nID0gZ2V0SWNvbihpdGVtKVxcbiAgICAgICAgICAgIGlmIChpdGVtLlR5cGUgPT0gMSkge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpZCwgbmFtZSwgcGF0aHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHBhdGhzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGlkXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBhdGhzMTIzXFxcIiwgcGF0aHMpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0uRmlsZUlkLCBpdGVtLkZpbGVOYW1lLCBwYXRocylcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gaXRlbS5Eb3dubG9hZFVybFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5GaWxlTmFtZSxcX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fSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2NvZGUxXFxcIilcXG4gICAgICAgIGxldCBwYXRocyA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJwYXRoc2JhaWR1XFxcIiwgW3tcXG4gICAgICAgICAgICBwYXRoOiBcXFwiL1xcXCIsXFxuICAgICAgICAgICAgbmFtZTogXFxcIuWutlxcXCJcXG4gICAgICAgIH1dKVxcbiAgICAgICAgcGF0aHMuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChwYXRocywgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBhdGhzYmFpZHVcXFwiLCBwYXRocy5zbGljZSgwLCBpICsgMSkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0sIHBhdGhzLCBpKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocmVxdWVzdChidWlsZFVybChcXFwiaHR0cHM6Ly9wYW4uYmFpZHUuY29tL3Jlc3QvMi4wL3hwYW4vZmlsZVxcXCIsIHtcXG4gICAgICAgICAgICBcXFwiYWNjZXNzX3Rva2VuXFxcIjogZ2V0SXRlbShcXFwiYWNjZXNzX3Rva2VuYmFpZHVcXFwiKSxcXG4gICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcImxpc3RcXFwiLFxcbiAgICAgICAgICAgIFxcXCJkaXJcXFwiOiBwYXRoc1twYXRocy5sZW5ndGggLSAxXS5wYXRoLFxcbiAgICAgICAgICAgIFxcXCJ3ZWJcXFwiOiBcXFwid2ViXFxcIixcXG4gICAgICAgICAgICBcXFwibGltaXRcXFwiOiAwLFxcbiAgICAgICAgICAgIFxcXCJsaW1pdFxcXCI6IDIwMFxcbiAgICAgICAgfSkpKVxcbiAgICAgICAgcmVzLmxpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICBpZiAoaXRlbS5pc2RpciA9PSAxKSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSAkKCkubGF6eVJ1bGUoKGl0ZW0sIHBhdGhzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwYXRocy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhdGgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogaXRlbS5zZXJ2ZXJfZmlsZW5hbWVcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGF0aHNiYWlkdVxcXCIsIHBhdGhzKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLCBwYXRocylcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQubW92aWUuaW5jbHVkZXMoZ2V0SHptKGl0ZW0uc2VydmVyX2ZpbGVuYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IGdldExpbmsoXFxcIm1vdmllXFxcIiwgaXRlbS5mc19pZCwgaXRlbS5wYXRoKVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5hdWRpby5pbmNsdWRlcyhnZXRIem0oaXRlbS5zZXJ2ZXJfZmlsZW5hbWUpKSkge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gZ2V0TGluayhcXFwiYXVkaW9cXFwiLCBpdGVtLmZzX2lkLCBpdGVtLnBhdGgpXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLmltZy5pbmNsdWRlcyhnZXRIem0oaXRlbS5zZXJ2ZXJfZmlsZW5hbWUpKSkge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gZ2V0TGluayhcXFwiaW1nXFxcIiwgaXRlbS5mc19pZCwgaXRlbS5wYXRoKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBnZXRMaW5rKFxcXCJcXFwiLCBpdGVtLmZzX2lkLCBpdGVtLnBhdGgpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnNlcnZlcl9maWxlbmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiBnZXRJY29uKGl0ZW0pLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxuICAgICAgICB0b2FzdChcXFwi5Ye6546w6ZSZ6K+v77yM6K+35p+l55yL5pel5b+XXFxcIikgICAgICAgIFxcbiAgICB9XFxufVxcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcImNvZGUxXCIsXCJwYXRoXCI6XCJjb2RlMVwiLFwicnVsZVwiOlwiJC5leHBvcnRzLmdldEljb24gPSBmdW5jdGlvbihjb250ZW50KSB7XFxuICAgIGxldCB7XFxuICAgICAgICBnZXRIem1cXG4gICAgfSA9ICQucm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ICAgICAgICAgICAgICAgXFxcImRsaW5rXFxcIjogXFxcIjFcXFwiXFxuICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwicGFuLmJhaWR1LmNvbVxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pKS5saXN0WzBdLmRsaW5rICsgXFxcIiZhY2Nlc3NfdG9rZW49XFxcIiArIGdldEl0ZW0oXFxcImFjY2Vzc190b2tlblxcXCIpXFxuICAgICAgICB9XFxuICAgICAgICBpZiAoZXh0ID09IFxcXCJtb3ZpZVxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbcmVzICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIl0sXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcInBhbi5iYWlkdS5jb21cXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSBlbHNlIGlmIChleHQgPT0gXFxcImF1ZGlvXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIHVybHM6IFtyZXMgKyBcXFwiI2lzTXVzaWM9dHJ1ZSNcXFwiXSxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwicGFuLmJhaWR1LmNvbVxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2UgaWYgKGV4dCA9PSBcXFwiaW1nXFxcIikge1xcbiAgICAgICAgICAgIHJldH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pID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJwaWtwYWthcHA6Ly9teXBpa3Bhay5jb20veHBhbi9tYWluX3RhYj90YWI9MSZhZGRfdXJsPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQoaW5wdXQpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgICAgICBwYXRocy5mb3JFYWNoKChpdGVtLCBpKSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKHBhdGhzLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGF0aHNwaWtwYWtcXFwiLCBwYXRocy5zbGljZSgwLCBpICsgMSkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0sIHBhdGhzLCBpKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICAgICAgbGV0IGxpc3QgPSBKU09OLnBhcnNlKHJlcXVlc3QoYnVpbGRVcmwoXFxcImh0dHBzOi8vYXBpLWRyaXZlLm15cGlrcGFrLmNvbS9kcml2ZS92MS9maWxlc1xcXCIsIHtcXG4gICAgICAgICAgICBcXFwicGFyZW50X2lkXFxcIjogcGF0aHNbcGF0aHMubGVuZ3RoIC0gMV0uaWQsXFxuICAgICAgICAgICAgXFxcInRodW1ibmFpbF9zaXplXFxcIjogXFxcIlNJWkVfTEFSR0VcXFwiLFxcbiAgICAgICAgICAgIFxcXCJ3aXRoX2F1ZGl0XFxcIjogXFxcInRydWVcXFwiLFxcbiAgICAgICAgICAgIFxcXCJsaW1pdFxcXCI6IFxcXCIxMDAwXFxcIixcXG4gICAgICAgICAgICBcXFwiZmlsdGVyc1xcXCI6ICd7XFxcInBoYXNlXFxcIjp7XFxcImVxXFxcIjpcXFwiUEhBU0VfVFlQRV9DT01QTEVURVxcXCJ9LFxcXCJ0cmFzaGVkXFxcIjp7XFxcImVxXFxcIjpmYWxzZX19JyxcXG4gICAgICAgICAgICBcXFwicGFnZV90b2tlblxcXCI6IFxcXCJcXFwiXFxuICAgICAgICB9KSwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgXFxcIkF1dGhvcml6YXRpb25cXFwiOiBcXFwiQmVhcmVyIFxcXCIgKyBnZXRJdGVtKFxcXCJhY2Nlc3NfdG9rZW5cXFwiKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pKVxcbiAgICAgICAgbGlzdC5maWxlcy5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIGlmIChpdGVtLmtpbmQgPT0gXFxcImRyaXZlI2ZvbGRlclxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybGwgPSAkKCkubGF6eVJ1bGUoKHBhdGhzLCBpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwYXRocy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5pZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGF0aHNwaWtwYWtcXFwiLCBwYXRocylcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSwgcGF0aHMsIGl0ZW0pXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLm1vdmllLmluY2x1ZGVzKGdldEh6bShpdGVtLm5hbWUpKSkge1xcblxcbiAgICAgICAgICAgICAgICB2YXIgZXh0ID0gXFxcIiNpc1ZpZGVvPXRydWUjXFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5hdWRpby5pbmNsdWRlcyhnZXRIem0oaXRlbS5uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGV4dCA9IFxcXCIjaXNNdXNpYz10cnVlI1xcXCJcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQuaW1nLmluY2x1ZGVzKGdldEh6bShpdGVtLm5hbWUpKSkge1xcbiAgICAgICAgICAgICAgICB2YXIgZXh0ID0gXFxcIiMuanBnXFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciBleHQgPSBcXFwiXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpdGVtLCBleHQpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBgaHR0cHM6Ly9hcGktZHJpdmUubXlwaWtwYWsuY29tL2RyaXZlL3YxL2ZpbGVzLyR7aXRlbS5pZH0/X21hZ2ljPTIwMjEmdGh1bWJuYWlsX3NpemU9U0laRV9MQVJHRWBcXG4gICAgICAgICAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocmVxdWVzdCh1LCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkF1dGhvcml6YXRpb25cXFwiOiBcXFwiQmVhcmVyIFxcXCIgKyBnZXRJdGVtKFxcXCJhY2Nlc3NfdG9rZW5cXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIHJlcy5tZWRpYXMpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRtcCA9IGl0ZW0ubGlua1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXAudXJsKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0bXAudXJsICsgZXh0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGl0ZW0sIGV4dClcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IGl0ZW0uaWNvbl9saW5rLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogaXRlbS5raW5kID09IFxcXCJkcml2ZSNmb2xkZXJcXFwiID8gdXJsbCA6IHVybFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB0b2FzdChcXFwi5qOA5rWL5Yiw6ZSZ6K+vXFxcIilcXG4gICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxuICAgIH1cXG59XFxuXFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiY29kZTJcIixcInBhdGhcIjpcImNvZGUyXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMubG9naW4gPSBmdW5jdGlvbih1c2VybmFtZSwgcGFzc3dvcmQpIHtcXG4gICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocG9zdChcXFwiaHR0cHM6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0pXFxuc2V0UmVzdWx0KGQpXCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLlpKnnv7zkupHnm5hcIixcInBhdGhcIjpcIuWkqee/vOS6keebmFwiLFwicnVsZVwiOlwianM6XFxudmFyIGQgPSBbXTtcXG50cnkge1xcbiAgICBpZiAoZmlsZUV4aXN0KFxcXCIxODkudHh0XFxcIikpIHtcXG4gICAgICAgIGNvbnN0IHtcXG4gICAgICAgICAgICBnZXRGaWxlcyxcXG4gICAgICAgICAgICBnZXRJY29uXFxuICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvY29kZTNcXFwiKVxcbiAgICAgICAgdmFyIHBhdGhzID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcInBhdGhzdHlcXFwiLCBbe1xcbiAgICAgICAgICAgIFxcXCJpZFxcXCI6IC0xMSxcXG4gICAgICAgICAgICBcXFwibmFtZVxcXCI6IFxcXCLlrrZcXFwiXFxuICAgICAgICB9XSlcXG4gICAgICAgIHBhdGhzLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgocGF0aHMsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJwYXRoc3R5XFxcIiwgcGF0aHMuc2xpY2UoMCwgaSArIDEpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9LCBwYXRocywgaSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgICAgIGxldCBsaXN0ID0gZ2V0RmlsZXMocGF0aHNbcGF0aHMubGVuZ3RoIC0gMV0uaWQpXFxuICAgICAgICBsaXN0LmZpbGVMaXN0QU8uZm9sZGVyTGlzdC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly9naXRjb2RlLm5ldC9xcV8zMjM5NDM1MS9kci8tL3Jhdy9tYXN0ZXIvaW1nL+aWh+S7tuexu+WeizIv5paH5Lu25aS5LnN2Z1xcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChwYXRocywgaWQsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHBhdGhzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBhdGhzdHlcXFwiLCBwYXRocylcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSwgcGF0aHMsIGl0ZW0uaWQsIGl0ZW0ubmFtZSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgICAgIGxpc3QuZmlsZUxpc3RBTy5maWxlTGlzdC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIHZhciBpbWcgPSBnZXRJY29uKGl0ZW0ubmFtZSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaWQsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRIem1cXG4gICAgICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9jb2RlXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb29raWUgPSByZWFkRmlsZShcXFwiMTg5LnR4dFxcXCIpXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IFxcXCJodHRwczovL2Nsb3VkLjE4OS5jbi9hcGkvcG9ydGFsL2dldEZpbGVJbmZvLmFjdGlvblxcXCJcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXMgPSBKU09OLnBhcnNlKHJlcXVlc3QoYnVpbGRVcmwodSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJmaWxlSWRcXFwiOiBpZFxcbiAgICAgICAgICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiBjb29raWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJBY2NlcHRcXFwiOiBcXFwiYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBQQ19VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQubW92aWUuaW5jbHVkZXMoZ2V0SHptKG5hbWUpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtcXFwiaHR0cHM6XFxcIiArIHJlcy5kb3dubG9hZFVybCArIFxcXCIjaXNWaWRlbz10cnVlI1xcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogY29va2llLnJlcGxhY2UoLzsvZywgXFxcIu+8m++8m1xcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBQQ19VQS5yZXBsYWNlKC87L2csIFxcXCLvvJvvvJtcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5hdWRpby5pbmNsdWRlcyhnZXRIem0obmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW1xcXCJodHRwczpcXFwiICsgcmVzLmRvd25sb2FkVXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIl0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiBjb29raWUucmVwbGFjZSgvOy9nLCBcXFwi77yb77ybXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFBDX1VBLnJlcGxhY2UoLzsvZywgXFxcIu+8m++8m1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLmltZy5pbmNsdWRlcyhnZXRIem0obmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczpcXFwiICsgcmVzLmRvd25sb2FkVXJsICsgYCMuanBnQFVzZXItQWdlbnQ9JHtQQ19VQX1AQ29va2llPSR7Y29va2llfWBcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJkb3dubG9hZDovL2h0dHBzOlxcXCIgKyByZXMuZG93bmxvYWRVcmwgKyBgQFVzZXItQWdlbnQ9JHtQQ19VQX1AQ29va2llPSR7Y29va2llfWBcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgaXRlbS5pZCwgaXRlbS5uYW1lKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgZC51bnNoaWZ0KHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIueZu+mZhlxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2xvZ2luM1xcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIlxcbiAgICAgICAgfSlcXG4gICAgfVxcbn0gY2F0Y2ggKGUpIHtcXG4gICAgZC51bnNoaWZ0KHtcXG4gICAgICAgIHRpdGxlOiBcXFwi55m76ZmGXFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9sb2dpbjNcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlc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7Lojrflj5bliLBjb29raWVcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5iYWNrKCk7ICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIHVhOiBQQ19VQSxcXG4gICAgICAgIGNhbkJhY2s6IHRydWVcXG4gICAgfVxcbn0pXFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5aS45YWL572R55uYXCIsXCJwYXRoXCI6XCLlpLjlhYvnvZHnm5hcIixcInJ1bGVcIjpcImpzOlxcbnZhciBkID0gW107XFxudHJ5IHtcXG4gICAgaWYgKGZpbGVFeGlzdChcXFwicXVhcmsudHh0XFxcIikpIHtcXG4gICAgICAgIGNvbnN0IHtcXG4gICAgICAgICAgICBnZXRJY29uLFxcbiAgICAgICAgICAgIGdldEh6bSxcXG4gICAgICAgICAgICBnZXRMaW5rXFxuICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvY29kZTRcXFwiKVxcbiAgICAgICAgdmFyIGNvb2tpZSA9IHJlYWRGaWxlKFxcXCJxdWFyay50eHRcXFwiKVxcbiAgICAgICAgbGV0IHVzZXJpbmZvID0gSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJodHRwczovL3Bhbi5xdWFyay5jbi9hY2NvdW50L2luZm9cXFwiLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogY29va2llXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSkpXFxuICAgICAgICBsZXQgcGF0aHMgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwicGF0aHNcXFwiLCBbe1xcbiAgICAgICAgICAgIFxcXCJpZFxcXCI6IFxcXCIwXFxcIixcXG4gICAgICAgICAgICBcXFwibmFtZVxcXCI6IFxcXCLmoLnnm67lvZVcXFwiXFxuICAgICAgICB9XSlcXG4gICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdXNlcmluZm8uZGF0YS5uaWNrbmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiB1c2VyaW5mby5kYXRhLmF2YXRhclVyaSxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL3NldHRpbmdzNFxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgcGF0aHMuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgocGF0aHMsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGF0aHNcXFwiLCBwYXRocy5zbGljZSgwLCBpICsgMSkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHBhdGhzLCBpKVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcmVzID0gSlNPTi5wYXJzZShyZXF1ZXN0KGJ1aWxkVXJsKFxcXCJodHRwczovL2RyaXZlLnF1YXJrLmNuLzEvY2xvdWRkcml2ZS9maWxlL3NvcnRcXFwiLCB7XFxuICAgICAgICAgICAgXFxcInBkaXJfZmlkXFxcIjogcGF0aHNbcGF0aHMubGVuZ3RoIC0gMV0uaWQsXFxuICAgICAgICAgICAgXFxcImZyXFxcIjogXFxcInBjXFxcIixcXG4gICAgICAgICAgICBcXFwicHJcXFwiOiBcXFwidWNwcm9cXFwiLFxcbiAgICAgICAgICAgIFxcXCJfc2l6ZVxcXCI6IDEwLFxcbiAgICAgICAgICAgIFxcXCJfZmV0Y2hfdG90YWxcXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgXFxcIl9zb3J0XFxcIjogXFxcImZpbGVfdHlwZTphc2MsZmlsZV9uYW1lOmFzY1xcXCIsXFxuICAgICAgICAgICAgXFxcIl9wYWdlXFxcIjogZ2V0UGFyYW0oXFxcInBhZ2VcXFwiKVxcbiAgICAgICAgfSksIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiBjb29raWUsXFxuICAgICAgICAgICAgICAgIFxcXCJBY2NlcHRcXFwiOiBcXFwiYXBwbGljYXRpb24vanNvbiwgdGV4dC9wbGFpbiwgKi8qXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6Ly9wYW4ucXVhcmsuY24vXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pKVxcbiAgICAgICAgcmVzLmRhdGEubGlzdC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIGlmICghaXRlbS5maWxlKSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSAkKCkubGF6eVJ1bGUoKGl0ZW0sIHBhdGhzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwYXRocy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5maWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogaXRlbS5maWxlX25hbWVcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGF0aHNcXFwiLCBwYXRocylcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgcGF0aHMpXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLm1vdmllLmluY2x1ZGVzKGdldEh6bShpdGVtLmZpbGVfbmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBnZXRMaW5rKGl0ZW0sIGNvb2tpZSwgXFxcIm1vdmllXFxcIilcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQuYXVkaW8uaW5jbHVkZXMoZ2V0SHptKGl0ZW0uZmlsZV9uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IGdldExpbmsoaXRlbSwgY29va2llLCBcXFwiYXVkaW9cXFwiKVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5pbWcuaW5jbHVkZXMoZ2V0SHptKGl0ZW0uZmlsZV9uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IGdldExpbmsoaXRlbSwgY29va2llLCBcXFwiaW1nXFxcIilcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gZ2V0TGluayhpdGVtLCBjb29raWUpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLmZpbGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiBnZXRJY29uKGl0ZW0pLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgY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AgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8vcGFuLnF1YXJrLmNuL1xcXCJcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcImZpZHNcXFwiOiBbZmlkXVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KSlcXG4gICAgICAgIGlmIChleHQgPT0gXFxcIm1vdmllXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIHVybHM6IFtyZXMuZGF0YVswXS5kb3dubG9hZF91cmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiXSxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IGNvb2tpZS5yZXBsYWNlKC87L2csIFxcXCLvvJvvvJtcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8vcGFuLnF1YXJrLmNuL1xcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2UgaWYgKGV4dCA9PSBcXFwiYXVkaW9cXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3Jlcy5kYXRhWzBdLmRvd25sb2FkX3VybCArIFxcXCIjaXNNdXNpYz10cnVlI1xcXCJdLFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogY29va2llLnJlcGxhY2UoLzsvZywgXFxcIu+8m++8m1xcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6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Toge1xcbiAgICAgICAganM6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgIHZhciB1cmwgPSBsb2NhdGlvbi5ocmVmXFxuICAgICAgICAgICAgaWYgKHVybCA9PSBcXFwiaHR0cHM6Ly9wYW4ucXVhcmsuY24vbGlzdCMvbGlzdC9hbGxcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGxldCBjb29raWUgPSBmYmEuZ2V0Q29va2llKHVybCk7XFxuICAgICAgICAgICAgICAgIGlmIChjb29raWUgIT0gbnVsbCAmJiBjb29raWUubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLnB1dFZhcih1cmwsIGNvb2tpZSk7XFxuICAgICAgICAgICAgICAgICAgICBhbGVydChcXFwi5bey6I635Y+W5YiwY29va2llXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmYmEuYmFjaygpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICB1YTogUENfVUEsXFxuICAgICAgICBjYW5CYWNrOiB0cnVlXFxuICAgIH1cXG59KVxcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuWFs+S6jlwiLFwicGF0aFwiOlwiYWJvdXRcIixcInJ1bGVcIjpcImpzOlxcbnZhciBkID0gW107XFxuYWRkTGlzdGVuZXIoXFxcIm9uQ2xvc2VcXFwiLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgY2xlYXJNeVZhcihcXFwiY1xcXCIpO1xcbn0pKTtcXG5kLnB1c2goJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvYWJvdXQyXFxcIikpO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwiXFxcIixcXG4gICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgIGxldCBjID0gcGFyc2VJbnQoZ2V0TXlWYXIoXFxcImNcXFwiLCBcXFwiMVxcXCIpKVxcbiAgICAgICAgaWYgKGMgPj0gNSkge1xcbiAgICAgICAgICAgIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIua4qemmqOaPkOekulxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IFxcXCLnoa7lrpropoHlvIDlkK/lvIDlj5HogIXmqKHlvI/lkJfvvJ/ms6jmhI/lvIDlkK/or6XmqKHlvI/liJnooajnpLrlkI7nu63mgqjnmoTmiYDmnInmk43kvZzlnYfkuLrkuLvop4Log73liqjmk43kvZzvvIzmiYDkuqfnlJ/nmoTkuIDliIfpl67popjkuI7otKPku7vlnYfnlLHmgqjoh6rlt7Hmib/mi4VcXFwiLFxcbiAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcImRldlxcXCIsIFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey5byA5ZCv5byA5Y+R6ICF5qih5byPXFxcIlxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNcXFwiLCBjICsgMSArIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgfVxcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgZGVzYzogXFxcIlxcXCIsXFxuICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgbG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Y29uc3Qge1xcbiAgICAgICAgICAgIGdldEZpbGVzLFxcbiAgICAgICAgICAgIGdldEljb25cXG4gICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9jb2RlM1xcXCIpXFxuICAgICAgICB2YXIgcGF0aHMgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwicGF0aHN0eVxcXCIsIFt7XFxuICAgICAgICAgICAgXFxcImlkXFxcIjogLTExLFxcbiAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogXFxcIuWutlxcXCJcXG4gICAgICAgIH1dKVxcbiAgICAgICAgcGF0aHMuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChwYXRocywgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBhdGhzdHlcXFwiLCBwYXRocy5zbGljZSgwLCBpICsgMSkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0sIHBhdGhzLCBpKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICAgICAgbGV0IGxpc3QgPSBnZXRGaWxlcyhwYXRoc1twYXRocy5sZW5ndGggLSAxXS5pZClcXG4gICAgICAgIGxpc3QuZmlsZUxpc3RBTy5mb2xkZXJMaXN0LmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICBpbWc6IFxcXCJodHRwczovL2dpdGNvZGUubmV0L3FxXzMyMzk0MzUxL2RyLy0vcmF3L21hc3Rlci9pbWcv5paH5Lu257G75Z6LMi/mlofku7blpLkuc3ZnXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKHBhdGhzLCBpZCwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcGF0aHMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IG5hbWVcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGF0aHN0eVxcXCIsIHBhdGhzKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9LCBwYXRocywgaXRlbS5pZCwgaXRlbS5uYW1lKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICAgICAgbGlzdC5maWxlTGlzdEFPLmZpbGVMaXN0LmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgdmFyIGltZyA9IGdldEljb24oaXRlbS5uYW1lKVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChpZCwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldEh6bVxcbiAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2NvZGVcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvb2tpZSA9IHJlYWRGaWxlKFxcXCIxODkudHh0XFxcIilcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1ID0gXFxcImh0dHBzOi8vY2xvdWQuMTg5LmNuL2FwaS9wb3J0YWwvZ2V0RmlsZUluZm8uYWN0aW9uXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocmVxdWVzdChidWlsZFVybCh1LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImZpbGVJZFxcXCI6IGlkXFxuICAgICAgICAgICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IGNvb2tpZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkFjY2VwdFxcXCI6IFxcXCJhcHBsaWNhdGlvbi9qc29uO2NoYXJzZXQ9VVRGLThcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFBDX1VBXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgICAgICAgICBpZiAoJC5tb3ZpZS5pbmNsdWRlcyhnZXRIem0obmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW1xcXCJodHRwczpcXFwiICsgcmVzLmRvd25sb2FkVXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIl0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiBjb29raWUucmVwbGFjZSgvOy9nLCBcXFwi77yb77ybXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFBDX1VBLnJlcGxhY2UoLzsvZywgXFxcIu+8m++8m1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLmF1ZGlvLmluY2x1ZGVzKGdldEh6bShuYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXFxcImh0dHBzOlxcXCIgKyByZXMuZG93bmxvYWRVcmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IGNvb2tpZS5yZXBsYWNlKC87L2csIFxcXCLvvJvvvJtcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogUENfVUEucmVwbGFjZSgvOy9nLCBcXFwi77yb77ybXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQuaW1nLmluY2x1ZGVzKGdldEh6bShuYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImh0dHBzOlxcXCIgKyByZXMuZG93bmxvYWRVcmwgKyBgIy5qcGdAVXNlci1BZ2VudD0ke1BDX1VBfUBDb29raWU9JHtjb29raWV9YFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImRvd25sb2FkOi8vaHR0cHM6XFxcIiArIHJlcy5kb3dubG9hZFVybCArIGBAVXNlci1BZ2VudD0ke1BDX1VBfUBDb29raWU9JHtjb29raWV9YFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLmlkLCBpdGVtLm5hbWUpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBkLnVuc2hpZnQoe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi55m76ZmGXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvbG9naW4zXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiXFxuICAgICAgICB9KVxcbiAgICB9XFxufSBjYXRjaCAoZSkge1xcbiAgICBkLnVuc2hpZnQoe1xcbiAgICAgICAgdGl0bGU6IFxcXCLnmbvpmYZcXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2xvZ2luM1xcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiXFxuICAgIH0pXFxuICAgIGxvZyhlLm1lc3NhZ2UpXFxuICAgIHRvYXN0KFxcXCLnqIvluo/lj6/og73lh7rplJnkuobvvIzor7fmn6XnnIvml6Xlv5dcXFwiKVxcbn1cXG5zZXRSZXN1bHQoZCk7XCIsXCJncm91cFwiOlwi4pGg572R55uYXCIsXCJ1YVwiOlwibW9iaWxlXCIsXCJwcmVSdWxlXCI6XCIkLmV4dGVuZCh7XFxuICAg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cXFwidG9rZW5cXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIikgIT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICB2YXIgcGF0aHMgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFxcXFxcInBhdGhzMTIzXFxcXFxcXCIsIFt7XFxcXG4gICAgICAgICAgICBuYW1lOiBcXFxcXFxcIuagueebruW9lVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgaWQ6IFxcXFxcXFwiMFxcXFxcXFwiXFxcXG4gICAgICAgIH1dKVxcXFxuICAgICAgICBpZiAocGF0aHMubGVuZ3RoID4gMSkge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCI8XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChwYXRocykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwYXRocy5wb3AoKVxcXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFxcXFxcInBhdGhzMTIzXFxcXFxcXCIsIHBhdGhzKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0sIHBhdGhzKVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBwYXRocy5mb3JFYWNoKChpdGVtLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaXRlbSwgcGF0aHMsIGluZGV4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiaWRcXFxcXFxcIiwgaXRlbS5pZClcXFxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcXFxcXCJwYXRoczEyM1xcXFxcXFwiLCBwYXRocy5zbGljZSgwLCBpbmRleCArIDEpKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0sIHBhdGhzLCBpbmRleClcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIGZpbGVMaXN0KHBhdGhzW3BhdGhzLmxlbmd0aCAtIDFdLmlkKS5kYXRhLkluZm9MaXN0LmZvckVhY2goaXRlbSA9PiB7XFxcXG4gICAgICAgICAgICB2YXIgaW1nID0gZ2V0SWNvbihpdGVtKVxcXFxuICAgICAgICAgICAgaWYgKGl0ZW0uVHlwZSA9PSAxKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9ICQoKS5sYXp5UnVsZSgoaWQsIG5hbWUsIHBhdGhzKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHBhdGhzLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpZFxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFxcXFxcInBhdGhzMTIzXF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AgIFxcXFxcXFwiZnNpZHNcXFxcXFxcIjogYFske2lkfV1gLFxcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwiZGxpbmtcXFxcXFxcIjogXFxcXFxcXCIxXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0pLCB7XFxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlVzZXItQWdlbnRcXFxcXFxcIjogXFxcXFxcXCJwYW4uYmFpZHUuY29tXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KSkubGlzdFswXS5kbGluayArIFxcXFxcXFwiJmFjY2Vzc190b2tlbj1cXFxcXFxcIiArIGdldEl0ZW0oXFxcXFxcXCJhY2Nlc3NfdG9rZW5cXFxcXFxcIilcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpZiAoZXh0ID09IFxcXFxcXFwibW92aWVcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICB1cmxzOiBbcmVzICsgXFxcXFxcXCIjaXNWaWRlbz10cnVlI1xcXFxcXFwiXSxcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBcXFxcXFxcInBhbi5iYWlkdS5jb21cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0gZWxzZSBpZiAoZXh0ID09IFxcXFxcXFwiYXVkaW9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICB1cmxzOiBbcmVzICsgXFxcXFxcXCIjaXNNdXNpYz10cnVlI1xcXFxcXFwiXSxcXFxc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dHBzOi8vYXBpLWRyaXZlLm15cGlrcGFrLmNvbS9kcml2ZS92MS9maWxlcy8ke2l0ZW0uaWR9P19tYWdpYz0yMDIxJnRodW1ibmFpbF9zaXplPVNJWkVfTEFSR0VgXFxcXG4gICAgICAgICAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocmVxdWVzdCh1LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQXV0aG9yaXphdGlvblxcXFxcXFwiOiBcXFxcXFxcIkJlYXJlciBcXFxcXFxcIiArIGdldEl0ZW0oXFxcXFxcXCJhY2Nlc3NfdG9rZW5cXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pKVxcXFxuICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiByZXMubWVkaWFzKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG1wID0gaXRlbS5saW5rXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodG1wLnVybCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0bXAudXJsICsgZXh0XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9LCBpdGVtLCBleHQpXFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgaW1nOiBpdGVtLmljb25fbGluayxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ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TAucHV0TXlWYXIoXFxcXFxcXCJwYXRoc3R5XFxcXFxcXCIsIHBhdGhzLnNsaWNlKDAsIGkgKyAxKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9LCBwYXRocywgaSlcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIGxldCBsaXN0ID0gZ2V0RmlsZXMocGF0aHNbcGF0aHMubGVuZ3RoIC0gMV0uaWQpXFxcXG4gICAgICAgIGxpc3QuZmlsZUxpc3RBTy5mb2xkZXJMaXN0LmZvckVhY2goaXRlbSA9PiB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYXZhdGFyXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgaW1nOiBcXFxcXFxcImh0dHBzOi8vZ2l0Y29kZS5uZXQvcXFfMzIzOTQzNTEvZHIvLS9yYXcvbWFzdGVyL2ltZy/mlofku7bnsbvlnosyL+aWh+S7tuWkuS5zdmdcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgocGF0aHMsIGlkLCBuYW1lKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHBhdGhzLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGlkLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFxcXFxcInBhdGhzdHlcXFxcXFxcIiwgcGF0aHMpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aHMsIGl0ZW0uaWQsIGl0ZW0ubmFtZSlcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIGxpc3QuZmlsZUxpc3RBTy5maWxlTGlzdC5mb3JFYWNoKGl0ZW0gPT4ge1xcXFxuICAgICAgICAgICAgdmFyIGltZyA9IGdldEljb24oaXRlbS5uYW1lKVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImF2YXRhclxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChpZCwgbmFtZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRIem1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9jb2RlXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb29raWUgPSByZWFkRmlsZShcXFxcXFxcIjE4OS50eHRcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBcXFxcXFxcImh0dHBzOi8vY2xvdWQuMTg5LmNuL2FwaS9wb3J0YWwvZ2V0RmlsZUluZm8uYWN0aW9uXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocmVxdWVzdChidWlsZFVybCh1LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImZpbGVJZFxcXFxcXFwiOiBpZFxcXFxuICAgICAgICAgICAgICAgICAgICB9KSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQ29va2llXFxcXFxcXCI6IGNvb2tpZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIkFjY2VwdFxcXFxcXFwiOiBcXFxcXFxcImFwcGxpY2F0aW9uL2pzb247Y2hhcnNldD1VVEYtOFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBQQ19VQVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KSlcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQubW92aWUuaW5jbHVkZXMoZ2V0SHptKG5hbWUpKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXFxcXFxcXCJodHRwczpcXFxcXFxcIiArIHJlcy5kb3dubG9hZFVybCArIFxcXFxcXFwiI2lzVmlkZW89dHJ1ZSNcXFxcXFxcIl0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIkNvb2tpZVxcXFxcXFwiOiBjb29raWUucmVwbGFjZSgvOy9nLCBcXFxcXFxcIu+8m++8m1xcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IFBDX1VBLnJlcGxhY2UoLzsvZywgXFxcXFxcXCLvvJvvvJtcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQuYXVkaW8uaW5jbHVkZXMoZ2V0SHptKG5hbWUpKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXFxcXFxcXCJodHRwczpcXFxcXFxcIiArIHJlcy5kb3dubG9hZFVybCArIFxcXFxcXFwiI2lzVmlkZW89dHJ1ZSNcXFxcXFxcIl0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIkNvb2tpZVxcXFxcXFwiOiBjb29raWUucmVwbGFjZSgvOy9nLCBcXFxcXFxcIu+8m++8m1xcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IFBDX1VBLnJlcGxhY2UoLzsvZywgXFxcXFxcXCLvvJvvvJtcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQuaW1nLmluY2x1ZGVzKGdldEh6bShuYW1lKSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImh0dHBzOlxcXFxcXFwiICsgcmVzLmRvd25sb2FkVXJsICsgYCMuanBnQFVzZXItQWdlbnQ9JHtQQ19VQX1AQ29va2llPSR7Y29va2llfWBcXFxcbiAgICAgICAgICAgICAgICAg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XJsLmluY2x1ZGVzKFxcXFxcXFwiaHR0cHM6Ly9jbG91ZC4xODkuY24vd2ViL21haW5cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgY29va2llID0gZmJhLmdldENvb2tpZSh1cmwpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChjb29raWUgIT0gbnVsbCAmJiBjb29raWUubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXFxcXFwiaHR0cHM6Ly9jbG91ZC4xODkuY24vd2ViL21haW5cXFxcXFxcIiwgY29va2llKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgYWxlcnQoXFxcXFxcXCLlt7Lojrflj5bliLBjb29raWVcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5iYWNrKCk7ICAgICAgICAgICAgICAgICAgXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KSxcXFxcbiAgICAgICAgdWE6IFBDX1VBLFxcXFxuICAgICAgICBjYW5CYWNrOiB0cnVlXFxcXG4gICAgfVxcXFxufSlcXFxcbnNldFJlc3VsdChkKTtcXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLlpLjlhYvnvZHnm5hcXFwiLFxcXCJwYXRoXFxcIjpcXFwi5aS45YWL572R55uYXFxcIixcXFwicnVsZVxcXCI6XFxcImpzOlxcXFxudmFyIGQgPSBbXTtcXFxcbnRyeSB7XFxcXG4gICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcInF1YXJrLnR4dFxcXFxcXFwiKSkge1xcXFxuICAgICAgICBjb25zdCB7XFxcXG4gICAgICAgICAgICBnZXRJY29uLFxcXFxuICAgICAgICAgICAgZ2V0SHptLFxcXFxuICAgICAgICAgICAgZ2V0TGlua1xcXFxuICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXF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+IHtcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChwYXRocywgaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcXFxcXCJwYXRoc1xcXFxcXFwiLCBwYXRocy5zbGljZSgwLCBpICsgMSkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgcGF0aHMsIGkpXFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocmVxdWVzdChidWlsZFVybChcXFxcXFxcImh0dHBzOi8vZHJpdmUucXVhcmsuY24vMS9jbG91ZGRyaXZlL2ZpbGUvc29ydFxcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICBcXFxcXFxcInBkaXJfZmlkXFxcXFxcXCI6IHBhdGhzW3BhdGhzLmxlbmd0aCAtIDFdLmlkLFxcXFxuICAgICAgICAgICAgXFxcXFxcXCJmclxcXFxcXFwiOiBcXFxcXFxcInBjXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBcXFxcXFxcInByXFxcXFxcXCI6IFxcXFxcXFwidWNwcm9cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIFxcXFxcXFwiX3NpemVcXFxcXFxcIjogMTAsXFxcXG4gICAgICAgICAgICBcXFxcXFxcIl9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FxcInBhdGhzXFxcXFxcXCIsIHBhdGhzKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0sIHBhdGhzKVxcXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLm1vdmllLmluY2x1ZGVzKGdldEh6bShpdGVtLmZpbGVfbmFtZSkpKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IGdldExpbmsoaXRlbSwgY29va2llLCBcXFxcXFxcIm1vdmllXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQuYXVkaW8uaW5jbHVkZXMoZ2V0SHptKGl0ZW0uZmlsZV9uYW1lKSkpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gZ2V0TGluayhpdGVtLCBjb29raWUsIFxcXFxcXFwiYXVkaW9cXFxcXFxcIilcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5pbWcuaW5jbHVkZXMoZ2V0SHptKGl0ZW0uZmlsZV9uYW1lKSkpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gZ2V0TGluayhpdGVtLCBjb29raWUsIFxcXFxcXFwiaW1nXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBnZXRMaW5rKGl0ZW0sIGNvb2tpZSlcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0uZmlsZV9uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGltZzogZ2V0SWNvbihpdGVtKSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAg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BfMmYzNTllNWE0OWU2OWQ4YWVhMDc0MjEyMTk4YjkzODNfY29uLnBuZyIsInRpdGxlIjoi5aSp57+85LqR55uYIn0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement