Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥华语电影, 维多利亚一号@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuinhOWImeWIl+ihqFwiLFwicGF0aFwiOlwiZGF0YVwiLFwicnVsZVwiOlwidmFyIHdyYXB1ID0gKHUpID0+IHtcXG4gICAgaWYgKGNvbmZpZy5tb2RlID09IFxcXCLmnKzlnLDovaznoIFcXFwiKSB7XFxuICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZSdcXG4gICAgfVxcbiAgICBpZiAoL2FsaXl1bmRyaXZlLy50ZXN0KHUpKSB7XFxuICAgICAgICBjb25zdCBbbGluaywgX3NoYXJlX3B3ZF0gPSB1LnNwbGl0KCc/c2hhcmVfcHdkPScpO1xcbiAgICAgICAgY29uc3QgW19saW5rLCBfZm9sZGVySURdID0gbGluay5zcGxpdCgnL2ZvbGRlci8nKTtcXG4gICAgICAgIGxldCBzaGFyZV9wd2QgPSAoX3NoYXJlX3B3ZCB8fCAnJykuc3BsaXQoJyNuYW1lPScpWzBdIHx8ICcnO1xcbiAgICAgICAgbGV0IHNoYXJlSWQgPSBfbGluay5zcGxpdCgnY29tL3MvJylbMV07XFxuICAgICAgICByZXR1cm4gJ3NtYXJ0ZHJpdmU6Ly9zaGFyZS9icm93c2U/c2hhcmVJZD0nICsgc2hhcmVJZCArICcmc2hhcmVQd2Q9JyArIHNoYXJlX3B3ZDtcXG4gICAgfVxcbiAgICByZXR1cm4gXFxcIndlYjovL1xcXCIgKyB1O1xcbn07XFxuXFxudmFyIGNoZWNrYWxpID0gKHJlYWx1cmwpID0+IHtcXG4gICAgdHJ5IHtcXG4gICAgICAgIGxldCBzaGFyZUlkID0gcmVhbHVybC5zcGxpdChcXFwiY29tL3MvXFxcIilbMV0uc3Vic3RyaW5nKDAsIDExKTtcXG4gICAgICAgIGlmIChyZWFsdXJsLmluY2x1ZGVzKFxcXCJjb20vcy9cXFwiKSAmJiByZWFsdXJsICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgbGV0IHNoYXJlID0gZmV0Y2goXFxcImh0dHBzOi8vYXBpLmFsaXl1bmRyaXZlLmNvbS9hZHJpdmUvdjMvc2hhcmVfbGluay9nZXRfc2hhcmVfYnlfYW5vbnltb3VzXFxcIiwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBQQ19VQSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9cXFwiXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJzaGFyZV9pZFxcXCI6IHNoYXJlSWRcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpZiAoc2hhcmUuaW5jbHVkZXMoXFxcInNoYXJlX2xpbmsgaXNcXFwiKSB8fCBzaGFyZS5pbmNsdWRlcyhcXFwic2hhcmVfbGluayBjYW5ub3RcXFwiKSkgcmV0dXJuIGZhbHNlO1xcbiAgICAgICAgfVxcbiAgICB9IGNhdGNoIChlKSB7fVxcbiAgICByZXR1cm4gdHJ1ZTtcXG59XFxuXFxubGV0IHJ1bGVzID0gW3tcXG4gICAgICAgIG5hbWU6IFxcXCLkupHnm5jotYTmupBcXFwiLFxcbiAgICAgICAgcGFnZTogdHJ1ZSxcXG4gICAgICAgIGZpbmQ6IGZ1bmN0aW9uKHMsIHBhZ2UpIHtcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcImh0dHBzOi8vcmVzLnl1bnBhbi53aW4vP1BhZ2VJbmRleD1cXFwiICsgcGFnZSArIFxcXCImUGFnZVNpemU9MTImS2V5d29yZD1cXFwiICsgcyArIFxcXCImVHlwZT0mVGFnPVxcXCI7XFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3Jlcy55dW5wYW4ud2luL1xcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgIGxldCBhcnIgPSBwZGZhKGh0bWwsIFxcXCJtYWluJiYuY2FyZFxcXCIpO1xcbiAgICAgICAgICAgIC8vbG9nKGFycik7XFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgXFxcIi5jYXJkLWxpbmssMSYmb25jbGlja1xcXCIpLm1hdGNoKC9odHRwczpcXFxcL1xcXFwvKHd3d1xcXFwuYWxpeXVuZHJpdmVcXFxcLmNvbVxcXFwvc3xhbHl3cFxcXFwubmV0KVxcXFwvXFxcXHcqL2cpIHx8IFtdO1xcbiAgICAgICAgICAgICAgICB1ID0gdS5sZW5ndGggPiAwID8gdVswXSA6IHVybDtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0LCBcXFwiLmNhcmQtdGl0bGUmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IHBkKGl0LCBcXFwiaW1nJiZzcmNcXFwiLCB1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdSArICc/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHdyYXB1KHUpLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuS6keebmOi1hOa6kDwvZm9udD4mbmJzcDtcXFwiICsgKHBkZmgoaXQsIFxcXCIuY2FyZC10ZXh0LC0xJiZUZXh0XFxcIikpICsgXFxcIlxcXFxuXFxcIiArICh1KSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiBcXFwiVVDkupHmkJxcXFwiLFxcbiAgICAgICAgcGFnZTogdHJ1ZSxcXG4gICAgICAgIGZpbmQ6IGZ1bmN0aW9uKHMsIHBhZ2UpIHtcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcImh0dHBzOi8vYXBpLnVweXVuc28yLmNvbS9zZWFyY2g/a2V5d29yZD1cXFwiICsgcyArIFxcXCImcGFnZT1cXFwiICsgcGFnZSArIFxcXCImc190eXBlPTFcXFwiO1xcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdCh1cmwsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6Ly93d3cudXB5dW5zby5jb21cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IFxcXCJjb2RlPTE5MTlcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAvL2xvZyhiYXNlNjREZWNvZGUoaHRtbCkpO1xcbiAgICAgICAgICAgIGxldCBhcnIgPSBKU09OLnBhcnNlKGJhc2U2NERlY29kZShodG1sKSkucmVzdWx0Lml0ZW1zO1xcbiAgICAgICAgICAgIC8vbG9nKGFycik7XFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICAgICAgICAgIGxldCB1ID0gaXQucGFnZV91cmw7XFxuICAgICAgICAgICAgICAgIC8vdSA9IHUubGVuZ3RoID4gMCA/IHVbMF0gOiB1cmw7XFxuICAgICAgICAgICAgICAgIGlmICghdS5pbmNsdWRlcyhcXFwiYWxpeXVuZHJpdmVcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudCh1KSArICc/Pz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdSh1KSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT5VUOS6keaQnDwvZm9udD4mbmJzcDtcXFwiICsgXFxcIlxcXFxuXFxcIiArICh1KSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiBcXFwi54yr54u455uY5pCcXFxcIixcXG4gICAgICAgIHBhZ2U6IGZhbHNlLFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChcXFwiaHR0cHM6Ly93d3cuYWxpcGFuc291LmNvbS9zZWFyY2g/az1cXFwiICsgcywge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3d3dy5hbGlwYW5zb3UuY29tL3NlYXJjaD9rPVxcXCIgKyBzXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsZXQgYXJyID0gcGRmYShodG1sLCBcXFwiI2FwcCYmYVxcXCIpO1xcbiAgICAgICAgICAgIC8vbG9nKGFycik7XFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBcXFwiPGRpdj5cXFwiICsgYXJyW2ldICsgXFxcIjwvZGl2PlxcXCI7XFxuICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgXFxcImEmJmhyZWZcXFwiKTtcXG4gICAgICAgICAgICAgICAgLy9sb2codSk7XFxuICAgICAgICAgICAgICAgIGlmICghdS5pbmNsdWRlcyhcXFwiL3MvXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly93d3cuYWxpcGFuc291LmNvbVxcXCIgKyB1LnJlcGxhY2UoXFxcIi9zL1xcXCIsIFxcXCIvY3YvXFxcIik7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdCwgXFxcInRlbXBsYXRlJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQodSkubGF6eVJ1bGUoKHdyYXB1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiBcXFwibm9fc2hvd19kb25hdGU9MVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IGlucHV0LnJlcGxhY2UoXFxcIi9jdi9cXFwiLCBcXFwiL3MvXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaHRtbCA9IHBhcnNlRG9tRm9ySHRtbChodG1sLCAnYSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIF9saW5rcyA9IGh0bWwubWF0Y2goL2h0dHBzOlxcXFwvXFxcXC8od3d3XFxcXC5hbGl5dW5kcml2ZVxcXFwuY29tXFxcXC9zfGFseXdwXFxcXC5uZXQpXFxcXC9cXFxcdyovZykgfHwgW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coX2xpbmtzKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaHRtbC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgX2xpbmtzWzBdICsgJz8/ZnlwYWdlJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KGh0bWwpICsgJz8/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3cmFwdShodG1sKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgd3JhcHUpLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPueMq+eLuOebmOaQnDwvZm9udD4mbmJzcDtcXFwiICsgcGRmaChpdCwgXFxcInRlbXBsYXRlLDEmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiBcXFwi5piT5pCcXFxcIixcXG4gICAgICAgIHBhZ2U6IHRydWUsXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxuICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTtcXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBrZXllbihzdHIpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGtleSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKFxcXCI0T1RvU2NVRk9hZVZUckhFXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICBpdiA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKFxcXCI5Q0xHYW8xdkhLcW0xN096XFxcIik7XFxuICAgICAgICAgICAgICAgIHZhciBlbmNyeXB0ZWQgPSBDcnlwdG9KUy5BRVMuZGVjcnlwdCh7XFxuICAgICAgICAgICAgICAgICAgICBjaXBoZXJ0ZXh0OiBDcnlwdG9KUy5lbmMuQmFzZTY0LnBhcnNlKHN0cilcXG4gICAgICAgICAgICAgICAgfSwga2V5LCB7XFxuICAgICAgICAgICAgICAgICAgICBpdjogaXYsXFxuICAgICAgICAgICAgICAgICAgICBtb2RlOiBDcnlwdG9KUy5tb2RlLkNCQyxcXG4gICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6IENyeXB0b0pTLnBhZC5Qa2NzN1xcbiAgICAgICAgICAgICAgICB9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBlbmNyeXB0ZWQ7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChcXFwiaHR0cHM6Ly95aXNvLmZ1bi9hcGkvc2VhcmNoP25hbWU9XFxcIiArIHMgKyBcXFwiJnBhZ2VObz1cXFwiICsgcGFnZSwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3lpc28uZnVuL2luZm8/c2VhcmNoS2V5PVxcXCIgKyBzLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IGdldEl0ZW0oJ3lpc291Y29va2UnLCAnJylcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIC8vbG9nKGh0bWwpO1xcbiAgICAgICAgICAgIGlmIChodG1sLmluY2x1ZGVzKCfnmbvlvZXnlKjmiLfml6DpmZDliLYnKSkge1xcbiAgICAgICAgICAgICAgICB2YXIgaSA9IDA7XFxuICAgICAgICAgICAgICAgIGRvIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0eWltZ2xpbiA9ICdodHRwczovL3lpc28uZnVuL2FwaS91c2VyL2xvZ2luL2NhcHRjaGE/dD0nICsgcGFyc2VJbnQobmV3IERhdGUoKS5nZXRUaW1lKCkpICsgJyc7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaW1nID0gY29udmVydEJhc2U2NEltYWdlKHR5aW1nbGluKS5zcGxpdCgnLCcpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvZCA9IHJlcXVlc3QoJ2h0dHBzOi8vYXBpLm5uLmNpL29jci9iNjQvdGV4dCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAndGV4dC9wbGFpbidcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdmVyID0gSlNPTi5wYXJzZShyZXF1ZXN0KCdodHRwczovL3lpc28uZnVuL2FwaS91c2VyL2xvZ2luJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZmVyZXInOiAnaHR0cHM6Ly95aXNvLmZ1bi9sb2dpbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdDb29raWUnOiBnZXRDb29raWUodHlpbWdsaW4pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VyTmFtZVxcXCI6IFxcXCJ0dmJveDIwMjNcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBcXFwiVHZib3gyMDIzXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNvZGVcXFwiOiBjb2RcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodmVyLmNvZGUgPT0gMjAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfmmJPmkJznmbvlhaXpqozor4HmiJDlip8nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCd5aXNvdWNvb2tlJywgZ2V0Q29va2llKCdodHRwczovL3lpc28uZnVuJykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGh0bWwgPSByZXF1ZXN0KFxcXCJodHRwczovL3lpc28uZnVuL2FwaS9zZWFyY2g/bmFtZT1cXFwiICsgcyArIFxcXCImcGFnZU5vPVxcXCIgKyBwYWdlLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8veWlzby5mdW4vaW5mbz9zZWFyY2hLZXk9XFxcIiArIHMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogZ2V0SXRlbSgneWlzb3Vjb29rZScsICcnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpKys7XFxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKGkgPCA0KTtcXG5cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGFyciA9IEpTT04ucGFyc2UoaHRtbCkuZGF0YS5saXN0O1xcbiAgICAgICAgICAgIC8vbG9nKGFycik7XFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICAgICAgICAgIGxldCB1ID0ga2V5ZW4oaXQudXJsKTtcXG4gICAgICAgICAgICAgICAgLy9sb2codSk7XFxuICAgICAgICAgICAgICAgIGlmICh1ID09IG51bGwgfHwgIXUuaW5jbHVkZXMoXFxcImFsaXl1blxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgaXQubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudCh1KSArICc/Pz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdSh1KSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7mmJPmkJw8L2ZvbnQ+Jm5ic3A7XFxcIiArIChpdC5nbXRTaGFyZSB8fCBpdC5nbXRDcmVhdGUpICsgXFxcIlxcXFxuXFxcIiArICh1KSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiBcXFwi5om+6LWE5rqQXFxcIixcXG4gICAgICAgIHBhZ2U6IHRydWUsXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0aHRtbCgpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KFxcXCJodHRwczovL3poYW96aXl1YW4ubGEvc28/ZmlsZW5hbWU9XFxcIiArIHMgKyBcXFwiJnBhZ2U9XFxcIiArIHBhZ2UsIHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3poYW96aXl1YW4ubGEvc3RvcC5odG1sXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwib3JpZ2luXFxcIjogXFxcImh0dHBzOi8vemhhb3ppeXVhbi5sYVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IGdldEl0ZW0oXFxcInp6eWNvb2tlXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1cGdyYWRlLWluc2VjdXJlLXJlcXVlc3RzXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjb250ZW50LXR5cGVcXFwiOiBcXFwiYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGh0bWw7XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB2YXIgaHRtbCA9IGdldGh0bWwoKTtcXG4gICAgICAgICAgICBpZiAoIWh0bWwuaW5jbHVkZXMoXFxcInNlYXJjaF9ib3hcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBsZXQgdXNlciA9ICdkWE5sY201aGJXVTllWEJxTWpBeU15WndZWE56ZDI5eVpEMTVjR295TURJeic7XFxuICAgICAgICAgICAgICAgIGxldCBjb29rID0gSlNPTi5wYXJzZShmZXRjaENvb2tpZSgnaHR0cHM6Ly96aGFveml5dWFuLmxhL2xvZ2l1Lmh0bWwnLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBNT0JJTEVfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmlnaW4nOiAnaHR0cHM6Ly96aGFveml5dWFuLmxhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3poYW96aXl1YW4ubGEvbG9naW4uaHRtbCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVwZ3JhZGUtaW5zZWN1cmUtcmVxdWVzdHNcXFwiOiBcXFwiMVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBiYXNlNjREZWNvZGUodXNlciksXFxuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJyxcXG4gICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgfSkpLmpvaW4oJzsnKTtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbShcXFwienp5Y29va2VcXFwiLCBjb29rKTtcXG4gICAgICAgICAgICAgICAgbG9nKFxcXCLmib7otYTmupDnmbvlhaVcXFwiKTtcXG4gICAgICAgICAgICAgICAgaHRtbCA9IGdldGh0bWwoKTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgbGV0IGFyciA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJi5uZXdzTGlzdCYmbGk6bm90KDpmaXJzdC1jaGlsZClcXFwiKTtcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcbiAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsIFxcXCJhJiZocmVmXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmICh1ID09IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly96aGFveml5dWFuLmxhL1xcXCIgKyB1O1xcbiAgICAgICAgICAgICAgICAvL2xvZyh1KTtcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdCwgXFxcIi5uZXdzX3RleHQmJmgzJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5om+6LWE5rqQPC9mb250PiZuYnNwO1xcXCIgKyAocGRmaChpdCwgXFxcIi5uZXdzX3RleHQmJnAmJlRleHRcXFwiKSksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQodSkubGF6eVJ1bGUoKHdyYXB1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgX2xpbmtzID0gaHRtbC5tYXRjaCgvaHR0cHM6XFxcXC9cXFxcLyh3d3dcXFxcLmFsaXl1bmRyaXZlXFxcXC5jb21cXFxcL3N8YWx5d3BcXFxcLm5ldClcXFxcL1xcXFx3Ki9nKSB8fCBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhfbGlua3MpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfbGlua3MubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIF9saW5rc1swXSArICc/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudChfbGlua3NbMF0pICsgJz8/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3cmFwdShfbGlua3NbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCB3cmFwdSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9LCB7XFxuICAgICAgICBuYW1lOiBcXFwi5bCP57q45p2hXFxcIixcXG4gICAgICAgIHBhZ2U6IGZhbHNlLFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgIGZ1bmN0aW9uIGdldHRva2VuKCkge1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ3h6eXRva2VuJywgJycpLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdG9rZW4gPSBKU09OLnBhcnNlKHBvc3QoJ2h0dHBzOi8vZ2l0Y2FmZS5uZXQvdG9vbC9hbGlwYXBlci8nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3UuZ2l0Y2FmZS5uZXQvJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb246ICdnZXRfdG9rZW4nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigneHp0dG9rZW4nLCB0b2tlbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIGdldE15VmFyKCd4enR0b2tlbicsICcnKTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gY2F0X2NvZGUoYSkge1xcbiAgICAgICAgICAgICAgICB2YXIgZCwgZSwgYiA9IFtcXFwi5Y2O6K+t55S16KeGXFxcIiwgXFxcIuaXpemfqeeUteinhlxcXCIsIFxcXCLmrKfnvo7nlLXop4ZcXFwiLCBcXFwi5YW25LuW55S16KeGXFxcIiwgXFxcIuWNjuivreeUteW9sVxcXCIsIFxcXCLml6Xpn6nnlLXlvbFcXFwiLCBcXFwi5qyn576O55S15b2xXFxcIiwgXFxcIuWFtuS7lueUteW9sVxcXCIsIFxcXCLljY7or63liqjmvKtcXFwiLCBcXFwi5pel6Z+p5Yqo5ryrXFxcIiwgXFxcIuasp+e+juWKqOa8q1xcXCIsIFxcXCLnuqrlvZXniYdcXFwiLCBcXFwi57u86Im654mHXFxcIiwgXFxcIuaVmeiCsuWfueiurVxcXCIsIFxcXCLlhbbku5bop4bpopFcXFwiLCBcXFwi5Y2O6K+t6Z+z5LmQXFxcIiwgXFxcIuaXpemfqemfs+S5kFxcXCIsIFxcXCLmrKfnvo7pn7PkuZBcXFwiLCBcXFwi5YW25LuW6Z+z5LmQXFxcIiwgXFxcIuWoseS5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Lmxlbmd0aDsgZSA+IGQ7IGQrKylcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjW2RdID09IGEpIHJldHVybiBiW2RdO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgIGxldCBodG1sID0gcG9zdChcXFwiaHR0cHM6Ly9naXRjYWZlLm5ldC90b29sL2FsaXBhcGVyL1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly91LmdpdGNhZmUubmV0LydcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgYWN0aW9uOiBcXFwic2VhcmNoXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGZyb206IFxcXCJ3ZWJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdG9rZW46IGdldHRva2VuKCksXFxuICAgICAgICAgICAgICAgICAgICBrZXl3b3JkOiBzXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGxldCBsaXN0ID0gSlNPTi5wYXJzZShodG1sKTtcXG4gICAgICAgICAgICBpZiAobGlzdC5kYXRhKSB7XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0LmRhdGE7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGlzdC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBsaXN0W2ldXFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IGl0LnRpdGxlO1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IGl0LmFsaWtleTtcXG4gICAgICAgICAgICAgICAgaWYgKHUgPT0gbnVsbCkge1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IG11cmwgPSAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL3MvJyArIHU7XFxuXFxuICAgICAgICAgICAgICAgIGlmICghY2hlY2thbGkobXVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICh0aXRsZS5pbmNsdWRlcyhzKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKImiBcXFwiICsgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuWwj+e6uOadoTwvZm9udD4mbmJzcDtcXFwiICsgY2F0X2NvZGUoaXQuY2F0KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXM6IGl0LmRlc1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD1odHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vcy8nICsgbXVybCArICc/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdShtdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQoJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycgKyBtdXJsKSArICc/Pz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIGQ7XFxuICAgICAgICB9XFxuICAgIH0sIHtcXG4gICAgICAgIG5hbWU6IFxcXCLnjqnlgbblk6Xlk6VcXFwiLFxcbiAgICAgICAgcGFnZTogdHJ1ZSxcXG4gICAgICAgIGZpbmQ6IGZ1bmN0aW9uKHMsIHBhZ2UpIHtcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcImh0dHA6Ly93b2dnLnh5ei9pbmRleC5waHAvdm9kc2VhcmNoL1xcXCIgKyBzICsgXFxcIi0tLS0tLS0tLS1cXFwiICsgcGFnZSArIFxcXCItLS0uaHRtbFxcXCI7XFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge30pO1xcbiAgICAgICAgICAgIGxldCBhcnIgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICcubW9kdWxlLWl0ZW1zJiYubW9kdWxlLXNlYXJjaC1pdGVtJyk7XFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgIGxldCBiZXQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICAgICAgICAgIGxldCB1dGl0bGUgPSBwYXJzZURvbUZvckh0bWwoaXQsICdoMyYmYSYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICBsZXQgdXNlcmlhbCA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJy52aWRlby1zZXJpYWwmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgbGV0IHVpbWFnZSA9IHBhcnNlRG9tKGl0LCAnLmxhenlsb2FkJiZkYXRhLXNyYycsICdodHRwOi8vd29nZy54eXovJyk7XFxuICAgICAgICAgICAgICAgIGxldCB1ID0gcGFyc2VEb20oaXQsICdoMyYmYSYmaHJlZicsICdodHRwOi8vd29nZy54eXovJyk7XFxuICAgICAgICAgICAgICAgIC8vbGV0IGRldCA9IHJlcXVlc3QodSwge30pO1xcbiAgICAgICAgICAgICAgICBiZXQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdXRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgaW1hZ2U6IHVpbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHVzZXJpYWxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChiZXQubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICBsZXQgYmV0aCA9IGJhdGNoRmV0Y2goYmV0KTtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiZXRoLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkoYmV0aFtpXSwgJy5tb2R1bGUtcGxheWVyLWxpc3QmJnAnKVxcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ3AmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXUuaW5jbHVkZXMoXFxcIi9zL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYmV0W2ldLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBiZXRbaV0uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUodSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7njqnlgbblk6Xlk6U8L2ZvbnQ+Jm5ic3A7XFxcIiArIChiZXRbaV0uZGVzYykgKyAnXFxcXG4nICsgdSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZDtcXG4gICAgICAgIH1cXG4gICAgfSwge1xcbiAgICAgICAgbmFtZTogXFxcIumYv+mHjOS6keebmOe9kVxcXCIsXFxuICAgICAgICBwYWdlOiB0cnVlLFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBcXFwiaHR0cHM6Ly93d3cuYWx5cHcuY24vc2VhcmNoLnBocD9xPVxcXCIgKyBzICsgXFxcIiZwYWdlPVxcXCIgKyBwYWdlO1xcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdCh1cmwsIHt9KTtcXG4gICAgICAgICAgICBsZXQgYXJyID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnLmxpc3QmJmxpJyk7XFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgIGxldCBiZXQgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICAgICAgICAgIGxldCB1dGl0bGUgPSBwYXJzZURvbUZvckh0bWwoaXQsICdhJiZ0aXRsZScpO1xcbiAgICAgICAgICAgICAgICBsZXQgdXNlcmlhbCA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJy5mYS1jbG9jay1vJiZUZXh0Jyk7XFxuICAgICAgICAgICAgICAgIGxldCB1aW1hZ2UgPSBwYXJzZURvbShpdCwgJ2ltZyYmc3JjJywgJ2h0dHBzOi8vd3d3LmFseXB3LmNuLycpO1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBhcnNlRG9tKGl0LCAnYSYmaHJlZicsICdodHRwczovL3d3dy5hbHlwdy5jbi8nKTtcXG4gICAgICAgICAgICAgICAgLy9sZXQgZGV0ID0gcmVxdWVzdCh1LCB7fSk7XFxuICAgICAgICAgICAgICAgIGlmICghdXRpdGxlLmluY2x1ZGVzKHMpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBiZXQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdXRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgaW1hZ2U6IHVpbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHVzZXJpYWxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vbG9nKGJldCk7XFxuICAgICAgICAgICAgaWYgKGJldC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgIGxldCBiZXRoID0gYmF0Y2hGZXRjaChiZXQpO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJldGgubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsaXN0ID0gcGFyc2VEb21Gb3JBcnJheShiZXRoW2ldLCAnYm9keSYmYVtocmVmXj1odHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vcy9dJylcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJmhyZWYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYmV0W2ldLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBiZXRbaV0uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUodSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7pmL/ph4zkupHnm5jnvZE8L2ZvbnQ+Jm5ic3A7XFxcIiArIChiZXRbaV0uZGVzYykgKyAnXFxcXG4nICsgdSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgLyrlpLHmlYgge1xcbiAgICAgICAgICAgIG5hbWU6IFxcXCLlnJ/mi6jpvKBcXFwiLFxcbiAgICAgICAgICAgIHBhZ2U6IGZhbHNlLFxcbiAgICAgICAgICAgIGZpbmQ6IGZ1bmN0aW9uKHMsIHBhZ2UpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaCgnaHR0cHM6Ly93d3cudGJzZHkuY29tL3NlYXJjaC5odG1sP2tleXdvcmQ9JyArIHMgKyAnJmNhdGVnb3J5PTk4MzkyMCZkYXRhX3R5cGU9OTg3OTEwJywge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUFcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgIGxldCBhcnIgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICcuc2VhcmNoX3Jlc3VsdF9uZXRkaXNrX2xpc3QmJmEnKTtcXG4gICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGl0KTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1ID0gcGFyc2VEb21Gb3JIdG1sKGl0LCAnYSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRpdCA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJy5uZXRkaXNrX2l0ZW1fZGV0YWlsX25hbWUmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICghdGl0LmluY2x1ZGVzKHMpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyh1KTtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyB1ICsgJz8/ZnlwYWdlJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdSh1KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5Zyf5ouo6byg5pCcPC9mb250PiZuYnNwO1xcXCIgKyBcXFwiXFxcXG5cXFwiICsgdSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sKi9cXG4gICAge1xcbiAgICAgICAgbmFtZTogXFxcIumYv+mHjOaQnFxcXCIsXFxuICAgICAgICBwYWdlOiB0cnVlLFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KCdodHRwczovL2FsaXNvLmNjL3MvJyArIHMgKyAnLScgKyBwYWdlICsgJy0wLmh0bWwnLCB7fSk7XFxuXFxuICAgICAgICAgICAgbGV0IGxpc3QgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICcuc2VhcmNoLXJlc3VsdCYmLnJlc291cmNlLWl0ZW0nKTtcXG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGxpc3QubGVuZ3RoOyBqKyspIHtcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBsaXN0W2pdO1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0ID0gcGFyc2VEb21Gb3JIdG1sKHUsICdoMyYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICBpZiAoIXRpdC5pbmNsdWRlcyhzKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXQsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQocGFyc2VEb20odSwgJ2gzJiZhJiZocmVmJywgJ2h0dHBzOi8vYWxpc28uY2MvJykpLmxhenlSdWxlKCh3cmFwdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZ2V0Q3J5cHRvSlMoKSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZGVjcnkoc3RyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBrZXkgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZShcXFwiOUVCMjBEREZENkFGQkQ2OFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5jcnlwdGVkID0gQ3J5cHRvSlMuQUVTLmRlY3J5cHQoc3RyLCBrZXksIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl2OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlOiBDcnlwdG9KUy5tb2RlLkNCQyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6IENyeXB0b0pTLnBhZC5Qa2NzN1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlbmNyeXB0ZWQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJ1dCA9IHBhcnNlRG9tKGh0bWwsICcuYnV0dG9uJiZocmVmJywgJ2h0dHBzOi8vYWxpc28uY2MvJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coYnV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ290ID0gcmVxdWVzdChidXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKGdvdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChwYXJzZURvbUZvckh0bWwoZ290LCAnaGVhZCYmc2NyaXB0LDEmJkh0bWwnKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdyYXB1KGRlY3J5KGJhc2U2NC5zcGxpdCgnIScpWzBdKSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICB9LCB3cmFwdSksXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+6Zi/6YeM5pCcPC9mb250PiZuYnNwO1xcXCIgKyBwYXJzZURvbUZvckh0bWwodSwgJy50aW1lJiZUZXh0JyksXFxuICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgLyrlpLHmlYh7XFxuICAgICAgICAgICBuYW1lOiBcXFwi5Zyf54uX5pCcXFxcIixcXG4gICAgICAgICAgIHBhZ2U6IGZhbHNlLFxcbiAgICAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdCgnaHR0cHM6Ly93d3cudHVnb3Vzb3UuY29tL3NlYXJjaCcsIHtcXG4gICAgICAgICAgICAgICAgICAgYm9keTogJ2tleXdvcmQ9JyArIHMsXFxuICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgbGV0IGFyciA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJy5sYXl1aS1jb250YWluZXIsMSYmLmxheXVpLXJvdzpoYXMoYSknKTtcXG4gICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXG4gICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwYXJzZURvbUZvckh0bWwoaXQsICdhJiZocmVmJyk7XFxuICAgICAgICAgICAgICAgICAgIGlmICghdS5pbmNsdWRlcyhcXFwiL3MvXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgIC8vbG9nKHUpO1xcbiAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBhcnNlRG9tRm9ySHRtbChpdCwgJ2EmJlRleHQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIHUgKyAnPz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudCh1KSArICc/Pz9meXBhZ2UnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdSh1KSxcXG4gICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7lnJ/ni5fmkJw8L2ZvbnQ+Jm5ic3A7XFxcIiArIHBhcnNlRG9tRm9ySHRtbChpdCwgJ3AsLTEmJlRleHQnKSArIFxcXCJcXFxcblxcXCIgKyB1LFxcbiAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgcmV0dXJuIGQ7XFxuICAgICAgICAgICB9XFxuICAgICAgIH0sICovXFxuICAgIHtcXG4gICAgICAgIG5hbWU6IFxcXCLkupHnm5jliIbkuqvnpL5cXFwiLFxcbiAgICAgICAgcGFnZTogZmFsc2UsXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxuICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTtcXG5cXG4gICAgICAgICAgICBmdW5jdGlvbiBkZWNyeShzdHIpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGtleSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKFxcXCI1RjZCMkFLMzNEQVNEMTIzXFxcIik7XFxuICAgICAgICAgICAgICAgIHZhciBlbmNyeXB0ZWQgPSBDcnlwdG9KUy5BRVMuZGVjcnlwdChzdHIsIGtleSwge1xcbiAgICAgICAgICAgICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5FQ0IsXFxuICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczdcXG4gICAgICAgICAgICAgICAgfSkudG9TdHJpbmcoQ3J5cHRvSlMuZW5jLlV0ZjgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZW5jcnlwdGVkO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QoJ2h0dHBzOi8vd3d3Lnl1bnBhbmZlbnhpYW5nLmNuL2FwaS9iYnMvYXBpL2dldGRhdGE/a2V5PScgKyBzICsgJyZ0eXBlPXZpZGVvJywge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3d3dy55dW5wYW5mZW54aWFuZy5jbi9cXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsZXQganNvbiA9IGRlY3J5KEpTT04ucGFyc2UoaHRtbCkuZGF0YSk7XFxuICAgICAgICAgICAgLy9sb2coanNvbik7XFxuICAgICAgICAgICAgbGV0IGFyciA9IEpTT04ucGFyc2UoanNvbik7IC8vWzBdLnJlc3VsdC5pdGVtcztcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcblxcbiAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgbGV0IGJldCA9IFtdO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGl0LnBpZDtcXG4gICAgICAgICAgICAgICAgYmV0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly93d3cueXVucGFuZmVueGlhbmcuY24vYXBpL2Jicy9hcGkvZ2V0YXJ0aWNsZT9pZD0nICsgdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6Ly93d3cueXVucGFuZmVueGlhbmcuY24vXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vbG9nKHUpO1xcbiAgICAgICAgICAgIGxldCBiZXRoID0gYmF0Y2hGZXRjaChiZXQpO1xcblxcbiAgICAgICAgICAgIC8vbG9nKGFydGljbGUpO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmV0aC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBsZXQganNvbiA9IEpTT04ucGFyc2UoYmV0aFtpXSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgLy9sb2coanNvbik7XFxuICAgICAgICAgICAgICAgIGxldCBsaXN0ID0ganNvbi5kb3dubG9hZC5zcGxpdCgnQCcpO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGxpc3QubGVuZ3RoOyBqKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1ID0gbGlzdFtqXTtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGpzb24udGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcj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4gICAgICAgICAgICBsZXQgYXJyID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnLmdyaWQmJi5zaGFkb3c6aGFzKGFbaHJlZl49aHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL3MvXSknKTtcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcbiAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBhcnNlRG9tRm9ySHRtbChpdCwgJ2FbaHJlZl49aHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL3MvXSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICAvL2xvZyh1KTtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwoaXQsICcuYnJlYWstYWxsJiZUZXh0Jykuc3BsaXQoJ2h0dHAnKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IHBhcnNlRG9tRm9ySHRtbChpdCwgJ2ltZyYmc3JjJyksXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyB1ICsgJz8/ZnlwYWdlJyxcXG4gICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQodSkgKyAnPz8/ZnlwYWdlJyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUodSksXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+55uY5pCcPC9mb250PiZuYnNwO1xcXCIgKyAocGFyc2VEb21Gb3JIdG1sKGl0LCAncCYmVGV4dCcpKSArIFxcXCJcXFxcblxcXCIgKyAodSksXFxuICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAge1xcbiAgICAgICAgbmFtZTogXFxcIkRPVljmkJxcXFwiLFxcbiAgICAgICAgcGFnZTogZmFsc2UsXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxuICAgICAgICAgICAgbGV0IHVybCA9IFxcXCJodHRwczovL2FwaS5kb3Z4LnRrL2FsaS9zZWFyY2g/d2Q9XFxcIiArIHM7XFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge30pO1xcbiAgICAgICAgICAgIC8vbG9nKGJhc2U2NERlY29kZShodG1sKSk7XFxuICAgICAgICAgICAgbGV0IGFyciA9IEpTT04ucGFyc2UoaHRtbCkubGlzdDtcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcbiAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IGl0LnZvZF9jb250ZW50O1xcbiAgICAgICAgICAgICAgICAvL3UgPSB1Lmxlbmd0aCA+IDAgPyB1WzBdIDogdXJsO1xcbiAgICAgICAgICAgICAgICBpZiAoIXUuaW5jbHVkZXMoXFxcImFsaXl1bmRyaXZlXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICghY2hlY2thbGkodSkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKImiBcXFwiICsgaXQudm9kX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC52b2RfcGljLFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdSArICc/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHdyYXB1KHUpLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPkRPVljmkJw8L2ZvbnQ+Jm5ic3A7XFxcIiArIFxcXCJcXFxcblxcXCIgKyAodSksXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAge1xcbiAgICAgICAgbmFtZTogXFxcIuW/heW6lFxcXCIsXFxuICAgICAgICBwYWdlOiB0cnVlLFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBcXFwiaHR0cHM6Ly9jbi5iaW5nLmNvbS9zZWFyY2g/cT1cXFwiICsgcyArIFxcXCIrYWxpeXVuZHJpdmUmcXM9ZHMmZm9ybT1RQlJFXFxcIjtcXG4gICAgICAgICAgICBpZiAocGFnZSAhPSAxKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IGdldE15VmFyKFxcXCJiaW5nXFxcIiwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL2NuLmJpbmcuY29tL1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAvL1xcXCJYLVJlcXVlc3RlZC1XaXRoXFxcIjogXFxcImNvbS5leGFtcGxlLmhpa2Vydmlld1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiQWNjZXB0XFxcIjogXFxcInRleHQvaHRtbCxhcHBsaWNhdGlvbi94aHRtbCt4bWwsYXBwbGljYXRpb24veG1sO3E9MC45LGltYWdlL2F2aWYsaW1hZ2Uvd2VicCxpbWFnZS9hcG5nLCovKjtxPTAuOCxhcHBsaWNhdGlvbi9zaWduZWQtZXhjaGFuZ2U7dj1iMztxPTAuOVxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxldCBhcnIgPSBwZGZhKGh0bWwsIFxcXCJib2R5JiZhXFxcIik7XFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBwZChpdCwgXFxcImEmJmhyZWZcXFwiLCB1cmwpO1xcbiAgICAgICAgICAgICAgICBsZXQgdCA9IHBkZmgoaXQsIFxcXCJhJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgIGlmIChpdC5pbmNsdWRlcyhcXFwiTmV4dCBwYWdlXFxcIikgfHwgaXQuaW5jbHVkZXMoXFxcIuS4i+S4gOmhtVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdTIgPSBwZChpdCwgXFxcImEmJmhyZWZcXFwiLCB1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coXFxcIm5leHQgcGFnZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2codTIpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImJpbmdcXFwiLCB1Mik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHUgPT0gbnVsbCB8fCB0ID09IG51bGwgfHwgIWl0LmluY2x1ZGVzKHMpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIWl0LmluY2x1ZGVzKFxcXCLnvZHnm5hcXFwiKSAmJiAhaXQuaW5jbHVkZXMoXFxcIuS6keebmFxcXCIpICYmXFxuICAgICAgICAgICAgICAgICAgICAhaXQuaW5jbHVkZXMoXFxcImFsaXl1bmRyaXZlXFxcIikgJiYgIWl0LmluY2x1ZGVzKFxcXCJ5dW5wYW5cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHUuc3RhcnRzV2l0aChcXFwiaHR0cHM6Ly9jbi5iaW5nLmNvbS9cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IGRvbSA9IGdldEhvbWUodSkucmVwbGFjZShcXFwiaHR0cDovL1xcXCIsIFxcXCJcXFwiKS5yZXBsYWNlKFxcXCJodHRwczovL1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IF9saW5rcyA9IHQubWF0Y2goL2h0dHBzOlxcXFwvXFxcXC8od3d3XFxcXC5hbGl5dW5kcml2ZVxcXFwuY29tXFxcXC9zfGFseXdwXFxcXC5uZXQpXFxcXC9cXFxcdyovZykgfHwgW107XFxuICAgICAgICAgICAgICAgIC8vbG9nKF9saW5rcyk7XFxuICAgICAgICAgICAgICAgIGxldCBjID0gbnVsbDtcXG4gICAgICAgICAgICAgICAgLy9sb2coX2xpbmtzKTtcXG4gICAgICAgICAgICAgICAgLy9pZiAoX2xpbmtzLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgLy9jID0gJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KF9saW5rc1swXSkgKyAnPz8/ZnlwYWdlJztcXG4gICAgICAgICAgICAgICAgLy9jPXdyYXB1KF9saW5rc1swXSlcXG4gICAgICAgICAgICAgICAgLy99XFxuICAgICAgICAgICAgICAgIGlmIChfbGlua3MubGVuZ3RoID4gMSAmJiBfbGlua3NbMV0ucmVwbGFjZShfbGlua3NbMF0sIFxcXCJcXFwiKS5yZXBsYWNlKC9bYS16QS1aMC05XSsvZywgXFxcIlxcXCIpID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBjID0gd3JhcHUoX2xpbmtzWzFdKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChfbGlua3MubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgYyA9IHdyYXB1KF9saW5rc1swXSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0LFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuW/heW6lDwvZm9udD4mbmJzcDtcXFwiICsgZG9tLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBjICE9IG51bGwgPyBjIDogJCh1KS5sYXp5UnVsZSgod3JhcHUsIG1vZGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBfbGlua3MgPSBodG1sLm1hdGNoKC9odHRwczpcXFxcL1xcXFwvKHd3d1xcXFwuYWxpeXVuZHJpdmVcXFxcLmNvbVxcXFwvc3xhbHl3cFxcXFwubmV0KVxcXFwvXFxcXHcqL2cpIHx8IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKF9saW5rcyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9pZiAoX2xpbmtzLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIF9saW5rc1swXSArICc/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KF9saW5rc1swXSkgKyAnPz8/ZnlwYWdlJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX2xpbmtzLmxlbmd0aCA+IDEgJiYgX2xpbmtzWzFdLnJlcGxhY2UoX2xpbmtzWzBdLCBcXFwiXFxcIikucmVwbGFjZSgvW2EtekEtWjAtOV0rL2csIFxcXCJcXFwiKSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gd3JhcHUoX2xpbmtzWzFdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKF9saW5rcy5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3cmFwdShfbGlua3NbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBydWxlID0gTVlfUlVMRS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UveXNmeD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZyPVxcXCIgKyBydWxlICsgXFxcIiZtb2RlPVxcXCIgKyBtb2RlICsgXFxcIiMjXFxcIiArIGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIHdyYXB1LCBjb25maWcubW9kZSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXTtcXG5cXG4vKlxcbmxldCBjY29mID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvY2NvZicpXFxucnVsZXMucHVzaChjY29mKVxcbiovXFxuLy/lubblj5Hop4TliJnmlbBcXG5sZXQgc2l6ZSA9IDEwO1xcblxcbiQuZXhwb3J0cyA9IGZ1bmN0aW9uKHBhZ2UsIHJ1bGUpIHtcXG4gICAgaWYgKCFwYWdlICYmICFydWxlKSB7XFxuICAgICAgICByZXR1cm4gcnVsZXMubWFwKGl0ID0+IGl0Lm5hbWUpO1xcbiAgICB9XFxuICAgIGlmIChydWxlICE9IG51bGwpIHtcXG4gICAgICAgIGlmIChwYWdlICE9IG51bGwgJiYgcGFnZSA+IDEpIHtcXG4gICAgICAgICAgICByZXR1cm4gcnVsZXMuZmlsdGVyKGkgPT4gaS5uYW1lID09IHJ1bGUgJiYgaS5wYWdlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBydWxlcy5maWx0ZXIoaSA9PiBpLm5hbWUgPT0gcnVsZSk7XFxuICAgIH1cXG4gICAgbGV0IHN0Y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k7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5a6Y5pa5QVBQXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn++8jOivt+ehruS/neaJi+acuuacieWuieijhemYv+mHjOS6keebmOWumOaWuUFQUFxcXCI7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5Yqf44CCXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzJfcm91bmRcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICBwaWNfdXJsOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbjFcXFwiXFxuICAgIH0pO1xcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfmkJzntKInLFxcbiAgICAgICAgZGVzYzogJ+ivt+i+k+WFpeWFs+mUruivjScsXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGlucHV0LnN0YXJ0c1dpdGgoJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQoaW5wdXQpICsgJz8/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3MnLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcigncycsICcnKVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgbGV0IHJ1bGVzID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZGF0YVxcXCIpKCk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIlxcXCIgPT0gciA/IFxcXCLigJzigJzlhajpg6jigJ3igJ1cXFwiIDogXFxcIuWFqOmDqFxcXCIsXFxuICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIGNsZWFySXRlbShcXFwiclxcXCIpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIlxcbiAgICB9KTtcXG4gICAgZm9yIChsZXQgaXQgb2YgcnVsZXMpIHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGl0ID09IHIgPyBcXFwi4oCc4oCcXFxcIiArIGl0ICsgXFxcIuKAneKAnVxcXCIgOiBpdCxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHIpID0+IHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbShcXFwiclxcXCIsIHIpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgfSwgaXQpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCJcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmUnLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogJ3lwai1sJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG59XFxubGV0IHMgPSBnZXRNeVZhcigncycsICcnKTtcXG5pZiAocyAhPSBcXFwiXFxcIikge1xcbiAgICBsZXQgcCA9IE1ZX1BBR0U7XFxuICAgIGxldCBkYXRhID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZGF0YVxcXCIpKHAsIHIgIT0gXFxcIlxcXCIgPyByIDogbnVsbCk7XFxuXFxuICAgIGxldCBwYWdlaWQgPSBcXFwieXBqLXBhZ2VcXFwiICsgcDtcXG4gICAgaWYgKGRhdGEubGVuZ3RoID4gMCkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuWKoOi9veesrFxcXCIgKyBwICsgXFxcIumhteS4re+8jOi/m+W6pu+8mjEvXFxcIiArIGRhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgIHVybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgc2V0UmVzdWx0KGQpO1xcbiAgICAvL2xvZyhkYXRhLmxlbmd0aCk7XFxuXFxuICAgIGlmIChkYXRhLmxlbmd0aCA+IDApIHtcXG4gICAgICAgIC8v5aSa57q/56iL5Yqg6L29ICAgICAgICBcXG4gICAgICAgIGxldCByZWFsUGFnZSA9IFxcXCJcXFwiID09IHIgPyAxIDogcDtcXG4gICAgICAgIGxldCB0YXNrcyA9IGRhdGEubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICBmdW5jOiBmdW5jdGlvbihydWxlKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcnVsZS5maW5kKHMsIHJlYWxQYWdlKTtcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgcGFyYW06IGl0LFxcbiAgICAgICAgICAgICAgICBpZDogXFxcInJ1bGVAXFxcIiArIGl0Lm5hbWVcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGJhdGNoRXhlY3V0ZSh0YXNrcywge1xcbiAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHBhcmFtLCBpZCwgZXJyb3IsIHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAvL2xvZyhcXFwibGlzdGVuZXI6IFxcXCIgKyAocmVzdWx0IHx8IFtdKS5sZW5ndGgpXFxuICAgICAgICAgICAgICAgIHBhcmFtLmkgPSBwYXJhbS5pICsgMTtcXG4gICAgICAgICAgICAgICAgaWYgKHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiByZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0uaiA9IHBhcmFtLmogKyAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0LnRpdGxlLmluY2x1ZGVzKFxcXCLigJzigJzigJ3igJ1cXFwiKSA/IGl0LnRpdGxlIDogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBpdC50aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAoXFxcIjxlbT58PC9lbT5cXFwiLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIikucmVwbGFjZShuZXcgUmVnRXhwKHMsIFxcXCJnXFxcIiksIFxcXCI8c3Ryb25nPjxzcGFuIHN0eWxlPVxcXFxcXFwiY29sb3I6ICMxRTkwRkZcXFxcXFxcIj5cXFwiICsgcyArIFxcXCI8L3NwYW4+PC9zdHJvbmc+XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBpdC5kZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpdC51cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC5waWNfdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGl0LnBpY191cmwgPyAnbW92aWVfMV92ZXJ0aWNhbF9waWMnIDogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwiX19hcHBcXFwiICsgTVlfUEFHRSArIFxcXCJAXFxcIiArIHBhcmFtLmosXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtLmkgPj0gcGFyYW0uYWxsKSB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yqg6L2956ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFwiL1xcXCIgKyBwYXJhbS5hbGwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICBhbGw6IGRhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgICAgICBpOiAwLFxcbiAgICAgICAgICAgICAgICBqOiAtMVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG59XCJ9LHtcImNvb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b3IgKGxldCBpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgaXQgPSBsaXN0W2ldXFxuICAgICAgICAgICAgbGV0IHRpdGxlID0gaXQuZmlsZU5hbWVcXG4gICAgICAgICAgICBsZXQgbXVybCA9IGl0LnVybFxcbiAgICAgICAgICAgIGxldCB0eXBlID0gaXQudHlwZS5yZXBsYWNlKC9mb2xkZXIvLCAn5paH5Lu25aS5JykucmVwbGFjZSgvZmlsZS8sICfmlofku7YnKVxcbiAgICAgICAgICAgIGlmICh0aXRsZS5pbmNsdWRlcyhzKSkge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPkNDT0Y8L2ZvbnQ+Jm5ic3A7JyArICfmlofku7bnsbvlnovvvJonICsgdHlwZSArICfvvIzmlofku7blpKflsI/vvJonICsgYnl0ZXNUb1NpemUoaXQuc2l6ZSksXFxuICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyBtdXJsICsgJz8/ZnlwYWdlJ1xcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudChtdXJsKSArICc/Pz9meXBhZ2UnXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHdyYXB1KG11cmwpXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGRcXG4gICAgfVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuW3peWF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ICAgICAgIGlmIChob3N0cy5sZW5ndGggPiAyKSB7XFxuICAgICAgICAgICAgaG9zdCA9IGhvc3RzW2hvc3RzLmxlbmd0aCAtIDJdICsgXFxcIi5cXFwiICsgaG9zdHNbaG9zdHMubGVuZ3RoIC0gMV07XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFwibWFnbmV0XFxcIikpIHtcXG4gICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmuKnppqjmj5DnpLpcXFwiLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBcXFwi5qOA5rWL5Yiw5paw55qE56OB6ZO+5Zyw5Z2A77yM54K55Ye756Gu5a6a5oyJ6ZKu5Y2z5Y+v5pKt5pS+77yM54K55Ye75Y+W5raI5oyJ6ZKu5Y+v5Lul5aSN5Yi26ZO+5o6lXFxcIixcXG4gICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygobWFnKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWFnO1xcbiAgICAgICAgICAgICAgICB9LCBpbnB1dCksXFxuICAgICAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygobWFnKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgbWFnXFxuICAgICAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluY2x1ZGVzKFxcXCJhbGl5dW5kcml2ZS5jb21cXFwiKSAmJiBtb2RlICE9IFxcXCLlrpjmlrlBUFBcXFwiKSB7XFxuICAgICAgICAgICAgLy9sb2coaW5wdXQpO1xcbiAgICAgICAgICAgIGlmIChpbnB1dC5pbmNsdWRlcygnY2hlY2t1cmw/dXJsPScpICYmIGlucHV0LmluY2x1ZGVzKCcmdXJscmVmZXInKSkge1xcbiAgICAgICAgICAgICAgICBpbnB1dCA9IGRlY29kZVVSSUNvbXBvbmVudChpbnB1dC5zcGxpdCgnJnVybHJlZmVyJylbMF0uc3BsaXQoJ2NoZWNrdXJsP3VybD0nKVsxXSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKCfotLTlkKcnK2lucHV0KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCwgcnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLpmL/ph4zkupHnm5hcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6IFxcXCJoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD1cXFwiICsgdXJsICsgJz8/ZnlwYWdlJyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9wdXNoP3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnVybD1oaWtlcjovL2VtcHR5IyNcXFwiICsgZW5jb2RlVVJJQ29tcG9uZW50KHVybCkgKyAnPz8/ZnlwYWdlJyxcXG4gICAgICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgfSwgaW5wdXQsIHJ1bGUpXFxuICAgICAgICB9IGVsc2UgaWYgKC9cXFxcLihtcDN8ZmxhY3xtNGEpJC8udGVzdChpbnB1dCkpIHtcXG4gICAgICAgICAgICAvL2xvZyhpbnB1dCk7XFxuICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCwgcnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLnBsYXlWaWRlbyh1cmwpO1xcbiAgICAgICAgICAgIH0sIGlucHV0LCBydWxlKVxcbiAgICAgICAgfSBlbHNlIGlmICghaW5wdXQuaW5jbHVkZXMoaG9zdCkgJiYgaW5wdXQuc3RhcnRzV2l0aChcXFwiaHR0cFxcXCIpKSB7XFxuICAgICAgICAgICAgLy9sb2coaW5wdXQpO1xcbiAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh1cmwsIHJ1bGUsIG1vZGUpID0+IHtcXG4gICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6K+m5oOFXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS95c2Z4P3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnI9XFxcIiArIHJ1bGUgKyBcXFwiJm1vZGU9XFxcIiArIG1vZGUgKyBcXFwiIyNcXFwiICsgdXJsLFxcbiAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICB9LCBpbnB1dCwgcnVsZSwgbW9kZSk7XFxuICAgICAgICB9IGVsc2UgaWYgKCFpbnB1dC5zdGFydHNXaXRoKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICAvL2xvZyhpbnB1dCk7XFxuICAgICAgICAgICAgLy/og73llKTotbdBUFDnmoTnmb3lkI3ljZVcXG4gICAgICAgICAgICBsZXQgd2hpdGUgPSBbXFxuICAgICAgICAgICAgICAgIFxcXCJxa2xpbmtcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiYmRuZXRkaXNrXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcInh1bmxlaWFwcFxcXCJcXG4gICAgICAgICAgICBdO1xcbiAgICAgICAgICAgIGxldCBpbldoaXRlID0gd2hpdGUuZmlsdGVyKGl0ID0+IGlucHV0LnN0YXJ0c1dpdGgoaXQpKS5sZW5ndGggPiAwO1xcbiAgICAgICAgICAgIGlmICghaW5XaGl0ZSkge1xcbiAgICAgICAgICAgICAgICByZX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XMgY2FuY2VsbGVkXFxcIikgfHwgZ2V0c2hhci5pbmNsdWRlcyhcXFwic2hhcmVfbGluayBpcyBleHBpcmVkXFxcIikpIHtcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfmnaXmmZrllabvvIzor6XliIbkuqvlt7LlpLHmlYjjgIInLFxcbiAgICAgICAgICAgICAgICB1cmw6IGRlY29kZVVSSUNvbXBvbmVudChnZXRSZXNDb2RlKCkuc3BsaXQoJyMjJylbMV0pLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoZ2V0c2hhci5pbmNsdWRlcyhcXFwic2hhcmVfbGluayBjYW5ub3QgYmUgZm91bmRcXFwiKSkge1xcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+S9oOaJk+W8gOeahOmTvuaOpeacieivr++8jOivt+mHjeivleOAgicsXFxuICAgICAgICAgICAgICAgIHVybDogZGVjb2RlVVJJQ29tcG9uZW50KGdldFJlc0NvZGUoKS5zcGxpdCgnIyMnKVsxXSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGxldCBwdXNobmFtZSA9IEpTT04ucGFyc2UoZ2V0c2hhcikuZmlsZV9pbmZvc1swXS5maWxlX25hbWU7XFxuXFxuICAgICAgICB2YXIgc2hhcmV0b2tlbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2h0dHBzOi8vYXBpLmFsaXl1bmRyaXZlLmNvbS92Mi9zaGFyZV9saW5rL2dldF9zaGFyZV90b2tlbicsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6ICd7XFxcInNoYXJlX3B3ZFxcXCI6XFxcIlxcXCIsXFxcInNoYXJlX2lkXFxcIjpcXFwiJyArIHNoYXJlSWQgKyAnXFxcIn0nLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KSkuc2hhcmVfdG9rZW47XFxuICAgICAgICAvL2xvZyhzaGFyZXRva2VuKTtcXG5cXG4gICAgICAgIGxldCBuZXh0ID0gZ2V0TXlWYXIoJ25leHRwYWdlJywgJycpICE9ICcnID8gJyxcXFwibWFya2VyXFxcIjpcXFwiJyArIGdldE15VmFyKCduZXh0cGFnZScpICsgJ1xcXCInIDogJyc7XFxuICAgICAgICBpZiAoIWRlY29kZVVSSUNvbXBvbmVudChyZWFsdXJsKS5pbmNsdWRlcygnL2ZvbGRlci8nKSkge1xcbiAgICAgICAgICAgIC8vaWYoIWxpc3R5cCA9PSAnZm9sZGVyJyl7XFxuICAgICAgICAgICAgdmFyIHJlc2NvZCA9IGZldGNoKCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vYWRyaXZlL3YzL2ZpbGUvbGlzdCcsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcXG4gICAgICAgICAgICAgICAgICAgICdYLVNoYXJlLVRva2VuJzogc2hhcmV0b2tlblxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiAne1xcXCJzaGFyZV9pZFxcXCI6XFxcIicgKyBzaGFyZUlkICsgJ1xcXCIsXFxcInBhcmVudF9maWxlX2lkXFxcIjpcXFwicm9vdFxcXCIsXFxcImxpbWl0XFxcIjoxMDAsXFxcImltYWdlX3RodW1ibmFpbF9wcm9jZXNzXFxcIjpcXFwiaW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XG4gICAgICAgIC8vbG9nKHJlc2NvZCk7XFxuXFxuXFxuICAgICAgICBpZiAoSlNPTi5wYXJzZShyZXNjb2QpLm5leHRfbWFya2VyKSB7XFxuICAgICAgICAgICAgbGV0IG1hcmtlciA9IEpTT04ucGFyc2UocmVzY29kKS5uZXh0X21hcmtlcjtcXG4gICAgICAgICAgICBpZiAobWFya2VyLmxlbmd0aCA+IDEwKSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCduZXh0cGFnZScsIG1hcmtlcik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignbmV4dHBhZ2UnKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgY29udHMgPSBKU09OLnBhcnNlKHJlc2NvZCkuaXRlbXM7XFxuICAgICAgICBpZiAoY29udHMubGVuZ3RoIDwgMSkge1xcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+ivpeaWh+S7tuWkueS4i+ayoeacieWIhuS6q+eahOaWh+S7ticsXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgZG9uZ3RhaSA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9sYXp5dXJsJywge30pKS5ydWxlLnRvU3RyaW5nKCk7XFxuXFxuICAgICAgICB2YXIgdHVpc29uZyA9IFtdO1xcbiAgICAgICAgdmFyIHppbXUgPSBbXTtcXG4gICAgICAgIGZvciAobGV0IGkgaW4gY29udHMpIHtcXG4gICAgICAgICAgICAvL3ZhciBsaXN0eXAgPSBjb250c1tpXS50eXBlO1xcbiAgICAgICAgICAgIGlmIChjb250c1tpXS50eXBlICE9ICdmb2xkZXInKSB7XFxuICAgICAgICAgICAgICAgIGxldCBmbmFtZSA9IGNvbnRzW2ldLm5hbWU7XFxuICAgICAgICAgICAgICAgIGxldCBmdHlwZSA9IGZuYW1lLnRvTG93ZXJDYXNlKCk7XFxuICAgICAgICAgICAgICAgIGxldCBjYXRlID0gY29udHNbaV0uY2F0ZWdvcnk7XFxuICAgICAgICAgICAgICAgIGlmIChmdHlwZS5lbmRzV2l0aCgnLnNydCcpIHx8IGZ0eXBlLmVuZHNXaXRoKCcudnR0JykgfHwgZnR5cGUuZW5kc1dpdGgoJy5hc3MnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgemltdS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXQ6IGZuYW1lLnN1YnN0cmluZygwLCBmbmFtZS5sYXN0SW5kZXhPZihcXFwiLlxcXCIpKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHQ6IGNvbnRzW2ldLmZpbGVfZXh0ZW5zaW9uLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpZDogY29udHNbaV0uZmlsZV9pZFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIGlmIChjYXRlID09ICd2aWRlbycgfHwgY2F0ZSA9PSAnYXVkaW8nKSB7XFxuICAgICAgICAgICAgICAgICAgICB0dWlzb25nLnB1c2goXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm5hbWUucmVwbGFjZSgvXFxcXCMvZywgJ18nKS5yZXBsYWNlKC9cXFxcJC9nLCAnXycpICsgJyQnICsgY2F0ZSArICd8JyArIGNvbnRzW2ldLmZpbGVfaWRcXG4gICAgICAgICAgICAgICAgICAgICk7XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcblxcbiAgICAgICAgZm9yICh2YXIgaSBpbiBjb250cykge1xcbiAgICAgICAgICAgIHZhciBsaXN0eXAgPSBjb250c1tpXS50eXBlO1xcbiAgICAgICAgICAgIGlmIChsaXN0eXAgIT0gJ2ZvbGRlcicpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGNhdGUgPSBjb250c1tpXS5jYXRlZ29yeTtcXG4gICAgICAgICAgICAgICAgdmFyIGZuYW1lID0gY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICAgICAgaWYgKGNhdGUgPT0gJ3ZpZGVvJykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk7onICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdkb2MnKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TlicgKyBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ2ltYWdlJykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/CflrwnICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICd6aXAnKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TpicgKyBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gY29udHNbaV0ubmFtZVxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8vIGlmIChjYXRlID09ICd2aWRlbycgfHwgY2F0ZSA9PSAnYXVkaW8nIHx8IGNhdGUgPT0gJ2ltYWdlJykge1xcbiAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChjb250c1tpXS5maWxlX2lkKS5sYXp5UnVsZSgoc2hhcmVJZCwgZG9uZ3RhaSwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuLCB6aW11KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdldEl0ZW0oJ3NpbmdsZXB1c2gnLCAnJykgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/cnVsZT1YWVHmjqjpgIEmcHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogZm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVmcmVzaF90b2tlblxcXCI6IHJlZnRva2VuLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IGZuYW1lLnJlcGxhY2UoL1xcXFwjL2csICdfJykucmVwbGFjZSgvXFxcXCQvZywgJ18nKSArICckJyArIGNhdGUgKyAnfCcgKyBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzaGFyZV9pZFxcXCI6IHNoYXJlSWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZG9uZ3RhaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgc2hhcmVJZCwgZG9uZ3RhaSwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuLCB6aW11KSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGZvcm1hdERhdGUoY29udHNbaV0udXBkYXRlZF9hdCkgKyAnICAnICsgZm9ybWF0U2l6ZShjb250c1tpXS5zaXplKSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+aOqOmAgeWIsFRWQm94JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNoYXJlSWQsIGZpbGVpZCwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBmbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVmcmVzaF90b2tlblxcXCI6IHJlZnRva2VuLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBmbmFtZS5yZXBsYWNlKC9cXFxcIy9nLCAnXycpLnJlcGxhY2UoL1xcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgZmlsZWlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzaGFyZV9pZFxcXCI6IHNoYXJlSWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2hhcmVJZCwgY29udHNbaV0uZmlsZV9pZCwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBjb250c1tpXS5maWxlX2lkXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnXFxuXFxuICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAvKn0gZWxzZSBpZiAoaSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+W9k+WJjeaWh+S7tuWkueS4i+ayoeaciemfs+inhumikeaWh+S7ticsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0qL1xcblxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfwn5OCJyArIGNvbnRzW2ldLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHknICsgY29udHNbaV0uZmlsZV9pZCArICc/Pz9meXBhZ2UnKS5ydWxlKChzaGFyZUlkLCBzaGFyZXRva2VuLCBwdXNobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL3J1bGVsb29wJywge30pKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNoYXJlSWQsIHNoYXJldG9rZW4sIGNvbnRzW2ldLm5hbWUpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgfSAvL2VuZCBpZ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4gICAgdmFyIHppbXUgPSBbXTtcXG4gICAgZm9yIChsZXQgaSBpbiBjb250cykge1xcbiAgICAgICAgLy92YXIgbGlzdHlwID0gY29udHNbaV0udHlwZTtcXG4gICAgICAgIGlmIChjb250c1tpXS50eXBlICE9ICdmb2xkZXInKSB7XFxuICAgICAgICAgICAgbGV0IGZuYW1lID0gY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICBsZXQgZnR5cGUgPSBmbmFtZS50b0xvd2VyQ2FzZSgpO1xcbiAgICAgICAgICAgIGxldCBjYXRlID0gY29udHNbaV0uY2F0ZWdvcnk7XFxuICAgICAgICAgICAgaWYgKGZ0eXBlLmVuZHNXaXRoKCcuc3J0JykgfHwgZnR5cGUuZW5kc1dpdGgoJy52dHQnKSB8fCBmdHlwZS5lbmRzV2l0aCgnLmFzcycpKSB7XFxuICAgICAgICAgICAgICAgIHppbXUucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXQ6IGZuYW1lLnN1YnN0cmluZygwLCBmbmFtZS5sYXN0SW5kZXhPZihcXFwiLlxcXCIpKSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dDogY29udHNbaV0uZmlsZV9leHRlbnNpb24sXFxuICAgICAgICAgICAgICAgICAgICBmaWQ6IGNvbnRzW2ldLmZpbGVfaWRcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nIHx8IGNhdGUgPT0gJ2F1ZGlvJykge1xcbiAgICAgICAgICAgICAgICB0dWlzb25nLnB1c2goXFxuICAgICAgICAgICAgICAgICAgICBmbmFtZS5yZXBsYWNlKC9cXFxcIy9nLCAnXycpLnJlcGxhY2UoL1xcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgY29udHNbaV0uZmlsZV9pZFxcbiAgICAgICAgICAgICAgICApO1xcbiAgICAgICAgICAgIH07XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgXFxuICAgIGZvciAodmFyIGkgaW4gY29udHMpIHtcXG4gICAgICAgIHZhciBsaXN0eXAgPSBjb250c1tpXS50eXBlO1xcbiAgICAgICAgaWYgKGxpc3R5cCAhPSAnZm9sZGVyJykge1xcbiAgICAgICAgICAgIHZhciBjYXRlID0gY29udHNbaV0uY2F0ZWdvcnk7XFxuICAgICAgICAgICAgdmFyIGZuYW1lID0gY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nKSB7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5O6JyArIGNvbnRzW2ldLm5hbWU7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdkb2MnKSB7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5OWJyArIGNvbnRzW2ldLm5hbWU7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdpbWFnZScpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/CflrwnICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ3ppcCcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk6YnICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBjb250c1tpXS5uYW1lXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vaWYgKGNhdGUgPT0gJ3ZpZGVvJyB8fCBjYXRlID09ICdhdWRpbycgfHwgY2F0ZSA9PSAnaW1hZ2UnKSB7XFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKGNvbnRzW2ldLmZpbGVfaWQpLmxhenlSdWxlKChzaGFyZUlkLCBkb25ndGFpLCBjYXRlLCBmbmFtZSwgcmVmdG9rZW4semltdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdldEl0ZW0oJ3NpbmdsZXB1c2gnLCAnJykgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD9ydWxlPVhZUeaOqOmAgSZwdXNodXJsPScgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGZuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVmcmVzaF90b2tlblxcXCI6IHJlZnRva2VuLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXJsXFxcIjogZm5hbWUucmVwbGFjZSgvXFxcXCMvZywgJ18nKS5yZXBsYWNlKC9cXFxcJC9nLCAnXycpICsgJyQnICsgY2F0ZSArICd8JyArIGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwic2hhcmVfaWRcXFwiOiBzaGFyZUlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGRvbmd0YWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHNoYXJlSWQsIGRvbmd0YWksIGNhdGUsIGZuYW1lLCByZWZ0b2tlbix6aW11KSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZm9ybWF0RGF0ZShjb250c1tpXS51cGRhdGVkX2F0KSArICcgICcgKyBmb3JtYXRTaXplKGNvbnRzW2ldLnNpemUpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5o6o6YCB5YiwVFZCb3gnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaGFyZUlkLCBmaWxlaWQsIGNhdGUsIGZuYW1lLCByZWZ0b2tlbikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGZuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlZnJlc2hfdG9rZW5cXFwiOiByZWZ0b2tlbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBmbmFtZS5yZXBsYWNlKC9cXFxcIy9nLCAnXycpLnJlcGxhY2UoL1xcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgZmlsZWlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNoYXJlX2lkXFxcIjogc2hhcmVJZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2hhcmVJZCwgY29udHNbaV0uZmlsZV9pZCwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuKVxcbiAgICAgICAgICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgICAgICAgICBpZDogY29udHNbaV0uZmlsZV9pZFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMSdcXG5cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAvL31cXG4gIC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gICAgICAgICAgIGNvbnN0IGRkID0gbmV3IERhdGUoKS5nZXREYXRlKCkgPCAxMCA/ICcwJyArIG5ldyBEYXRlKCkuZ2V0RGF0ZSgpIDogbmV3IERhdGUoKS5nZXREYXRlKClcXG4gICAgICAgICAgICBjb25zdCBISCA9IG5ldyBEYXRlKCkuZ2V0SG91cnMoKSA8IDEwID8gJzAnICsgbmV3IERhdGUoKS5nZXRIb3VycygpIDogbmV3IERhdGUoKS5nZXRIb3VycygpXFxuICAgICAgICAgICAgY29uc3QgbW0gPSBuZXcgRGF0ZSgpLmdldE1pbnV0ZXMoKSA8IDEwID8gJzAnICsgbmV3IERhdGUoKS5nZXRNaW51dGVzKCkgOiBuZXcgRGF0ZSgpLmdldE1pbnV0ZXMoKVxcbiAgICAgICAgICAgIHJldHVybiB5eSArICcnICsgZGQgKyAnJyArIEhIICsgJycgKyBNTSArICcnICsgbW1cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGxldCBzaGFyZXRva2VuID0gSlNPTi5wYXJzZShyZXF1ZXN0KCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vdjIvc2hhcmVfbGluay9nZXRfc2hhcmVfdG9rZW4nLCB7XFxuICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICBcXFwic2hhcmVfcHdkXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJzaGFyZV9pZFxcXCI6IHNoYXJlX2lkXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJyxcXG4gICAgICAgICAgICB0aW1lb3V0OiAzMDAwXFxuICAgICAgICB9KSkuc2hhcmVfdG9rZW47XFxuXFxuICAgICAgICBsZXQgaGVhZGVycyA9IHtcXG4gICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb247Y2hhcnNldD1VVEYtOCcsXFxuICAgICAgICAgICAgXFxcIm9yaWdpblxcXCI6IFxcXCJodHRw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5jb20vdjIvYWNjb3VudC90b2tlbicsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInJlZnJlc2hfdG9rZW5cXFwiOiBhbGl0b2tlbixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJncmFudF90eXBlXFxcIjogXFxcInJlZnJlc2hfdG9rZW5cXFwiXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxcbiAgICAgICAgICAgICAgICB0aW1lb3V0OiAzMDAwXFxuICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKCdhbGl1c2VyaW5mbycsIHVzZXJpbmZvKTtcXG4gICAgICAgICAgICBwdXRNeVZhcigndXNlcmluZm9DaGVja3RpbWUnLCBub3d0aW1lICsgJ3RpbWUnKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBhdXRob3JpemF0aW9uID0gJ0JlYXJlciAnICsgdXNlcmluZm8uYWNjZXNzX3Rva2VuO1xcbiAgICAgICAgbGV0IGRldmljZUlkID0gdXNlcmluZm8uZGV2aWNlX2lkO1xcbiAgICAgICAgbGV0IHVzZXJJZCA9IHVzZXJpbmZvLnVzZXJfaWQ7XFxuICAgICAgICBsZXQgc2lnbmF0dXJlO1xcblxcbiAgICAgICAgbGV0IGFzID0ganVzdFRlc3RTaWduKFxcXCI1ZGRlNGUxYmRmOWU0OTY2YjM4N2JhNThmNGIzZmRjM1xcXCIsIGRldmljZUlkLCB1c2VySWQpO1xcbiAgICAgICAgLy9sb2coYSk7XFxuICAgICAgICBsZXQgYnAgPSBhcy5zcGxpdChcXFwiIyNcXFwiKTtcXG4gICAgICAgIHZhciBzaWduID0gYnBbMF07XFxuICAgICAgICB2YXIgcHViS2V5ID0gYnBbYnAubGVuZ3RoIC0gMV07XFxuXFxuICAgICAgICBsZXQgaSA9IDA7XFxuICAgICAgICBkbyB7XFxuXFxuICAgICAgICAgICAgbGV0IHNlc3MgPSBmZXRjaCgnaHR0cHM6Ly9hcGkuYWxpeXVuZHJpdmUuY29tL3VzZXJzL3YxL3VzZXJzL2RldmljZS9jcmVhdGVfc2Vzc2lvbicsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcXG4gICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJyxcXG4gICAgICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogYXV0aG9yaXphdGlvbixcXG4gICAgICAgICAgICAgICAgICAgICdYLVNoYXJlLVRva2VuJzogc2hhcmV0b2tlbixcXG4gICAgICAgICAgICAgICAgICAgICd4LWRldmljZS1pZCc6IGRldmljZUlkLFxcbiAgICAgICAgICAgICAgICAgICAgJ3gtc2lnbmF0dXJlJzogc2lnblxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiAne1xcXCJkZXZpY2VOYW1lXFxcIjpcXFwiQ2hyb21l5rWP6KeI5ZmoXFxcIixcXFwibW9kZWxOYW1lXFxcIjpcXFwiV2luZG93c+e9kemhteeJiFxcXCIsXFxcIm5vbmNlXFxcIjowLFxcXCJwdWJLZXlcXFwiOlxcXCInICsgcHViS2V5ICsgJ1xcXCIsXFxcInJlZnJlc2hUb2tlblxcXCI6XFxcIicgKyBhbGl0b2tlbiArICdcXFwifScsXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKHNlc3MuaW5jbHVkZXMoJ3N1Y2Nlc3MnKSkge1xcbiAgIC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iOiBzaGFyZV9pZCxcXG4gICAgICAgICAgICBcXFwidGVtcGxhdGVfaWRcXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBcXFwiZ2V0X3N1YnRpdGxlX2luZm9cXFwiOiB0cnVlXFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhkYXRhKTtcXG4gICAgICAgIGxldCBqc29uID0gSlNPTi5wYXJzZShyZXF1ZXN0KCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vdjIvZmlsZS9nZXRfc2hhcmVfbGlua192aWRlb19wcmV2aWV3X3BsYXlfaW5mbycsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgIGJvZHk6IGRhdGEsXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCcsXFxuICAgICAgICAgICAgdGltZW91dDogMzAwMFxcbiAgICAgICAgfSkpO1xcbiAgICAgICAgYWxpeXVuVXJsID0ganNvbi52aWRlb19wcmV2aWV3X3BsYXlfaW5mby5saXZlX3RyYW5zY29kaW5nX3Rhc2tfbGlzdDtcXG4gICAgICAgIGFsaXl1blVybC5yZXZlcnNlKCk7XFxuXFxuICAgICAgICByZXR1cm4gYWxpeXVuVXJsO1xcbiAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICBsb2coJ+agueaNruWFseS6q+mTvuaOpeiOt+WPluaSreaUvuWcsOWdgOWksei0pT4nICsgZS5tZXNzYWdlKTtcXG4gICAgICAgIHJldHVybiBcXFwiXFxcIjtcXG4gICAgfVxcbn1cXG5cXG5mdW5jdGlvbiBnZXRBbGlVcmwoc2hhcmVfaWQsIGZpbGVfaWQsIGFsaXRva2VuKSB7XFxuICAgIHRyeSB7XFxuICAgICAgICBsZXQgdXJscyA9IFtdO1xcbiAgICAgICAgbGV0IG5hbWVzID0gW107XFxuICAgICAgICBsZXQgaGVhZHMgPSBbXTtcXG4gICAgICAgIGxldCB1ID0gc3RhcnRQcm94eVNlcnZlcigkLnRvU3RyaW5nKChhbGlTaGFyZVBsYXlVcmwsIGZpbGVfaWQsIHNoYXJlX2lkLCBhbGl0b2tlbikgPT4ge1xcbiAgICAgICAgICAgIGZ1bmN0aW9uIGdldHVybChmaWxlaWQsIGxpbmUpIHtcXG4gICAgICAgICAgICAgICAgLy/pooTliqDovb3ml7bkvJrlj5hmaWxlX2lkLOaJgOS7pXRz6L+H5pyf5pu05paw5pe26L+Y5Y+W5Y6f5p2l55qEaWRcXG4gICAgICAgICAgICAgICAgbGV0IHBsYXlVcmxMaXN0ID0gYWxpU2hhcmVQbGF5VXJsKHNoYXJlX2lkLCBmaWxlaWQsIGFsaXRva2VuKSB8fCBbXTtcXG4gICAgICAgICAgICAgICAgbGV0IGFsaXVybDtcXG4gICAgICAgICAgICAgICAgcGxheVVybExpc3QuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0udGVtcGxhdGVfaWQgPT0gbGluZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGFsaXVybCA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8qYWxpdXJsID0gSlNPTi5wYXJzZShyZXF1ZXN0KGl0ZW0udXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiAzMDAwXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb25bMF07Ki9cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgLy/kuIrpnaLmmK/ojrflj5bpmL/ph4znmoTmkq3mlL7lnLDlnYBcXG4gICAgICAgICAgICAgICAgLy9sb2coXFxcIuaIkeWcqOS7o+eQhlxcXCIgKyBhbGl1cmwpO1xcbiAgICAgICAgICAgICAgICBsZXQgaG9tZSA9IGFsaXVybC5zcGxpdCgnbWVkaWEubTN1OCcpWzBdO1xcbiAgICAgICAgICAgICAgICBsZXQgZiA9IGZldGNoKGFsaXVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiAzMDAwXFxuICAgICAgICAgICAgICAgIH0pLnNwbGl0KFxcXCJcXFxcblxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgZmYgPSBmLm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXQuc3RhcnRzV2l0aChcXFwibWVkaWEtXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIi9wcm94eT91cmw9XFxcIiArIGJhc2U2NEVuY29kZShob21lICsgaXQpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0O1xcbiAgICAgICAgICAgICAgICB9KS5qb2luKFxcXCJcXFxcblxcXCIpO1xcbiAgICAgICAgICAgICAgICAvL2xvZygndWZpZC0nK2ZpbGVpZCk7XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS9fZmlsZVNlbGVjdF8nICsgZmlsZWlkICsgJy5tM3U4JywgZmYpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZmY7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCB1cmwgPSBiYXNlNjREZWNvZGUoTVlfUEFSQU1TLnVybCk7XFxuICAgICAgICAgICAgaWYgKHVybC5pbmNsdWRlcyhcXFwiLnRzXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGZpZCA9IHVybC5zcGxpdCgnJmY9JylbMV0uc3BsaXQoJyYnKVswXTtcXG4gICAgICAgICAgICAgICAgLy9sb2coJ3NmaWQtJytmaWQpO1xcbiAgICAgICAgICAgICAgICBsZXQgZiA9IGZldGNoKCdoaWtlcjovL2ZpbGVzL2NhY2hlL19maWxlU2VsZWN0XycgKyBmaWQgKyAnLm0zdTgnKS5zcGxpdChcXFwiXFxcXG5cXFwiKTtcXG4gICAgICAgICAgICAgICAgZi5mb3JFYWNoKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpdCAmJiBpdC5zdGFydHNXaXRoKCcvcHJveHk/dXJsPScpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZ1cmwgPSBiYXNlNjREZWNvZGUoaXQucmVwbGFjZSgnL3Byb3h5P3VybD0nLCAnJykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwuc3Vic3RyKHVybC5pbmRleE9mKCcvbWVkaWEtJyksIHVybC5pbmRleE9mKCcudHMnKSkgPT0gZnVybC5zdWJzdHIoZnVybC5pbmRleE9mKCcvbWVkaWEtJyksIGZ1cmwuaW5kZXhPZignLnRzJykpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IGZ1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBsZXQgZXhwaXJlcyA9IHVybC5zcGxpdCgneC1vc3MtZXhwaXJlcz0nKVsxXS5zcGxpdCgnJicpWzBdO1xcbiAgICAgICAgICAgICAgICBjb25zdCBsYXN0dGltZSA9IHBhcnNlSW50KGV4cGlyZXMpIC0gRGF0ZS5ub3coKSAvIDEwMDA7XFxuICAgICAgICAgICAgICAgIGlmIChsYXN0dGltZSA8IDYwKSB7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZygn6L+H5pyf5pu05pawJylcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsaW5lID0gdXJsLnNwbGl0KCcvbWVkaWEnKVswXTsgLy/lj5bkuYvliY3mkq3mlL7nmoR0c+autee6v+i3r1xcbiAgICAgICAgICAgICAgICAgICAgbGluZSA9IGxpbmUuc3Vic3RyaW5nKGxpbmUubGFzdEluZGV4T2YoJy8nKSArIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGYgPSBnZXR1cmwoZmlkLCBsaW5lKS5zcGxpdChcXFwiXFxcXG5cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGYuZm9yRWFjaChpdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGl0ICYmIGl0LnN0YXJ0c1dpdGgoJy9wcm94eT91cmw9JykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZ1cmwgPSBiYXNlNjREZWNvZGUoaXQucmVwbGFjZSgnL3Byb3h5P3VybD0nLCAnJykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLnN1YnN0cih1cmwuaW5kZXhPZignL21lZGlhLScpLCB1cmwuaW5kZXhPZignLnRzJykpID09IGZ1cmwuc3Vic3RyKGZ1cmwuaW5kZXhPZignL21lZGlhLScpLCBmdXJsLmluZGV4T2YoJy50cycpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gZnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZygn5pyq6L+H5pyfJylcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKFxcXCLku6PnkIZ0c++8mlxcXCIgKyB1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBzdGF0dXNDb2RlOiAzMDIsXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkxvY2F0aW9uXFxcIjogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgLy9sb2coJ+mmluasoeabtOaWsCcpXFxuICAgICAgICAgICAgICAgIGxldCBsaW5lID0gdXJsLnNwbGl0KCd8JylbMV07XFxuICAgICAgICAgICAgICAgIGxldCBmZiA9IGdldHVybChmaWxlX2lkLCBsaW5lKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZmO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIGFsaVNoYXJlUGxheVVybCwgZmlsZV9pZCwgc2hhcmVfaWQsIGFsaXRva2VuKSk7XFxuXFxuICAgICAgICBsZXQgcGxheVVybExpc3QgPSBhbGlTaGFyZVBsYXlVcmwoc2hhcmVfaWQsIGZpbGVfaWQsIGFsaXRva2VuKSB8fCBbXTtcXG5cXG4gICAgICAgIGlmIChwbGF5VXJsTGlzdC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgcGxheVVybExpc3QuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICB1cmxzLnB1c2godSArIFxcXCI/dXJsPVxcXCIgKyBiYXNlNjRFbmNvZGUoaXRlbS51cmwgKyBcXFwifFxcXCIgKyBpdGVtLnRlbXBsYXRlX2lkKSArIFxcXCIjLm0zdThcXFwiKTtcXG4gICAgICAgICAgICAgICAgbmFtZXMucHVzaCh0cmFuc2NvZGluZ1tpdGVtLnRlbXBsYXRlX2lkXSA/IHRyYW5zY29kaW5nW2l0ZW0udGVtcGxhdGVfaWRdIDogaXRlbS50ZW1wbGF0ZV9oZWlnaHQpO1xcbiAgICAgICAgICAgICAgICBoZWFkcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHZhciBtdWx0ID0ge1xcbiAgICAgICAgICAgICAgICB1cmxzOiB1cmxzLFxcbiAgICAgICAgICAgICAgICBuYW1lczogbmFtZXMsXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRzLFxcbiAgICAgICAgICAgICAgICBkYW5tdTpnZXRWYXIoJ2RtX3NoYXJlJywnJylcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGlmICh6aW11Lmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB6aW11KSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgemltdXQgPSB6aW11W2ldLnRpdDtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmbmFtZS5pbmNsdWRlcyh6aW11dCkgfHwgemltdXQuaW5jbHVkZXMoZm5hbWUuc3Vic3RyaW5nKDAsIGZuYW1lLmxhc3RJbmRleE9mKCcuJykpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11bHRbJ3N1YnRpdGxlJ10gPSBnZXRzdWIoemltdVtpXS5maWQsIHppbXVbaV0uZXh0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICByZXR1cm4gbXVsdDtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgbG9nKCfmnKrojrflj5bpmL/ph4zmkq3mlL7lnLDlnYDvvIzlu7rorq7ph43ov5vova/ku7blho3or5XkuIDmrKEnKVxcbiAgICAgICAgICAgIHJldHVybiB7fTtcXG4gICAgICAgIH1cXG4gICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgbG9nKCfojrflj5blhbHkuqvpk77mjqXmkq3mlL7lnLDlnYDlpLHotKU+JyArIGUubWVzc2FnZSk7XFxuICAgICAgICByZXR1cm4ge307XFxuICAgIH1cXG59XFxuXFxuaWYgKGNhdGUgPT0gJ3ZpZGVvJykge1xcbiAgICAvL2xvZyhyZWFjY2Vzc1RrKTsgXFxuICAgIGlmIChnZXRJdGVtKCdxdWFsaXR5JywgJycpID09ICcxJykge1xcbiAgICAgICAgLy/ljp/nlLtcXG4gICAgICAgIC8vYWNjZXNzVGsoKTtcXG5cXG4gICAgICAgIGZ1bmN0aW9uIG9hdXRoUmVkaXJlY3QoY29kZSkge1xcbiAgICAgICAgICAgIC8vbG9nKGNvZGUpO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcignb3JlZCcsICcxJykgIT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IGZldGNoKCdodHRwczovL2FwaS54aG9mZS50b3AvYWxpc3QvYWxpX29wZW4vY29kZScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjb2RlXFxcIjogY29kZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImdyYW50X3R5cGVcXFwiOiBcXFwiYXV0aG9yaXphdGlvbl9jb2RlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb24gPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gZmV0Y2goJ2h0dHBzOi8vYXBpLWNmLm5uLmNpL2FsaXN0L2FsaV9vcGVuL2NvZGUnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJ1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiY29kZVxcXCI6IGNvZGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiZ3JhbnRfdHlwZVxcXCI6IFxcXCJhdXRob3JpemF0aW9uX2NvZGVcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsb2coJ+iOt+WPllJlZnJlc2hUb2tlbk9wZW4nKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChqc29uLmluY2x1ZGVzKCdUb28gTWFueSBSZXF1ZXN0cycpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ29yZWQnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCfor7fmsYLlpKrpopHnuYHvvIzooqvlsIHpmZDliLbkuoYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZygn6K+35rGC5aSq6aKR57mB77yM6KKr5bCBSVDkuoYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJyc7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdvcmVkJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoSlNPTi5wYXJzZShqc29uKS5yZWZyZXNoX3Rva2VuKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZXRSZWZyZXNoVG9rZW5PcGVuID0gSlNPTi5wYXJzZShqc29uKS5yZWZyZXNoX3Rva2VuO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcGVuVG9rZW4uUmVmcmVzaFRva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4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRob3JpemF0aW9uJzogcmVhY2Nlc3NUaywgLy9nZXRBY2Nlc3NUb2tlblxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4LWNhbmFyeSc6ICdjbGllbnQ9d2ViLGFwcD1zaGFyZSx2ZXJzaW9uPXYyLjMuMScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3gtc2hhcmUtdG9rZW4nOiBzaGFyZXRva2VuXFxuXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJhdXRob3JpemVcXFwiOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzY29wZVxcXCI6IFxcXCJ1c2VyOmJhc2UsZmlsZTphbGw6cmVhZCxmaWxlOmFsbDp3cml0ZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgLy9sb2coJ29hdXRocmVxXFxcXG4nICsganNvbik7XFxuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gSlNPTi5wYXJzZShqc29uKS5yZWRpcmVjdFVyaS5zcGxpdChcXFwiY29kZT1cXFwiKVsxXTtcXG4gICAgICAgICAgICAgICAgLy9sb2coY29kZSk7XFxuICAgICAgICAgICAgICAgIG9hdXRoUmVkaXJlY3QoY29kZSk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICByZWFjY2Vzc1RrID0gJyc7XFxuICAgICAgICAgICAgICAgIGFjY2Vzc1RrKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfTtcXG5cXG4gICAgICAgIGZ1bmN0aW9uIHJlZnJlc2hPcGVuVG9rZW4oKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdyb3QnLCAnMScpICE9ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSBmZXRjaCgnaHR0cHM6Ly9hcGkueGhvZmUudG9wL2FsaXN0L2FsaV9vcGVuL3Rva2VuJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYW50X3R5cGUnOiAncmVmcmVzaF90b2tlbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyZWZyZXNoX3Rva2VuJzogT3BlblRva2VuLlJlZnJlc2hUb2tlbk9wZW5cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChqc29uID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IGZldGNoKCdodHRwczovL2FwaS1jZi5ubi5jaS9hbGlzdC9hbGlfb3Blbi9jb2RlJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYW50X3R5cGUnOiAncmVmcmVzaF90b2tlbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAncmVmcmVzaF90b2tlbic6IE9wZW5Ub2tlbi5SZWZyZXNoVG9rZW5PcGVuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsb2coJ+iOt+WPlkFjY2Vzc1Rva2VuT3BlbicpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb24uaW5jbHVkZXMoJ1RvbyBNYW55IFJlcXVlc3RzJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncm90JywgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn6K+35rGC5aSq6aKR57mB77yM6KKr5bCB6ZmQ5Yi25LqGJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coJ+ivt+axguWkqumikee5ge+8jOiiq+WwgUlQ5LqGJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncm90JywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoSlNPTi5wYXJzZShqc29uKS5yZWZyZXNoX3Rva2VuKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZXRSZWZyZXNoVG9rZW5PcGVuID0gSlNPTi5wYXJzZShqc29uKS5yZWZyZXNoX3Rva2VuO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcGVuVG9rZW4uUmVmcmVzaFRva2VuT3BlbiA9IGdldFJlZnJlc2hUb2tlbk9wZW47XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZXRBY2Nlc3NUb2tlbk9wZW4gPSBKU09OLnBhcnNlKGpzb24pLnRva2VuX3R5cGUgKyAnICcgKyBKU09OLnBhcnNlKGpzb24pLmFjY2Vzc190b2tlbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgT3BlblRva2VuLkFjY2Vzc1Rva2VuT3BlbiA9IGdldEFjY2Vzc1Rva2VuT3BlbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2ljeS9pY3ktYWxpLU9wZW5Ub2tlbi5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoT3BlblRva2VuKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgIH07XFxuXFxuICAgICAgICBmdW5jdGlvbiBjb3B5KGZpbGVJZCkge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBqc29uID0gZmV0Y2goJ2h0dHBzOi8vYXBpLmFsaXl1bmRyaXZlLmNvbS9hZHJpdmUvdjIvYmF0Y2gnLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aG9yaXphdGlvbic6IHJlYWNjZXNzVGssXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9nZXRBY2Nlc3NUb2tlblxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4LWNhbmFyeSc6ICdjbGllbnQ9d2ViLGFwcD1zaGFyZSx2ZXJzaW9uPXYyLjMuMScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3gtc2hhcmUtdG9rZW4nOiBzaGFyZXRva2VuXFxuXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJyZXF1ZXN0c1xcXCI6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJib2R5XFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImZpbGVfaWRcXFwiOiBmaWxlSWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwic2hhcmVfaWRcXFwiOiBzaGFyZUlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImF1dG9fcmVuYW1lXFxcIjogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ0b19wYXJlbnRfZmlsZV9pZFxcXCI6IFxcXCJyb290XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ0b19kcml2ZV9pZFxcXCI6IGRlZmRyaXZlaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQ29udGVudC1UeXBlXFxcIjogXFxcImFwcGxpY2F0aW9uL2pzb25cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpZFxcXCI6IFxcXCIwXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1ldGhvZFxcXCI6IFxcXCJQT1NUXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IFxcXCIvZmlsZS9jb3B5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJyZXNvdXJjZVxcXCI6IFxcXCJmaWxlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAvL2xvZygnY29weVxcXFxuJyArIGpzb24pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShqc29uKS5yZXNwb25zZXNbMF0uYm9keS5maWxlX2lkO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH07XFxuXFxuICAgICAgICBmdW5jdGlvbiBvcGVuKGZpbGVJZCkge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBqc29uID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgIGxldCBudW1iZXIgPSAwO1xcbiAgICAgICAgICAgICAgICBkbyB7XFxuICAgICAgICAgICAgICAgICAgICBqc29uID0gZmV0Y2goJ2h0dHBzOi8vb3Blbi5hbGl5dW5kcml2ZS5jb20vYWRyaXZlL3YxLjAvb3BlbkZpbGUvZ2V0RG93bmxvYWRVcmwnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGhvcml6YXRpb24nOiBPcGVuVG9rZW4uQWNjZXNzVG9rZW5PcGVuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZ2V0QWNjZXNzVG9rZW5PcGVuXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdmaWxlX2lkJzogZmlsZUlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnZHJpdmVfaWQnOiBkZWZkcml2ZWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZygnb3BlblxcXFxuJyArIGpzb24pO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb24uaW5jbHVkZXMoJ1xcXCJ1cmxcXFwiOlxcXCJodHRwJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGlmIChqc29uLmluY2x1ZGVzKFxcXCJUb29NYW55UmVxdWVzdHNcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZGVsZXRlZShmaWxlSWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCdUb28gTWFueSBSZXF1ZXN0cycpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdyZWRpcmVjdCcsICcwJykgPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgb2F1dGhSZXF1ZXN0KCk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hPcGVuVG9rZW4oKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIG51bWJlcisrXFxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKG51bWJlciA8IDIpO1xcbiAgICAgICAgICAgICAgICAvL2RlbGV0ZWUoZmlsZUlkKTtcXG4gICAgICAgICAgICAgICAgaWYgKGpzb24uaW5jbHVkZXMoJ2h0dHAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoanNvbikudXJsICsgJyNpc1ZpZGVvPXRydWUjO3tSZWZlcmVyQGh0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS99JztcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhqc29uKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfTtcXG5cXG4gICAgICAgIGZ1bmN0aW9uIGRlbGV0ZWUoZmlsZUlkKSB7XFxuXFxuICAgICAgICAgICAgZmV0Y2goJ2h0dHBzOi8vYXBpLmFsaXl1bmRyaXZlLmNvbS9hZHJpdmUvdjIvYmF0Y2gnLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJyxcXG4gICAgICAgICAgICAgICAgICAgICdhdXRob3JpemF0aW9uJzogcmVhY2Nlc3NUayxcXG4gICAgICAgICAgICAgICAgICAgICd4LWNhbmFyeSc6ICdjbGllbnQ9d2ViLGFwcD1zaGFyZSx2ZXJzaW9uPXYyLjMuMScsXFxuICAgICAgICAgICAgICAgICAgICAneC1zaGFyZS10b2tlbic6IHNoYXJldG9rZW5cXG5cXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInJlcXVlc3RzXFxcIjogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiYm9keVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImRyaXZlX2lkXFxcIjogZGVmZHJpdmVpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImZpbGVfaWRcXFwiOiBmaWxlSWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJoZWFkZXJzXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQ29udGVudC1UeXBlXFxcIjogXFxcImFwcGxpY2F0aW9uL2pzb25cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiaWRcXFwiOiBmaWxlSWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1ldGhvZFxcXCI6IFxcXCJQT1NUXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwidXJsXFxcIjogXFxcIi9maWxlL2RlbGV0ZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInJlc291cmNlXFxcIjogXFxcImZpbGVcXFwiXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgLy9sb2coJ+WIoOmZpCAnICsgZGVsKTtcXG4gICAgICAgICAgICAvKlxcbiAgICAgICAgICAgIGZldGNoKCdodHRwczovL29wZW4uYWxpeXVuZHJpdmUuY29tL2Fkcml2ZS92MS4wL29wZW5GaWxlL2RlbGV0ZScsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXG4gICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nLFxcbiAgICAgICAgICAgICAgICAgICAgJ2F1dGhvcml6YXRpb24nOiBnZXRJdGVtKCdnZXRBY2Nlc3NUb2tlbk9wZW4nLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICAneC1zaGFyZS10b2tlbic6IHNoYXJldG9rZW5cXG5cXG5cXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImRyaXZlX2lkXFxcIjogZGVmZHJpdmVpZCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJmaWxlX2lkXFxcIjogZmlsZUlkXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICAvL2xvZygnZGVsZVxcXFxuJyArIGpzb24pO1xcbiAgICAgICAgfTtcXG5cXG4gICAgICAgIC8v5aSE55CG6KeG6aKRICBcXG4gICAgICAgIHZhciBkc2lkID0gc2hhcmVJZDtcXG4gICAgICAgIHZhciBkZmlkID0gaW5wdXQ7XFxuXFxuICAgICAgICBsZXQgZmlsZUlkID0gY29weShkZmlkKTtcXG4gICAgICAgIHZhciBwbGF5ID0gb3BlbihmaWxlSWQpO1xcbiAgICAgICAgaWYgKGZpbGVJZC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgZGVsZXRlZShmaWxlSWQpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHppbXUubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgaW4gemltdSkge1xcbiAgICAgICAgICAgICAgICB2YXIgemltdXQgPSB6aW11W2ldLnRpdDtcXG4gICAgICAgICAgICAgICAgaWYgKGZuYW1lLmluY2x1ZGVzKHppbXV0KSB8fCB6aW11dC5pbmNsdWRlcyhmbmFtZS5zdWJzdHJpbmcoMCwgZm5hbWUubGFzdEluZGV4T2YoJy4nKSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICBwbGF5ID0gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtwbGF5LnNwbGl0KCc7eycpWzBdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1YnRpdGxlOiBnZXRzdWIoemltdVtpXS5maWQsIHppbXVbaV0uZXh0KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkYW5tdTpnZXRWYXIoJ2RtX3NoYXJlJywnJylcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHBsYXk9SlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbcGxheS5zcGxpdCgnO3snKVswXV0sXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IFt7XFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJ1xcbiAgICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICAgICAgZGFubXU6Z2V0VmFyKCdkbV9zaGFyZScsJycpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIC8v5pmu55S7ICBcXG4gICAgICAgIHZhciBkc2lkID0gc2hhcmVJZDtcXG4gICAgICAgIHZhciBkZmlkID0gaW5wdXQ7XFxuXFxuICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nKSB7XFxuICAgICAgICAgICAgdmFyIHBsYXkgPSBKU09OLnN0cmluZ2lmeShnZXRBbGlVcmwoXFxuICAgICAgICAgICAgICAgIHNoYXJlSWQsXFxuICAgICAgICAgICAgICAgIGlucHV0LFxcbiAgICAgICAgICAgICAgICByZWZ0b2tlblxcbiAgICAgICAgICAgICkpO1xcbiAgICAgICAgfVxcbiAgICB9XFxufSBlbHNlIGlmIChjYXRlID09ICdpbWFnZScpIHtcXG4gICAgLy/lpITnkIbmlofmoaNcXG4gICAgLy9hY2Nlc3NUaygpO1xcblxcbiAgICB2YXIganNvbiA9IGZldGNoKCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vdjIvZmlsZS9nZXRfc2hhcmVfbGlua19kb3dubG9hZF91cmwnLCB7XFxuICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcXG4gICAgICAgICAgICAnQXV0aG9yaXphdGlvbic6IHJlYWNjZXNzVGssXFxuICAgICAgICAgICAgJ1gtU2hhcmUtVG9rZW4nOiBzaGFyZXRva2VuXFxuICAgICAgICB9LFxcbiAgICAgICAgYm9keTogJ3tcXFwic2hhcmVfaWRcXFwiOlxcXCInICsgc2hhcmVJZCArICdcXFwiLFxcXCJleHBpcmVfc2VjXFxcIjogNjAwLFxcXCJmaWxlX2lkXFxcIjpcXFwiJyArIGlucHV0ICsgJ1xcXCJ9JyxcXG4gICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgIH0pO1xcblxcbiAgICAvL2xvZyhqc29uKTtcXG4gICAgLypcXG4gICAgICAgIHZhciBsb2NsaW5rID0gSlNPTi5wYXJzZShmZXRjaChKU09OLnBhcnNlKGpzb24pLmRvd25sb2FkX3VybCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBNT0JJTEVfVUEsXFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcXG4gICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICB3aXRoU3RhdHVzQ29kZTogdHJ1ZVxcbiAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb25bMF07XFxuICAgICAgICAqL1xcbiAgICB2YXIgbG9jbGluayA9IEpTT04ucGFyc2UoanNvbikuZG93bmxvYWRfdXJsO1xcbiAgICAvL2xvZyhsb2NsaW5rKTtcXG4gICAgaWYgKGNhdGUgPT0gJ2ltYWdlJykge1xcbiAgICAgICAgdmFyIHBsYXkgPSAncGljczovLycgKyBsb2NsaW5rICsgJ0BSZWZlcmVyPWh0dHBzOi8vd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ZmlsZXMvcnVsZXMvaWN5L2ljeS1hbGktdG9rZW4uanNvblxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBudG9rZW5bMF0gPSB0b2tlbjtcXG4gICAgICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAud3JpdGVGaWxlKGFsaXN0ZmlsZSwgSlNPTi5zdHJpbmdpZnkobnRva2VuKSk7XFxuICAgICAgICAgICAgICAgICAgICBsb2NhbFN0b3JhZ2UuY2xlYXIoKTtcXG4gICAgICAgICAgICAgICAgICAgIGFsZXJ0KCdUT0tFTuiOt+WPluaIkOWKn++8jOi/lOWbnuWQjuWIt+aWsOmhtemdou+8gScpO1xcbiAgICAgICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5wYXJzZUxhenlSdWxlKGBoaWtlcjovL2VtcHR5QGxhenlSdWxlPS5qczpyZWZyZXNoWDVXZWJWaWV3KCcnKTtgKTtcXG4gICAgICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAuYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdG9rZW5fdGltZXIoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgdG9rZW5fdGltZXIgPSBmdW5jdGlvbigpIHtcXG4gICAgICAgICAgICAgICAgc2V0VGltZW91dCh0b2tlbkZ1bmN0aW9uLCA1MDApXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB0b2tlbkZ1bmN0aW9uKCk7XFxuICAgICAgICB9LCBudG9rZW4pXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nbGUnLFxcbiAgICAgICAgICAgIGRlc2M6ICcxMDAlJiZmbG9hdCcsXFxuICAgICAgICAgICA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F90b2tlbjtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdG9hc3QoJ+eUqOaIt+S/oeaBr+iOt+WPluWksei0pe+8jOivt+eZu+WFpei0puWPt+OAgicpO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGlmIChyZWZ0b2tlbi5sZW5ndGggPT0gMzIpIHtcXG4gICAgICAgIHZhciByZWZyZXNoID0gZmV0Y2goJ2h0dHBzOi8vYXV0aC5hbGl5dW5kcml2ZS5jb20vdjIvYWNjb3VudC90b2tlbicsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXFxuICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxuICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiAne1xcXCJyZWZyZXNoX3Rva2VuXFxcIjpcXFwiJyArIHJlZnRva2VuICsgJ1xcXCIsXFxcImdyYW50X3R5cGVcXFwiOlxcXCJyZWZyZXNoX3Rva2VuXFxcIn0nLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIG50b2tlblswXSA9IEpTT04ucGFyc2UocmVmcmVzaCk7XFxuICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvaWN5L2ljeS1hbGktdG9rZW4uanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KG50b2tlbikpO1xcbiAgICAgICAgbG9nKCfov5DooYzpooTlpITnkIYnKTtcXG4gICAgICAgIGlmICghZmlsZUV4aXN0KFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2ljeS9pY3ktYWxpLXRva2VuLmpzb25cXFwiKSB8fCByZWZyZXNoLmxl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ay9nZXRfc2hhcmVfYnlfYW5vbnltb3VzXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBQQ19VQSxcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJSZWZlcmVyXFxcXFxcXCI6IFxcXFxcXFwiaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwic2hhcmVfaWRcXFxcXFxcIjogc2hhcmVJZFxcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgaWYgKHNoYXJlLmluY2x1ZGVzKFxcXFxcXFwic2hhcmVfbGluayBpc1xcXFxcXFwiKSB8fCBzaGFyZS5pbmNsdWRlcyhcXFxcXFxcInNoYXJlX2xpbmsgY2Fubm90XFxcXFxcXCIpKSByZXR1cm4gZmFsc2U7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgIHJldHVybiB0cnVlO1xcXFxufVxcXFxuXFxcXG5sZXQgcnVsZXMgPSBbe1xcXFxuICAgICAgICBuYW1lOiBcXFxcXFxcIuS6keebmOi1hOa6kFxcXFxcXFwiLFxcXFxuICAgICAgICBwYWdlOiB0cnVlLFxcXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcXFxcXCJodHRwczovL3Jlcy55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XFxcXCIgKyBzICsgXFxcXFxcXCImcGFnZT1cXFxcXFxcIiArIHBhZ2UgKyBcXFxcXFxcIiZzX3R5cGU9MVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KHVybCwge1xcXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJSZWZlcmVyXFxcXFxcXCI6IFxcXFxcXFwiaHR0cHM6Ly93d3cudXB5dW5zby5jb21cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJDb29raWVcXFxcXFxcIjogXFxcXFxcXCJjb2RlPTE5MTlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgLy9sb2coYmFzZTY0RGVjb2RlKGh0bWwpKTtcXFxcbiAgICAgICAgICAgIGxldCBhcnIgPSBKU09OLnBhcnNlKGJhc2U2NERlY29kZShodG1sKSkucmVzdWx0Lml0ZW1zO1xcXFxuICAgICAgICAgICAgLy9sb2coYXJyKTtcXFxcbiAgICAgICAgICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdSA9IGl0LnBhZ2VfdXJsO1xcXFxuICAgICAgICAgICAgICAgIC8vdSA9IHUubGVuZ3RoID4gMCA/IHVbMF0gOiB1cmw7XFxcXG4gICAgICAgICAgICAgICAgaWYgKCF1LmluY2x1ZGVzKFxcXFxcXFwiYWxpeXVuZHJpdmVcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdSArICc/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQodSkgKyAnPz8/ZnlwYWdlJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdSh1KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT5VUOS6keaQnDwvZm9udD4mbmJzcDtcXFxcXFxcIiArIFxcXFxcXFwiXFxcXFxcXFxuXFxcXFxcXCIgKyAodSksXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG5cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJldHVybiBkO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSwge1xcXFxuICAgICAgICBuYW1lOiBcXFxcXFxcIueMq+eLuOebmOaQnFxcXFxcXFwiLFxcXFxuICAgICAgICBwYWdlOiBmYWxzZSxcXFxcbiAgICAgICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcXFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KFxcXFxcXFwiaHR0cHM6Ly93d3cuYWxpcGFuc291LmNvbS9zZWFyY2g/az1cXFxcXFxcIiArIHMsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiUmVmZXJlclxcXFxcXFwiOiBcXFxcXFxcImh0dHBzOi8vd3d3LmFsaXBhbnNvdS5jb20vc2VhcmNoP2s9XFxcXFxcXCIgKyBzXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsZXQgYXJyID0gcGRmYShodG1sLCBcXFxcXFxcIiNhcHAmJmFcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcXFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gXFxcXFxcXCI8ZGl2PlxcXFxcXFwiICsgYXJyW2ldICsgXFxcXFxcXCI8L2Rpdj5cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsIFxcXFxcXFwiYSYmaHJlZlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAvL2xvZyh1KTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoIXUuaW5jbHVkZXMoXFxcXFxcXCIvcy9cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHUgPSBcXFxcXFxcImh0dHBzOi8vd3d3LmFsaXBhbnNvdS5jb21cXFxcXFxcIiArIHUucmVwbGFjZShcXFxcXFxcIi9zL1xcXFxcXFwiLCBcXFxcXFxcIi9jdi9cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXQsIFxcXFxcXFwidGVtcGxhdGUmJlRleHRcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCh1KS5sYXp5UnVsZSgod3JhcHUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChpbnB1dCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJDb29raWVcXFxcXFxcIjogXFxcXFxcXCJub19zaG93X2RvbmF0ZT0xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiUmVmZXJlclxcXFxcXFwiOiBpbnB1dC5yZXBsYWNlKFxcXFxcXFwiL2N2L1xcXFxcXFwiLCBcXFxcXFxcIi9zL1xcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGh0bWwgPSBwYXJzZURvbUZvckh0bWwoaHRtbCwgJ2EmJmhyZWYnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIF9saW5rcyA9IGh0bWwubWF0Y2goL2h0dHBzOlxcXFxcXFxcL1xcXFxcXFxcLyh3d3dcXFxcXFxcXC5hbGl5dW5kcml2ZVxcXFxcXFxcLmNvbVxcXFxcXFxcL3N8YWx5d3BcXFxcXFxcXC5uZXQpXFxcXFxcXFwvXFxcXFxcXFx3Ki9nKSB8fCBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKF9saW5rcyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaHRtbC5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyBfbGlua3NbMF0gKyAnPz9meXBhZ2UnO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudChodG1sKSArICc/Pz9meXBhZ2UnO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3cmFwdShodG1sKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlucHV0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB3cmFwdSksXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+54yr54u455uY5pCcPC9mb250PiZuYnNwO1xcXFxcXFwiICsgcGRmaChpdCwgXFxcXFxcXCJ0ZW1wbGF0ZSwxJiZUZXh0XFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmV0dXJuIGQ7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LCB7XFxcXG4gICAgICAgIG5hbWU6IFxcXFxcXFwi5piT5pCcXFxcXFxcXCIsXFxcXG4gICAgICAgIHBhZ2U6IHRydWUsXFxcXG4gICAgICAgIGZpbmQ6IGZ1bmN0aW9uKHMsIHBhZ2UpIHtcXFxcbiAgICAgICAgICAgIGV2YWwoZ2V0Q3J5cHRvSlMoKSk7XFxcXG5cXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIGtleWVuKHN0cikge1xcXFxuICAgICAgICAgICAgICAgIHZhciBrZXkgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZShcXFxcXFxcIjRPVG9TY1VGT2FlVlRySEVcXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgICAgIGl2ID0gQ3J5cHRvSlMuZW5jLlV0ZjgucGFyc2UoXFxcXFxcXCI5Q0xHYW8xdkhLcW0xN096XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBlbmNyeXB0ZWQgPSBDcnlwdG9KUy5BRVMuZGVjcnlwdCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNpcGhlcnRleHQ6IENyeXB0b0pTLmVuYy5CYXNlNjQucGFyc2Uoc3RyKVxcXFxuICAgICAgICAgICAgICAgIH0sIGtleSwge1xcXFxuICAgICAgICAgICAgICAgICAgICBpdjogaXYsXFxcXG4gICAgICAgICAgICAgICAgICAgIG1vZGU6IENyeXB0b0pTLm1vZGUuQ0JDLFxcXFxuICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczdcXFxcbiAgICAgICAgICAgICAgICB9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOCk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGVuY3J5cHRlZDtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChcXFxcXFxcImh0dHBzOi8veWlzby5mdW4vYXBpL3NlYXJjaD9uYW1lPVxcXFxcXFwiICsgcyArIFxcXFxcXFwiJnBhZ2VObz1cXFxcXFxcIiArIHBhZ2UsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiUmVmZXJlclxcXFxcXFwiOiBcXFxcXFxcImh0dHBzOi8veWlzby5mdW4vaW5mbz9zZWFyY2hLZXk9XFxcXFxcXCIgKyBzLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIkNvb2tpZVxcXFxcXFwiOiBnZXRJdGVtKCd5aXNvdWNvb2tlJywgJycpXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAvL2xvZyhodG1sKTtcXFxcbiAgICAgICAgICAgIGlmIChodG1sLmluY2x1ZGVzKCfnmbvlvZXnlKjmiLfml6DpmZDliLYnKSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciBpID0gMDtcXFxcbiAgICAgICAgICAgICAgICBkbyB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0eWltZ2xpbiA9ICdodHRwczovL3lpc28uZnVuL2FwaS91c2VyL2xvZ2luL2NhcHRjaGE/dD0nICsgcGFyc2VJbnQobmV3IERhdGUoKS5nZXRUaW1lKCkpICsgJyc7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbWcgPSBjb252ZXJ0QmFzZTY0SW1hZ2UodHlpbWdsaW4pLnNwbGl0KCcsJylbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb2QgPSByZXF1ZXN0KCdodHRwczovL2FwaS5ubi5jaS9vY3IvYjY0L3RleHQnLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICd0ZXh0L3BsYWluJ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IGltZyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdmVyID0gSlNPTi5wYXJzZShyZXF1ZXN0KCdodHRwczovL3lpc28uZnVuL2FwaS91c2VyL2xvZ2luJywge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZmVyZXInOiAnaHR0cHM6Ly95aXNvLmZ1bi9sb2dpbicsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0Nvb2tpZSc6IGdldENvb2tpZSh0eWltZ2xpbilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ1c2VyTmFtZVxcXFxcXFwiOiBcXFxcXFxcInR2Ym94MjAyM1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicGFzc3dvcmRcXFxcXFxcIjogXFxcXFxcXCJUdmJveDIwMjNcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImNvZGVcXFxcXFxcIjogY29kXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAodmVyLmNvZGUgPT0gMjAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+aYk+aQnOeZu+WFpemqjOivgeaIkOWKnycpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgneWlzb3Vjb29rZScsIGdldENvb2tpZSgnaHR0cHM6Ly95aXNvLmZ1bicpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGh0bWwgPSByZXF1ZXN0KFxcXFxcXFwiaHR0cHM6Ly95aXNvLmZ1bi9hcGkvc2VhcmNoP25hbWU9XFxcXFxcXCIgKyBzICsgXFxcXFxcXCImcGFnZU5vPVxcXFxcXFwiICsgcGFnZSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJSZWZlcmVyXFxcXFxcXCI6IFxcXFxcXFwiaHR0cHM6Ly95aXNvLmZ1bi9pbmZvP3NlYXJjaEtleT1cXFxcXFxcIiArIHMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQ29va2llXFxcXFxcXCI6IGdldEl0ZW0oJ3lpc291Y29va2UnLCAnJylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGkrKztcXFxcbiAgICAgICAgICAgICAgICB9IHdoaWxlIChpIDwgNCk7XFxcXG5cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBhcnIgPSBKU09OLnBhcnNlKGh0bWwpLmRhdGEubGlzdDtcXFxcbiAgICAgICAgICAgIC8vbG9nKGFycik7XFxcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBrZXllbihpdC51cmwpO1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKHUpO1xcXFxuICAgICAgICAgICAgICAgIGlmICh1ID09IG51bGwgfHwgIXUuaW5jbHVkZXMoXFxcXFxcXCJhbGl5dW5cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOi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gICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlJlZmVyZXJcXFxcXFxcIjogXFxcXFxcXCJodHRwczovL3poYW96aXl1YW4ubGEvc3RvcC5odG1sXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIm9yaWdpblxcXFxcXFwiOiBcXFxcXFxcImh0dHBzOi8vemhhb3ppeXVhbi5sYVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJDb29raWVcXFxcXFxcIjogZ2V0SXRlbShcXFxcXFxcInp6eWNvb2tlXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ1cGdyYWRlLWluc2VjdXJlLXJlcXVlc3RzXFxcXFxcXCI6IFxcXFxcXFwiMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJjb250ZW50LXR5cGVcXFxcXFxcIjogXFxcXFxcXCJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWRcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGh0bWw7XFxcXG4gICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgdmFyIGh0bWwgPSBnZXRodG1sKCk7XFxcXG4gICAgICAgICAgICBpZiAoIWh0bWwuaW5jbHVkZXMoXFxcXFxcXCJzZWFyY2hfYm94XFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHVzZXIgPSAnZFhObGNtNWhiV1U5ZVhCcU1qQXlNeVp3WVhOemQyOXlaRDE1Y0dveU1ESXonO1xcXFxuICAgICAgICAgICAgICAgIGxldCBjb29rID0gSlNPTi5wYXJzZShmZXRjaENvb2tpZSgnaHR0cHM6Ly96aGFveml5dWFuLmxhL2xvZ2l1Lmh0bWwnLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogTU9CSUxFX1VBLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yaWdpbic6ICdodHRwczovL3poYW96aXl1YW4ubGEnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly96aGFveml5dWFuLmxhL2xvZ2luLmh0bWwnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ1cGdyYWRlLWluc2VjdXJlLXJlcXVlc3RzXFxcXFxcXCI6IFxcXFxcXFwiMVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IGJhc2U2NERlY29kZSh1c2VyKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCcsXFxcXG4gICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlLFxcXFxuICAgICAgICAgICAgICAgICAgICB3aXRoSGVhZGVyczogdHJ1ZVxcXFxuICAgICAgICAgICAgICAgIH0pKS5qb2luKCc7Jyk7XFxcXG4gICAgICAgICAgICAgICAgc2V0SXRlbShcXFxcXFxcInp6eWNvb2tlXFxcXFxcXCIsIGNvb2spO1xcXFxuICAgICAgICAgICAgICAgIGxvZyhcXFxcXFxcIuaJvui1hOa6kOeZu+WFpVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBodG1sID0gZ2V0aHRtbCgpO1xcXFxuICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICBsZXQgYXJyID0gcGRmYShodG1sLCBcXFxcXFxcImJvZHkmJi5uZXdzTGlzdCYmbGk6bm90KDpmaXJzdC1jaGlsZClcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcXFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcXFxuICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgXFxcXFxcXCJhJiZocmVmXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGlmICh1ID09IG51bGwpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHUgPSBcXFxcXFxcImh0dHBzOi8vemhhb3ppeXVhbi5sYS9cXFxcXFxcIiArIHU7XFxcXG4gICAgICAgICAgICAgICAgLy9sb2codSk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdCwgXFxcXFxcXCIubmV3c190ZXh0JiZoMyYmVGV4dFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5om+6LWE5rqQPC9mb250PiZuYnNwO1xcXFxcXFwiICsgKHBkZmgoaXQsIFxcXFxcXFwiLm5ld3NfdGV4dCYmcCYmVGV4dFxcXFxcXFwiKSksXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCh1KS5sYXp5UnVsZSgod3JhcHUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChpbnB1dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgX2xpbmtzID0gaHRtbC5tYXRjaCgvaHR0cHM6XFxcXFxcXFwvXFxcXFxcXFwvKHd3d1xcXFxcXFxcLmFsaXl1bmRyaXZlXFxcXFxcXFwuY29tXFxcXFxcXFwvc3xhbHl3cFxcXFxcXFxcLm5ldClcXFxcXFxcXC9cXFxcXFxcXHcqL2cpIHx8IFtdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coX2xpbmtzKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfbGlua3MubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgX2xpbmtzWzBdICsgJz8/ZnlwYWdlJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQoX2xpbmtzWzBdKSArICc/Pz9meXBhZ2UnO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3cmFwdShfbGlua3NbMF0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHdyYXB1KVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmV0dXJuIGQ7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LCB7XFxcXG4gICAgICAgIG5hbWU6IFxcXFxcXFwi5bCP57q45p2hXFxcXFxcXCIsXFxcXG4gICAgICAgIHBhZ2U6IGZhbHNlLFxcXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxcXG4gICAgICAgICAgICBmdW5jdGlvbiBnZXR0b2tlbigpIHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ3h6eXRva2VuJywgJycpLmxlbmd0aCA9PSAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0b2tlbiA9IEpTT04ucGFyc2UocG9zdCgnaHR0cHM6Ly9naXRjYWZlLm5ldC90b29sL2FsaXBhcGVyLycsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3UuZ2l0Y2FmZS5uZXQvJ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb246ICdnZXRfdG9rZW4nXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhO1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigneHp0dG9rZW4nLCB0b2tlbik7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiBnZXRNeVZhcigneHp0dG9rZW4nLCAnJyk7XFxcXG4gICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIGZ1bmN0aW9uIGNhdF9jb2RlKGEpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgZCwgZSwgYiA9IFtcXFxcXFxcIuWNjuivreeUteinhlxcXFxcXFwiLCBcXFxcXFxcIuaXpemfqeeUteinhlxcXFxcXFwiLCBcXFxcXF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XFxcXCIsIFxcXFxcXFwiZmpcXFxcXFxcIiwgXFxcXFxcXCJxdHRwXFxcXFxcXCIsIFxcXFxcXFwicXRcXFxcXFxcIl07XFxcXG4gICAgICAgICAgICAgICAgZm9yIChkID0gMCwgZSA9IGMubGVuZ3RoOyBlID4gZDsgZCsrKVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoY1tkXSA9PSBhKSByZXR1cm4gYltkXTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICBsZXQgaHRtbCA9IHBvc3QoXFxcXFxcXCJodHRwczovL2dpdGNhZmUubmV0L3Rvb2wvYWxpcGFwZXIvXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vdS5naXRjYWZlLm5ldC8nXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGFjdGlvbjogXFxcXFxcXCJzZWFyY2hcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgZnJvbTogXFxcXFxcXCJ3ZWJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgdG9rZW46IGdldHRva2VuKCksXFxcXG4gICAgICAgICAgICAgICAgICAgIGtleXdvcmQ6IHNcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgbGV0IGxpc3QgPSBKU09OLnBhcnNlKGh0bWwpO1xcXFxuICAgICAgICAgICAgaWYgKGxpc3QuZGF0YSkge1xcXFxuICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0LmRhdGE7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBsaXN0W2ldXFxcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gaXQudGl0bGU7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBpdC5hbGlrZXk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHUgPT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgbGV0IG11cmwgPSAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL3MvJyArIHU7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICBpZiAoIWNoZWNrYWxpKG11cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAodGl0bGUuaW5jbHVkZXMocykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuKImiBcXFxcXFxcIiArIHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7lsI/nurjmnaE8L2ZvbnQ+Jm5ic3A7XFxcXFxcXCIgKyBjYXRfY29kZShpdC5jYXQpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXM6IGl0LmRlc1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9aHR0cHM6Ly93d3cuYWx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tcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcXFxuICAgICAgICAgICAgICAgIGxldCB1dGl0bGUgPSBwYXJzZURvbUZvckh0bWwoaXQsICdoMyYmYSYmVGV4dCcpO1xcXFxuICAgICAgICAgICAgICAgIGxldCB1c2VyaWFsID0gcGFyc2VEb21Gb3JIdG1sKGl0LCAnLnZpZGVvLXNlcmlhbCYmVGV4dCcpO1xcXFxuICAgICAgICAgICAgICAgIGxldCB1aW1hZ2UgPSBwYXJzZURvbShpdCwgJy5sYXp5bG9hZCYmZGF0YS1zcmMnLCAnaHR0cDovL3dvZ2cueHl6LycpO1xcXFxuICAgICAgICAgICAgICAgIGxldCB1ID0gcGFyc2VEb20oaXQsICdoMyYmYSYmaHJlZicsICdodHRwOi8vd29nZy54eXovJyk7XFxcXG4gICAgICAgICAgICAgICAgLy9sZXQgZGV0ID0gcmVxdWVzdCh1LCB7fSk7XFxcXG4gICAgICAgICAgICAgICAgYmV0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdXRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGltYWdlOiB1aW1hZ2UsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHVzZXJpYWxcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmIChiZXQubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgIGxldCBiZXRoID0gYmF0Y2hGZXRjaChiZXQpO1xcXFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmV0aC5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkoYmV0aFtpXSwgJy5tb2R1bGUtcGxheWVyLWxpc3QmJnAnKVxcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGxpc3QubGVuZ3RoOyBqKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1ID0gcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICdwJiZUZXh0Jyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXUuaW5jbHVkZXMoXFxcXFxcXCIvcy9cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGJldFtpXS50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBiZXRbaV0uaW1hZ2UsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdSArICc/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudCh1KSArICc/Pz9meXBhZ2UnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUodSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7njqnlgbblk6Xlk6U8L2ZvbnQ+Jm5ic3A7XFxcXFxcXCIgKyAoYmV0W2ldLmRlc2MpICsgJ1xcXFxcXFxcbicgKyB1LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJldHVybiBkO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSwge1xcXFxuICAgICAgICBuYW1lOiBcXFxcXFxcIumYv+mHjOS6keebmOe9kVxcXFxcXFwiLFxcXFxuICAgICAgICBwYWdlOiB0cnVlLFxcXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcXFxcXCJodHRwczovL3d3dy5hbHlwdy5jbi9zZWFyY2gucGhwP3E9XFxcXFxcXCIgKyBzICsgXFxcXFxcXCImcGFnZT1cXFxcXFxcIiArIHBhZ2U7XFxcXG4gICAgICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QodXJsLCB7fSk7XFxcXG4gICAgICAgICAgICBsZXQgYXJyID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnLmxpc3QmJmxpJyk7XFxcXG4gICAgICAgICAgICAvL2xvZyhhcnIpO1xcXFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcbiAgICAgICAgICAgIGxldCBiZXQgPSBbXTtcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcXFxuICAgICAgICAgICAgICAgIGxldCB1dGl0bGUgPSBwYXJzZURvbUZvckh0bWwoaXQsICdhJiZ0aXRsZScpO1xcXFxuICAgICAgICAgICAgICAgIGxldCB1c2VyaWFsID0gcGFyc2VEb21Gb3JIdG1sKGl0LCAnLmZhLWNsb2NrLW8mJlRleHQnKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdWltYWdlID0gcGFyc2VEb20oaXQsICdpbWcmJnNyYycsICdodHRwczovL3d3dy5hbHlwdy5jbi8nKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBhcnNlRG9tKGl0LCAnYSYmaHJlZicsICdodHRwczovL3d3dy5hbHlwdy5jbi8nKTtcXFxcbiAgICAgICAgICAgICAgICAvL2xldCBkZXQgPSByZXF1ZXN0KHUsIHt9KTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoIXV0aXRsZS5pbmNsdWRlcyhzKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgYmV0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdXRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGltYWdlOiB1aW1hZ2UsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHVzZXJpYWxcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIC8vbG9nKGJldCk7XFxcXG4gICAgICAgICAgICBpZiAoYmV0Lmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgYmV0aCA9IGJhdGNoRmV0Y2goYmV0KTtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJldGgubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBwYXJzZURvbUZvckFycmF5KGJldGhbaV0sICdib2R5JiZhW2hyZWZePWh0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zL10nKVxcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhsaXN0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IHBhcnNlRG9tRm9ySHRtbChsaXN0W2pdLCAnYSYmaHJlZicpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogYmV0W2ldLnRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGJldFtpXS5pbWFnZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyB1ICsgJz8/ZnlwYWdlJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB3cmFwdSh1KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPumYv+mHjOS6keebmOe9kTwvZm9udD4mbmJzcDtcXFxcXFxcIiArIChiZXRbaV0uZGVzYykgKyAnXFxcXFxcXFxuJyArIHUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmV0dXJuIGQ7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LFxcXFxuICAgIC8q5aSx5pWIIHtcXFxcbiAgICAgICAgICAgIG5hbWU6IFxcXFxcXFwi5Zyf5ouo6bygXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBwYWdlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgIGZpbmQ6IGZ1bmN0aW9uKHMsIHBhZ2UpIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKCdodHRwczovL3d3dy50YnNkeS5jb20vc2VhcmNoLmh0bWw/a2V5d29yZD0nICsgcyArICcmY2F0ZWdvcnk9OTgzOTIwJmRhdGFfdHlwZT05ODc5MTAnLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUFcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgbGV0IGFyciA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJy5zZWFyY2hfcmVzdWx0X25ldGRpc2tfbGlzdCYmYScpO1xcXFxuICAgICAgICAgICAgICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhpdCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1ID0gcGFyc2VEb21Gb3JIdG1sKGl0LCAnYSYmaHJlZicpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGl0ID0gcGFyc2VEb21Gb3JIdG1sKGl0LCAnLm5ldGRpc2tfaXRlbV9kZXRhaWxfbmFtZSYmVGV4dCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoIXRpdC5pbmNsdWRlcyhzKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgLy9sb2codSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdSArICc/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9wdXNoP3VybD1oaWtlcjovL2VtcHR5IyMnICsgZW5jb2RlVVJJQ29tcG9uZW50KHUpICsgJz8/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHdyYXB1KHUpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7lnJ/mi6jpvKDmkJw8L2ZvbnQ+Jm5ic3A7XFxcXFxcXCIgKyBcXFxcXFxcIlxcXFxcXFxcblxcXFxcXFwiICsgdSxcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiBkO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9LCovXFxcXG4gICAge1xcXFxuICAgICAgICBuYW1lOiBcXFxcXFxcIumYv+mHjOaQnFxcXFxcXFwiLFxcXFxuICAgICAgICBwYWdlOiB0cnVlLFxcXFxuICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxuICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KCdodHRwczovL2FsaXNvLmNjL3MvJyArIHMgKyAnLScgKyBwYWdlICsgJy0wLmh0bWwnLCB7fSk7XFxcXG5cXFxcbiAgICAgICAgICAgIGxldCBsaXN0ID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnLnNlYXJjaC1yZXN1bHQmJi5yZXNvdXJjZS1pdGVtJyk7XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGxpc3QubGVuZ3RoOyBqKyspIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdSA9IGxpc3Rbal07XFxcXG4gICAgICAgICAgICAgICAgbGV0IHRpdCA9IHBhcnNlRG9tRm9ySHRtbCh1LCAnaDMmJlRleHQnKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoIXRpdC5pbmNsdWRlcyhzKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdCxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBhcnNlRG9tKHUsICdoMyYmYSYmaHJlZicsICdodHRwczovL2FsaXNvLmNjLycpKS5sYXp5UnVsZSgod3JhcHUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZ2V0Q3J5cHRvSlMoKSk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGRlY3J5KHN0cikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBrZXkgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZShcXFxcXFxcIjlFQjIwRERGRDZBRkJENjhcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVuY3J5cHRlZCA9IENyeXB0b0pTLkFFUy5kZWNyeXB0KHN0ciwga2V5LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl2OiBrZXksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6IENyeXB0b0pTLm1vZGUuQ0JDLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVuY3J5cHRlZDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KGlucHV0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBidXQgPSBwYXJzZURvbShodG1sLCAnLmJ1dHRvbiYmaHJlZicsICdodHRwczovL2FsaXNvLmNjLycpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coYnV0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnb3QgPSByZXF1ZXN0KGJ1dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhnb3QpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChwYXJzZURvbUZvckh0bWwoZ290LCAnaGVhZCYmc2NyaXB0LDEmJkh0bWwnKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gd3JhcHUoZGVjcnkoYmFzZTY0LnNwbGl0KCchJylbMF0pKTtcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB3cmFwdSksXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+6Zi/6YeM5pCcPC9mb250PiZuYnNwO1xcXFxcXFwiICsgcGFyc2VEb21Gb3JIdG1sKHUsICcudGltZSYmVGV4dCcpLFxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gZDtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0sXFxcXG4gICAgLyrlpLHmlYh7XFxcXG4gICAgICAgICAgIG5hbWU6IFxcXFxcXFwi5Zyf54uX5pCcXFxcXFxcXCIsXFxcXG4gICAgICAgICAgIHBhZ2U6IGZhbHNlLFxcXFxuICAgICAgICAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxcXG4gICAgICAgICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QoJ2h0dHBzOi8vd3d3LnR1Z291c291LmNvbS9zZWFyY2gnLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgYm9keTogJ2tleXdvcmQ9JyArIHMsXFxcXG4gICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgICAgIH0pO1xcXFxuXFxcXG4gICAgICAgICAgICAgICBsZXQgYXJyID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnLmxheXVpLWNvbnRhaW5lciwxJiYubGF5dWktcm93OmhhcyhhKScpO1xcXFxuICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcbiAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgbGV0IGl0ID0gYXJyW2ldO1xcXFxuICAgICAgICAgICAgICAgICAgIGxldCB1ID0gcGFyc2VEb21Gb3JIdG1sKGl0LCAnYSYmaHJlZicpO1xcXFxuICAgICAgICAgICAgICAgICAgIGlmICghdS5pbmNsdWRlcyhcXFxcXFxcIi9zL1xcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgLy9sb2codSk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ICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICBsZXQgYmV0ID0gW107XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gaXQucGlkO1xcXFxuICAgICAgICAgICAgICAgIGJldC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly93d3cueXVucGFuZmVueGlhbmcuY24vYXBpL2Jicy9hcGkvZ2V0YXJ0aWNsZT9pZD0nICsgdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJSZWZlcmVyXFxcXFxcXCI6IFxcXFxcXFwiaHR0cHM6Ly93d3cueXVucGFuZmVueGlhbmcuY24vXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgLy9sb2codSk7XFxcXG4gICAgICAgICAgICBsZXQgYmV0aCA9IGJhdGNoRmV0Y2goYmV0KTtcXFxcblxcXFxuICAgICAgICAgICAgLy9sb2coYXJ0aWNsZSk7XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJldGgubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQganNvbiA9IEpTT04ucGFyc2UoYmV0aFtpXSkuZGF0YTtcXFxcbiAgICAgICAgICAgICAgICAvL2xvZyhqc29uKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IGpzb24uZG93bmxvYWQuc3BsaXQoJ0AnKTtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGxpc3QubGVuZ3RoOyBqKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBsaXN0W2pdO1xcXFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGpzb24udGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3VybDogJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyB1ICsgJz8/ZnlwYWdlJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQodSkgKyAnPz8/ZnlwYWdlJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUoJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycgKyB1KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5LqR55uY5YiG5Lqr56S+PC9mb250PiZuYnNwO1xcXFxcXFwiICsgKGpzb24uY3JlYXRldGltZSkgKyBcXFxcXFxcIlxcXFxcXFxcblxcXFxcXFwiICsgKCdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vcy8nICsgdSksXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgcmV0dXJuIGQ7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LCB7XFxcXG4gICAgICAgIG5hbWU6IFxcXFxcXFwi55uY5pCcXFxcXFxcX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tbCkpO1xcXFxuICAgICAgICAgICAgbGV0IGFyciA9IEpTT04ucGFyc2UoaHRtbCkubGlzdDtcXFxcbiAgICAgICAgICAgIC8vbG9nKGFycik7XFxcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBpdC52b2RfY29udGVudDtcXFxcbiAgICAgICAgICAgICAgICAvL3UgPSB1Lmxlbmd0aCA+IDAgPyB1WzBdIDogdXJsO1xcXFxuICAgICAgICAgICAgICAgIGlmICghdS5pbmNsdWRlcyhcXFxcXFxcImFsaXl1bmRyaXZlXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoIWNoZWNrYWxpKHUpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLiiJogXFxcXFxcXCIgKyBpdC52b2RfbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaXQudm9kX3BpYyxcXFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgdSArICc/P2Z5cGFnZScsXFxcXG4gICAgICAgICAgICAgICAgICAgIC8vdXJsOiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQodSkgKyAnPz8/ZnlwYWdl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FxcXFwibmV4dCBwYWdlXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyh1Mik7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiYmluZ1xcXFxcXFwiLCB1Mik7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmICh1ID09IG51bGwgfHwgdCA9PSBudWxsIHx8ICFpdC5pbmNsdWRlcyhzKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKCFpdC5pbmNsdWRlcyhcXFxcXFxcIue9keebmFxcXFxcXFwiKSAmJiAhaXQuaW5jbHVkZXMoXFxcXFxcXCLkupHnm5hcXFxcXFxcIikgJiZcXFxcbiAgICAgICAgICAgICAgICAgICAgIWl0LmluY2x1ZGVzKFxcXFxcXFwiYWxpeXVuZHJpdmVcXFxcXFxcIikgJiYgIWl0LmluY2x1ZGVzKFxcXFxcXFwieXVucGFuXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAodS5zdGFydHNXaXRoKFxcXFxcXFwiaHR0cHM6Ly9jbi5iaW5nLmNvbS9cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGxldCBkb20gPSBnZXRIb21lKHUpLnJlcGxhY2UoXFxcXFxcXCJodHRwOi8vXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpLnJlcGxhY2UoXFxcXFxcXCJodHRwczovL1xcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgX2xpbmtzID0gdC5tYXRjaCgvaHR0cHM6XFxcXFxcXFwvXFxcXFxcXFwvKHd3d1xcXFxcXFxcLmFsaXl1bmRyaXZlXFxcXFxcXFwuY29tXFxcXFxcXFwvc3xhbHl3cFxcXFxcXFxcLm5ldClcXFxcXFxcXC9cXFxcXFxcXHcqL2cpIHx8IFtdO1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKF9saW5rcyk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGMgPSBudWxsO1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKF9saW5rcyk7XFxcXG4gICAgICAgICAgICAgICAgLy9pZiAoX2xpbmtzLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgICAgICAvL2MgPSAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQoX2xpbmtzWzBdKSArICc/Pz9meXBhZ2UnO1xcXFxuICAgICAgICAgICAgICAgIC8vYz13cmFwdShfbGlua3NbMF0pXFxcXG4gICAgICAgICAgICAgICAgLy99XFxcXG4gICAgICAgICAgICAgICAgaWYgKF9saW5rcy5sZW5ndGggPiAxICYmIF9saW5rc1sxXS5yZXBsYWNlKF9saW5rc1swXSwgXFxcXFxcXCJcXFxcXFxcIikucmVwbGFjZSgvW2EtekEtWjAtOV0rL2csIFxcXFxcXFwiXFxcXFxcXCIpID09IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgYyA9IHdyYXB1KF9saW5rc1sxXSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChfbGlua3MubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBjID0gd3JhcHUoX2xpbmtzWzBdKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHQsXFxcXG4gICAgICA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YS16QS1aMC05XSsvZywgXFxcXFxcXCJcXFxcXFxcIikgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3cmFwdShfbGlua3NbMV0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChfbGlua3MubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB3cmFwdShfbGlua3NbMF0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcnVsZSA9IE1ZX1JVTEUudGl0bGU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9wYWdlL3lzZng/cnVsZT1cXFxcXFxcIiArIHJ1bGUgKyBcXFxcXFxcIiZyPVxcXFxcXFwiICsgcnVsZSArIFxcXFxcXFwiJm1vZGU9XFxcXFxcXCIgKyBtb2RlICsgXFxcXFxcXCIjI1xcXFxcXFwiICsgaW5wdXQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHdyYXB1LCBjb25maWcubW9kZSlcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJldHVybiBkO1xcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuXTtcXFxcblxcXFxuLypcXFxcbmxldCBjY29mID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvY2NvZicpXFxcXG5ydWxlcy5wdXNoKGNjb2YpXFxcXG4qL1xcXFxuLy/lubblj5Hop4TliJnmlbBcXFxcbmxldCBzaXplID0gMTA7XFxcXG5cXFxcbiQuZXhwb3J0cyA9IGZ1bmN0aW9uKHBhZ2UsIHJ1bGUpIHtcXFxcbiAg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6Y5pa5QVBQXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip/jgIJcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pLFxcXFxuICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJpY29uXzJfcm91bmRcXFxcXFxcIixcXFxcbiAgICAgICAgZGVzYzogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgcGljX3VybDogXFxcXFxcXCJoaWtlcjovL2ltYWdlcy9pY29uMVxcXFxcXFwiXFxcXG4gICAgfSk7XFxcXG5cXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogJ+aQnOe0oicsXFxcXG4gICAgICAgIGRlc2M6ICfor7fovpPlhaXlhbPplK7or40nLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXFxcbiAgICAgICAgdXJsOiAkLnRvU3RyaW5nKCgpID0+IHtcXFxcbiAgICAgICAgICAgIGlmIChpbnB1dC5zdGFydHNXaXRoKCdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vcy8nKSkge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/dXJsPWhpa2VyOi8vZW1wdHkjIycgKyBlbmNvZGVVUklDb21wb25lbnQoaW5wdXQpICsgJz8/P2Z5cGFnZSc7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzJywgaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9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xcXFwiICsgcCArIFxcXFxcXFwi6aG15Lit77yM6L+b5bqm77yaMS9cXFxcXFxcIiArIGRhdGEubGVuZ3RoLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZGVzYzogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHBpY191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxuICAgIHNldFJlc3VsdChkKTtcXFxcbiAgICAvL2xvZyhkYXRhLmxlbmd0aCk7XFxcXG5cXFxcbiAgICBpZiAoZGF0YS5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgIC8v5aSa57q/56iL5Yqg6L29ICAgICAgICBcXFxcbiAgICAgICAgbGV0IHJlYWxQYWdlID0gXFxcXFxcXCJcXFxcXFxcIiA9PSByID8gMSA6IHA7XFxcXG4gICAgICAgIGxldCB0YXNrcyA9IGRhdGEubWFwKGl0ID0+IHtcXFxcbiAgICAgICAgICAgIHJldHVybiB7XFxcXG4gICAgICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocnVsZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcnVsZS5maW5kKHMsIHJlYWxQYWdlKTtcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHBhcmFtOiBpdCxcXFxcbiAgICAgICAgICAgICAgICBpZDogXFxcXFxcXCJydWxlQFxcXFxcXFwiICsgaXQubmFtZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICBiYXRjaEV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gICAgICAgICAgICAgICAgICAgICAgZGVzYzogaXQuZGVzYyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpdC51cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnBpY191cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpdC5waWNfdXJsID8gJ21vdmllXzFfdmVydGljYWxfcGljJyA6IFxcXFxcXFwidGV4dF8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcXFxcXCJfX2FwcFxcXFxcXFwiICsgTVlfUEFHRSArIFxcXFxcXFwiQFxcXFxcXFwiICsgcGFyYW0uaixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxcXG5cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtLmkgPj0gcGFyYW0uYWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGFnZWlkKVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5Yqg6L2956ysXFxcXFxcXCIgKyBNWV9QQUdFICsgXFxcXFxcXCLpobXkuK3vvIzov5vluqbvvJpcXFxcXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFxcXFxcIi9cXFxcXFxcIiArIHBhcmFtLmFsbCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgIHBhcmFtOiB7XFxcXG4gICAgICAgICAgICAgICAgYWxsOiBkYXRhLmxlbmd0aCxcXFxcbiAgICAgICAgICAgICAgICBpOiAwLFxcXFxuICAgICAgICAgICAgICAgIGo6IC0xXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxufVxcXCJ9LHtcXFwiY29sX3R5cGVcXFwiOlxcXCJtb3ZpZV8zXFxcIixcXFwibmFtZVxcXCI6XFxcIuaQnOe0oumhtemdolxcXCIsXFxcInBhdGhcXFwiOlxcXCJzb3VwXFxcIixcXFwicnVsZVxcXCI6XFxcImpzOlxcXFxudmFyIGQgPSBbXTtcXFxcbmlmIChNWV9QQVJBTVMua2V5KSB7XFxcXG4gICAgcHV0TXlWYXIoXFxcXFxcXCJzXFxcXFxcXCIsIE1ZX1BBUkFNUy5rZXkpO1xcXFxufVxcXFxuZXZhbChKU09O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hwb3J0cyA9IHtcXFxcbiAgICBuYW1lOiAnQ0NPRicsXFxcXG4gICAgcGFnZTogdHJ1ZSxcXFxcbiAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxcXG4gICAgICAgIGxldCBkID0gW11cXFxcbiAgICAgICAgY29uc3Qge1xcXFxuICAgICAgICAgICAgYnl0ZXNUb1NpemUsXFxcXG4gICAgICAgICAgICBjb2xvclxcXFxuICAgICAgICB9ID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvdG9vbHMnKTtcXFxcbiAgICAgICAgbGV0IGh0bWwgPSBmZXRjaCgnaHR0cHM6Ly9wYW4uY2NvZi5jYy9hcGkvc2VhcmNoJywge1xcXFxuICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwiY29udGVudC10eXBlXFxcXFxcXCI6ICdhcHBsaWNhdGlvbi9qc29uJyxcXFxcbiAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3Bhbi5jY29mLmNjL3NlYXJjaD9rZXl3b3JkPScgKyBzXFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgYm9keToge1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwicGFnZVNpemVcXFxcXFxcIjogMjAsXFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJwYWdlTnVtXFxcXFxcXCI6IHBhZ2UsXFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJrZXl3b3JkXFxcXFxcXCI6IHMsXFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJmcm9tTW9iaWxlXFxcXFxcXCI6IHRydWVcXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcXFxuICAgICAgICB9KVxcXFxuICAgICAgICBsZXQgbGlzdCA9IEpTT04ucGFyc2UoaHRtbClcXFxcbiAgICAgICAgICAgIC5kYXRhLnJvd3NcXFxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaXN0Lmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICBsZXQgaXQgPSBsaXN0W2ldXFxcXG4gICAgICAgICAgICBsZXQgdGl0bGUgPSBpdC5maWxlTmFtZVxcXFxuICAgICAgICAgICAgbGV0IG11cmwgPSBpdC51cmxcXFxcbiAgICAgICAgICAgIGxldCB0eXBlID0gaXQudHlwZS5yZXBsYWNlKC9mb2xkZXIvLCAn5paH5Lu25aS5JykucmVwbGFjZSgvZmlsZS8sICfmlofku7YnKVxcXFxuICAgICAgICAgICAgaWYgKHRpdGxlLmluY2x1ZGVzKHMpKSB7XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+Q0NPRjwvZm9udD4mbmJzcDsnICsgJ+aWh+S7tuexu+Wei++8micgKyB0eXBlICsgJ++8jOaWh+S7tuWkp+Wwj++8micgKyBieXRlc1RvU2l6ZShpdC5zaXplKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgbXVybCArICc/P2Z5cGFnZSdcXFxcbiAgICAgICAgICAgICAgICAgICAgLy91cmw6ICdoaWtlcjovL3BhZ2UvcHVzaD91cmw9aGlrZXI6Ly9lbXB0eSMjJyArIGVuY29kZVVSSUNvbXBvbmVudChtdXJsKSArICc/Pz9meXBhZ2UnXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogd3JhcHUobXVybClcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiBkXFxcXG4gICAgfVxcXFxufVxc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cXG4gICAgICAgIGlmIChjbXAgPT09IDApIHtcXFxcbiAgICAgICAgICAgIGxldCByZWdleCA9IC9bYS16QS1aMC05XS9cXFxcbiAgICAgICAgICAgIGxldCBzMSA9IFN0cmluZyhzcGxpdDFbaV0pXFxcXG4gICAgICAgICAgICBsZXQgczIgPSBTdHJpbmcoc3BsaXQyW2ldKVxcXFxuICAgICAgICAgICAgaWYgKHJlZ2V4LnRlc3QoczEpIHx8IHJlZ2V4LnRlc3QoczIpKSB7XFxcXG4gICAgICAgICAgICAgICAgY21wID0gbmV3IGphdmEubGFuZy5TdHJpbmcoc3BsaXQxW2ldKS5jb21wYXJlVG8obmV3IGphdmEubGFuZy5TdHJpbmcoc3BsaXQyW2ldKSk7XFxcXG4gICAgICAgICAgICAgICAgLy8gY21wID0gczEubG9jYWxlQ29tcGFyZShzMiwgJ2VuJylcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgY21wID0gczEubG9jYWxlQ29tcGFyZShzMiwgJ3poJylcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgIGlmIChjbXAgIT09IDApIHtcXFxcbiAgICAgICAgICAgIHJldHVybiBjbXA7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9XFxcXG4gICAgbGV0IGxlbmd0aENtcCA9IHNwbGl0MS5sZW5ndGggLSBzcGxpdDIubGVuZ3RoO1xcXFxuICAgIC8vIGlmIChsZW5ndGhDbXAgIT09IDApIGxlbmd0aENtcCA9IGxlbmd0aENtcCA+IDAgPyAtMSA6IDE7XFxcXG4gICAgcmV0dXJuIGxlbmd0aENtcDtcXFxcbn1cXFxcblxcXFxuJC5leHBvcnRzLnNvcnRzID0gZnVuY3Rpb24obGlzdCwgc29ydCkge1xcXFxuICAgIGlmIChzb3J0ID09PSBcXFxcXFxcIuexu+Wei1xcXFxcXFwiKSB7XFxcXG4gICAgICAgIC8vIGxvZyhcXFxcXFxcIuexu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luLCBtb2RlKSA9PiB7XFxcXG4gICAgICAgIGxldCBob3N0ID0gb3JpZ2luLnJlcGxhY2UobmV3IFJlZ0V4cChcXFxcXFxcImh0dHA6Ly98aHR0cHM6Ly9cXFxcXFxcIiksIFxcXFxcXFwiXFxcXFxcXCIpLnNwbGl0KFxcXFxcXFwiL1xcXFxcXFwiKVswXTtcXFxcbiAgICAgICAgbGV0IGhvc3RzID0gaG9zdC5zcGxpdChcXFxcXFxcIi5cXFxcXFxcIik7XFxcXG4gICAgICAgIGlmIChob3N0cy5sZW5ndGggPiAyKSB7XFxcXG4gICAgICAgICAgICBob3N0ID0gaG9zdHNbaG9zdHMubGVuZ3RoIC0gMl0gKyBcXFxcXFxcIi5cXFxcXFxcIiArIGhvc3RzW2hvc3RzLmxlbmd0aCAtIDFdO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGlmIChpbnB1dC5zdGFydHNXaXRoKFxcXFxcXFwibWFnbmV0XFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICBjb25maXJtKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLmuKnppqjmj5DnpLpcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBcXFxcXFxcIuajgOa1i+WIsOaWsOeahOejgemTvuWcsOWdgO+8jOeCueWHu+ehruWumuaMiemSruWNs+WPr+aSreaUvu+8jOeCueWHu+WPlua2iOaMiemSruWPr+S7peWkjeWItumTvuaOpVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKG1hZykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWFnO1xcXFxuICAgICAgICAgICAgICAgIH0sIGlucHV0KSxcXFxcbiAgICAgICAgICAgICAgICBjYW5jZWw6ICQudG9TdHJpbmcoKG1hZykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJjb3B5Oi8v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AgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgaWYgKHJlc2NvZC5pbmNsdWRlcyhcXFxcXFxcIlBhcmFtRmxvd0V4Y2VwdGlvblxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gLy/lj5bmlofku7blpLlcXFxcbiAgICAgICAgLy9sb2cocmVzY29kKTtcXFxcblxcXFxuXFxcXG4gICAgICAgIGlmIChKU09OLnBhcnNlKHJlc2NvZCkubmV4dF9tYXJrZXIpIHtcXFxcbiAgICAgICAgICAgIGxldCBtYXJrZXIgPSBKU09OLnBhcnNlKHJlc2NvZCkubmV4dF9tYXJrZXI7XFxcXG4gICAgICAgICAgICBpZiAobWFya2VyLmxlbmd0aCA+IDEwKSB7XFxcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ25leHRwYWdlJywgbWFya2VyKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignbmV4dHBhZ2UnKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICB2YXIgY29udHMgPSBKU09OLnBhcnNlKHJlc2NvZCkuaXRlbXM7XFxcXG4gICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+ivpeaWh+S7tuWkueS4i+ayoeacieWIhuS6q+eahOaWh+S7ticsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgdmFyIGRvbmd0YWkgPSBKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvbGF6eXVybCcsIHt9KSkucnVsZS50b1N0cmluZygpO1xcXFxuXFxcXG4gICAgICAgIHZhciB0dWlzb25nID0gW107XFxcXG4gICAgICAgIHZhciB6aW11ID0gW107XFxcXG4gICAgICAgIGZvciAobGV0IGkgaW4gY29udHMpIHtcXFxcbiAgICAgICAgICAgIC8vdmFyIGxpc3R5cCA9IGNvbnRzW2ldLnR5cGU7XFxcXG4gICAgICAgICAgICBpZiAoY29udHNbaV0udHlwZSAhPSAnZm9sZGVyJykge1xcXFxuICAgICAgICAgICAgICAgIGxldCBmbmFtZSA9IGNvbnRzW2ldLm5hbWU7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGZ0eXBlID0gZm5hbWUudG9Mb3dlckNhc2UoKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgY2F0ZSA9IGNvbnRzW2ldLmNhdGVnb3J5O1xcXFxuICAgICAgICAgICAgICAgIGlmIChmdHlwZS5lbmRzV2l0aCgnLnNydCcpIHx8IGZ0eXBlLmVuZHNXaXRoKCcudnR0JykgfHwgZnR5cGUuZW5kc1dpdGgoJy5hc3MnKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB6aW11LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0OiBmbmFtZS5zdWJzdHJpbmcoMCwgZm5hbWUubGFzdEluZGV4T2YoXFxcXFxcXCIuXFxcXFxcXCIpKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dDogY29udHNbaV0uZmlsZV9leHRlbnNpb24sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWQ6IGNvbnRzW2ldLmZpbGVfaWRcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nIHx8IGNhdGUgPT0gJ2F1ZGlvJykge1xcXFxuICAgICAgICAgICAgICAgICAgICB0dWlzb25nLnB1c2goXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmbmFtZS5yZXBsYWNlKC9cXFxcXFxcXCMvZywgJ18nKS5yZXBsYWNlKC9cXFxcXFxcXCQvZywgJ18nKSArICckJyArIGNhdGUgKyAnfCcgKyBjb250c1tpXS5maWxlX2lkXFxcXG4gICAgICAgICAgICAgICAgICAgICk7XFxcXG4gICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgIGZvciAodmFyIGkgaW4gY29udHMpIHtcXFxcbiAgICAgICAgICAgIHZhciBsaXN0eXAgPSBjb250c1tpXS50eXBlO1xcXFxuICAgICAgICAgICAgaWYgKGxpc3R5cCAhPSAnZm9sZGVyJykge1xcXFxuICAgICAgICAgICAgICAgIHZhciBjYXRlID0gY29udHNbaV0uY2F0ZWdvcnk7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGZuYW1lID0gY29udHNbaV0ubmFtZTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5O6JyArIGNvbnRzW2ldLm5hbWU7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdkb2MnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5OWJyArIGNvbnRzW2ldLm5hbWU7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdpbWFnZScpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/CflrwnICsgY29udHNbaV0ubmFtZTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ3ppcCcpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk6YnICsgY29udHNbaV0ubmFtZTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBjb250c1tpXS5uYW1lXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgLy8gaWYgKGNhdGUgPT0gJ3ZpZGVvJyB8fCBjYXRlID09ICdhdWRpbycgfHwgY2F0ZSA9PSAnaW1hZ2UnKSB7XFxcXG4gICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKGNvbnRzW2ldLmZpbGVfaWQpLmxhenlSdWxlKChzaGFyZUlkLCBkb25ndGFpLCBjYXRlLCBmbmFtZSwgcmVmdG9rZW4sIHppbXUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKCdzaW5nbGVwdXNoJywgJycpID09ICcxJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/cnVsZT1YWVHmjqjpgIEmcHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJuYW1lXFxcXFxcXCI6IGZuYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInJlZnJlc2hfdG9rZW5cXFxcXFxcIjogcmVmdG9rZW4sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidXJsXFxcXFxcXCI6IGZuYW1lLnJlcGxhY2UoL1xcXFxcXFxcIy9nLCAnXycpLnJlcGxhY2UoL1xcXFxcXFxcJC9nLCAnXycpICsgJyQnICsgY2F0ZSArICd8JyArIGlucHV0LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInNoYXJlX2lkXFxcXFxcXCI6IHNoYXJlSWRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZG9uZ3RhaSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgc2hhcmVJZCwgZG9uZ3RhaSwgY2F0ZSwgZm5hbWUsIHJlZnRva2VuLCB6aW11KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZm9ybWF0RGF0ZShjb250c1tpXS51cGRhdGVkX2F0KSArICcgICcgKyBmb3JtYXRTaXplKGNvbnRzW2ldLnNpemUpLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5o6o6YCB5YiwVFZCb3gnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaGFyZUlkLCBmaWxlaWQsIGNhdGUsIGZuYW1lLCByZWZ0b2tlbikgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIm5hbWVcXFxcXFxcIjogZm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInJlZnJlc2hfdG9rZW5cXFxcXFxcIjogcmVmdG9rZW4sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInVybFxcXFxcXFwiOiBmbmFtZS5yZXBsYWNlKC9cXFxcXFxcXCMvZywgJ18nKS5yZXBsYWNlKC9cXFxcXFxcXCQvZywgJ18nKSArICckJyArIGNhdGUgKyAnfCcgKyBmaWxlaWQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInNoYXJlX2lkXFxcXFxcXCI6IHNoYXJlSWRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNoYXJlSWQsIGNvbnRzW2ldLmZpbGVfaWQsIGNhdGUsIGZuYW1lLCByZWZ0b2tlbilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1dLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGNvbnRzW2ldLmZpbGVfaWRcXFxcbiAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnXFxcXG5cXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgIC8qfSBlbHNlIGlmIChpID09IDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+W9k+WJjeaWh+S7tuWkueS4i+ayoeaciemfs+inhumikeaWh+S7ticsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSovXFxcXG5cXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn8J+TgicgKyBjb250c1tpXS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHknICsgY29udHNbaV0uZmlsZV9pZCArICc/Pz9meXBhZ2UnKS5ydWxlKChzaGFyZUlkLCBzaGFyZXRva2VuLCBwdXNobmFtZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvcnVsZWxvb3AnLCB7fSkpLnJ1bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9LCBzaGFyZUlkLCBzaGFyZXRva2VuLCBjb250c1tpXS5uYW1lKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgfSAvL2VuZCBpZlxcXFxuICAgICAgICB9IC8vZW5kIGZvciBpXFxcXG4gICAgICAgIC8vbG9nKHR1aXNvbmcpO1xcXFxuICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9wdXNoY29kZScsIHt9KSkucnVsZSk7XFxcXG5cXFxcbiAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgIC8qXFxcXG4gICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6ICfmrKfmrKfvvIzmiqXplJnkuobjgIInLFxcXFxuICAgICAgICAgICAgdXJsOiBkZWNvZGVVUklDb21wb25lbnQo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5zaW9uLFxcXFxuICAgICAgICAgICAgICAgICAgICBmaWQ6IGNvbnRzW2ldLmZpbGVfaWRcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nIHx8IGNhdGUgPT0gJ2F1ZGlvJykge1xcXFxuICAgICAgICAgICAgICAgIHR1aXNvbmcucHVzaChcXFxcbiAgICAgICAgICAgICAgICAgICAgZm5hbWUucmVwbGFjZSgvXFxcXFxcXFwjL2csICdfJykucmVwbGFjZSgvXFxcXFxcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgY29udHNbaV0uZmlsZV9pZFxcXFxuICAgICAgICAgICAgICAgICk7XFxcXG4gICAgICAgICAgICB9O1xcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIFxcXFxuICAgIGZvciAodmFyIGkgaW4gY29udHMpIHtcXFxcbiAgICAgICAgdmFyIGxpc3R5cCA9IGNvbnRzW2ldLnR5cGU7XFxcXG4gICAgICAgIGlmIChsaXN0eXAgIT0gJ2ZvbGRlcicpIHtcXFxcbiAgICAgICAgICAgIHZhciBjYXRlID0gY29udHNbaV0uY2F0ZWdvcnk7XFxcXG4gICAgICAgICAgICB2YXIgZm5hbWUgPSBjb250c1tpXS5uYW1lO1xcXFxuICAgICAgICAgICAgaWYgKGNhdGUgPT0gJ3ZpZGVvJykge1xcXFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5O6JyArIGNvbnRzW2ldLm5hbWU7XFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ2RvYycpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TlicgKyBjb250c1tpXS5uYW1lO1xcXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdpbWFnZScpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+WvCcgKyBjb250c1tpXS5uYW1lO1xcXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICd6aXAnKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk6YnICsgY29udHNbaV0ubmFtZTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gY29udHNbaV0ubmFtZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgLy9pZiAoY2F0ZSA9PSAndmlkZW8nIHx8IGNhdGUgPT0gJ2F1ZGlvJyB8fCBjYXRlID09ICdpbWFnZScpIHtcXFxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoY29udHNbaV0uZmlsZV9pZCkubGF6eVJ1bGUoKHNoYXJlSWQsIGRvbmd0YWksIGNhdGUsIGZuYW1lLCByZWZ0b2tlbix6aW11KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKCdzaW5nbGVwdXNoJywgJycpID09ICcxJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD9ydWxlPVhZUeaOqOmAgSZwdXNodXJsPScgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibmFtZVxcXFxcXFwiOiBmbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInJlZnJlc2hfdG9rZW5cXFxcXFxcIjogcmVmdG9rZW4sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ1cmxcXFxcXFxcIjogZm5hbWUucmVwbGFjZSgvXFxcXFxcXFwjL2csICdfJykucmVwbGFjZSgvXFxcXFxcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgaW5wdXQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJzaGFyZV9pZFxcXFxcXFwiOiBzaGFyZUlkXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGRvbmd0YWkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXlcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sIHNoYXJlSWQsIGRvbmd0YWksIGNhdGUsIGZuYW1lLCByZWZ0b2tlbix6aW11KSxcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBmb3JtYXREYXRlKGNvbnRzW2ldLnVwZGF0ZWRfYXQpICsgJyAgJyArIGZvcm1hdFNpemUoY29udHNbaV0uc2l6ZSksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmjqjpgIHliLBUVkJveCcsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2hhcmVJZCwgZmlsZWlkLCBjYXRlLCBmbmFtZSwgcmVmdG9rZW4pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3J1bGU9WFlR5o6o6YCBJnB1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibmFtZVxcXFxcXFwiOiBmbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZWZyZXNoX3Rva2VuXFxcXFxcXCI6IHJlZnRva2VuLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInVybFxcXFxcXFwiOiBmbmFtZS5yZXBsYWNlKC9cXFxcXFxcXCMvZywgJ18nKS5yZXBsYWNlKC9cXFxcXFxcXCQvZywgJ18nKSArICckJyArIGNhdGUgKyAnfCcgKyBmaWxlaWQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwic2hhcmVfaWRcXFxcXFxcIjogc2hhcmVJZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNoYXJlSWQsIGNvbnRzW2ldLmZpbGVfaWQsIGNhdGUsIGZuYW1lLCByZWZ0b2tlbilcXFxcbiAgICAgICAgICAgICAgICAgICAgfV0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBjb250c1tpXS5maWxlX2lkXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMSdcXFxcblxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAvL31cXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn8J+TgicgKyBjb250c1tpXS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eScgKyBjb250c1tpXS5maWxlX2lkICsgJz8/P2Z5cGFnZScpLnJ1bGUoKHNoYXJlSWQsIHNoYXJldG9rZW4sIHB1c2huYW1lKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI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AgICAgbGV0IG5vd3RpbWUgPSBEYXRlLm5vdygpO1xcXFxuICAgICAgICBsZXQgb2xkdGltZSA9IHBhcnNlSW50KGdldE15VmFyKCd1c2VyaW5mb0NoZWNrdGltZScsICcwJykucmVwbGFjZSgndGltZScsICcnKSk7XFxcXG4gICAgICAgIGxldCB1c2VyaW5mbztcXFxcbiAgICAgICAgbGV0IGFsaXVzZXJpbmZvID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ2FsaXVzZXJpbmZvJyk7XFxcXG4gICAgICAgIGlmIChhbGl1c2VyaW5mbyAmJiBhbGl1c2VyaW5mby51c2VyX2lkICYmIG5vd3RpbWUgPCAob2xkdGltZSArIDEgKiA2MCAqIDYwICogMTAwMCkpIHtcXFxcbiAgICAgICAgICAgIHVzZXJpbmZvID0gYWxpdXNlcmluZm87XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICB1c2VyaW5mbyA9IEpTT04ucGFyc2UocmVxdWVzdCgnaHR0cHM6Ly9hdXRoLmFsaXl1bmRyaXZlLmNvbS92Mi9hY2NvdW50L3Rva2VuJywge1xcXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInJlZnJlc2hfdG9rZW5cXFxcXFxcIjogYWxpdG9rZW4sXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiZ3JhbnRfdHlwZVxcXFxcXFwiOiBcXFxcXFxcInJlZnJlc2hfdG9rZW5cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCcsXFxcXG4gICAgICAgICAgICAgICAgdGltZW91dDogMzAwMFxcXFxuICAgICAgICAgICAgfSkpO1xcXFxuICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2FsaXVzZXJpbmZvJywgdXN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gICAgICAgIGxldCB1ID0gc3RhcnRQcm94eVNlcnZlcigkLnRvU3RyaW5nKChhbGlTaGFyZVBsYXlVcmwsIGZpbGVfaWQsIHNoYXJlX2lkLCBhbGl0b2tlbikgPT4ge1xcXFxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0dXJsKGZpbGVpZCwgbGluZSkge1xcXFxuICAgICAgICAgICAgICAgIC8v6aKE5Yqg6L295pe25Lya5Y+YZmlsZV9pZCzmiYDku6V0c+i/h+acn+abtOaWsOaXtui/mOWPluWOn+adpeeahGlkXFxcXG4gICAgICAgICAgICAgICAgbGV0IHBsYXlVcmxMaXN0ID0gYWxpU2hhcmVQbGF5VXJsKHNoYXJlX2lkLCBmaWxlaWQsIGFsaXRva2VuKSB8fCBbXTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgYWxpdXJsO1xcXFxuICAgICAgICAgICAgICAgIHBsYXlVcmxMaXN0LmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0udGVtcGxhdGVfaWQgPT0gbGluZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYWxpdXJsID0gaXRlbS51cmw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvKmFsaXVybCA9IEpTT04ucGFyc2UocmVxdWVzdChpdGVtLnVybCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiAzMDAwXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTsqL1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAvL+S4iumdouaYr+iOt+WPlumYv+mHjOeahOaSreaUvuWcsOWdgFxcXFxuICAgICAgICAgICAgICAgIC8vbG9nKFxcXFxcXFwi5oiR5Zyo5Luj55CGXFxcXFxcXCIgKyBhbGl1cmwpO1xcXFxuICAgICAgICAgICAgICAgIGxldCBob21lID0gYWxpdXJsLnNwbGl0KCdtZWRpYS5tM3U4JylbMF07XFxcXG4gICAgICAgICAgICAgICAgbGV0IGYgPSBmZXRjaChhbGl1cmwsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDMwMDBcXFxcbiAgICAgICAgICAgICAgICB9KS5zcGxpdChcXFxcXFxcIlxcXFxcXFxcblxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgZmYgPSBmLm1hcChpdCA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpdC5zdGFydHNXaXRoKFxcXFxcXFwibWVkaWEtXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCIvcHJveHk/dXJsPVxcXFxcXFwiICsgYmFzZTY0RW5j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cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwuc3Vic3RyKHVybC5pbmRleE9mKCcvbWVkaWEtJyksIHVybC5pbmRleE9mKCcudHMnKSkgPT0gZnVybC5zdWJzdHIoZnVybC5pbmRleE9mKCcvbWVkaWEtJyksIGZ1cmwuaW5kZXhPZignLnRzJykpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gZnVybDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgbGV0IGV4cGlyZXMgPSB1cmwuc3BsaXQoJ3gtb3NzLWV4cGlyZXM9JylbMV0uc3BsaXQoJyYnKVswXTtcXFxcbiAgICAgICAgICAgICAgICBjb25zdCBsYXN0dGltZSA9IHBhcnNlSW50KGV4cGlyZXMpIC0gRGF0ZS5ub3coKSAvIDEwMDA7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGxhc3R0aW1lIDwgNjApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coJ+i/h+acn+abtOaWsCcpXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsaW5lID0gdXJsLnNwbGl0KCcvbWVkaWEnKVswXTsgLy/lj5bkuYvliY3mkq3mlL7nmoR0c+autee6v+i3r1xcXFxuICAgICAgICAgICAgICAgICAgICBsaW5lID0gbGluZS5zdWJzdHJpbmcobGluZS5sYXN0SW5kZXhPZignLycpICsgMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmID0gZ2V0dXJsKGZpZCwgbGluZSkuc3BsaXQoXFxcXFxcXCJcXFxcXFxcXG5cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGYuZm9yRWFjaChpdCA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXQgJiYgaXQuc3RhcnRzV2l0aCgnL3Byb3h5P3VybD0nKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmdXJsID0gYmFzZTY0RGVjb2RlKGl0LnJlcGxhY2UoJy9wcm94eT91cmw9JywgJycpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLnN1YnN0cih1cmwuaW5kZXhPZignL21lZGlhLScpLCB1cmwuaW5kZXhPZignLnRzJykpID09IGZ1cmwuc3Vic3RyKGZ1cmwuaW5kZXhPZignL21lZGlhLScpLCBmdXJsLmluZGV4T2YoJy50cycpKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBmdXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcblxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKCfmnKrov4fmnJ8nKVxcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhcXFxcXFxcIuS7o+eQhnRz77yaXFxcXFxcXCIgKyB1cmwpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICBzdGF0dXNDb2RlOiAzMDIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiTG9jYXRpb25cXFxcXFxcIjogdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IFBDX1VBLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAvL2xvZygn6aaW5qyh5pu05pawJylcXFxcbiAgICAgICAgICAgICAgICBsZXQgbGluZSA9IHVybC5zcGxpdCgnfCcpWzFdO1xcXFxuICAgICAgICAgICAgICAgIGxldCBmZiA9IGdldHVybChmaWxlX2lkLCBsaW5lKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gZmY7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0sIGFsaVNoYXJlUGxheVVybCwgZmlsZV9pZCwgc2hhcmVfaWQsIGFsaXRva2VuKSk7XFxcXG5cXFxcbiAgICAgICAgbGV0IHBsYXlVcmxMaXN0ID0gYWxpU2hhcmVQbGF5VXJsKHNoYXJlX2lkLCBmaWxlX2lkLCBhbGl0b2tlbikgfHwgW107XFxcXG5cXFxcbiAgICAgICAgaWYgKHBsYXlVcmxMaXN0Lmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgIHBsYXlVcmxMaXN0LmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICB1cmxzLnB1c2godSArIFxcXFxcXFwiP3VybD1cXFxcXFxcIiArIGJhc2U2NEVuY29kZShpdGVtLnVybCArIFxcXFxcXFwifFxcXFxcXFwiICsgaXRlbS50ZW1wbGF0ZV9pZCkgKyBcXFxcXFxcIiMubTN1OFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBuYW1lcy5wdXNoKHRyYW5zY29kaW5nW2l0ZW0udGVtcGxhdGVfaWRdID8gdHJhbnNjb2RpbmdbaXRlbS50ZW1wbGF0ZV9pZF0gOiBpdGVtLnRlbXBsYXRlX2hlaWdodCk7XFxcXG4gICAgICAgICAgICAgICAgaGVhZHMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxcXG4gICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgdmFyIG11bHQgPSB7XFxcXG4gICAgICAgICAgICAgICAgdXJsczogdXJscyxcXFxcbiAgICAgICAgICAgICAgICBuYW1lczogbmFtZXMsXFxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZHMsXFxcXG4gICAgICAgICAgICAgICAgZGFubXU6Z2V0VmFyKCdkbV9zaGFyZScsJycpXFxcXG4gICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgaWYgKHppbXUubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gemltdSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgemltdXQgPSB6aW11W2ldLnRpdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZuYW1lLmluY2x1ZGVzKHppbXV0KSB8fCB6aW11dC5pbmNsdWRlcyhmbmFtZS5zdWJzdHJpbmcoMCwgZm5hbWUubGFzdEluZGV4T2YoJy4nKSkpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdWx0WydzdWJ0aXRsZSddID0gZ2V0c3ViKHppbXVbaV0uZmlkLCB6aW11W2ldLmV4dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgcmV0dXJuIG11bHQ7XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBsb2coJ+acquiOt+WPlumYv+mHjOaSreaUvuWcsOWdgO+8jOW7uuiurumHjei/m+i9r+S7tuWGjeivleS4gOasoScpXFxcXG4gICAgICAgICAgICByZXR1cm4ge307XFxcXG4gICAgICAgIH1cXFxcbiAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgIGxvZygn6I635Y+W5YWx5Lqr6ZO+5o6l5pKt5pS+5Zyw5Z2A5aSx6LSlPicgKyBlLm1lc3NhZ2UpO1xcXFxuICAgICAgICByZXR1cm4ge307XFxcXG4gICAgfVxcXFxufVxcXFxuXFxcXG5pZiAoY2F0ZSA9PSAndmlkZW8nKSB7XFxcXG4gICAgLy9sb2cocmVhY2Nlc3NUayk7IFxcXFxuICAgIGlmIChnZXRJdGVtKCdxdWFsaXR5JywgJycpID09ICcxJykge1xcXFxuICAgICAgICAvL+WOn+eUu1xcXFxuICAgICAgICAvL2FjY2Vzc1RrKCk7XFxcXG5cXFxcbiAgICAgICAgZnVuY3Rpb24gb2F1dGhSZWRpcmVjdChjb2RlKSB7XFxcXG4gICAgICAgICAgICAvL2xvZyhjb2RlKTtcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdvcmVkJywgJzEnKSAhPSAnMCcpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSBmZXRjaCgnaHR0cHM6Ly9hcGkueGhvZmUudG9wL2FsaXN0L2FsaV9vcGVuL2NvZGUnLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJ1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiY29kZVxcXFxcXFwiOiBjb2RlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiZ3JhbnRfdHlwZVxcXFxcXFwiOiBcXFxcXFxcImF1dGhvcml6YXRpb25fY29kZVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChqc29uID09IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSBmZXRjaCgnaHR0cHM6Ly9hcGktY2Yubm4uY2kvYWxpc3QvYWxpX29wZW4vY29kZScsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS8nXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJjb2RlXFxcXFxcXCI6IGNvZGUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiZ3JhbnRfdHlwZVxcXFxcXFwiOiBcXFxcXFxcImF1dGhvcml6YXRpb25fY29kZVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfojrflj5ZSZWZyZXNoVG9rZW5PcGVuJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChqc29uLmluY2x1ZGVzKCdUb28gTWFueSBSZXF1ZXN0cycpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignb3JlZCcsICcwJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn6K+35rGC5aSq6aKR57mB77yM6KKr5bCB6ZmQ5Yi25LqGJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZygn6K+35rGC5aSq6aKR57mB77yM6KKr5bCBSVDkuoYnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnJztcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdvcmVkJywgJzEnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChKU09OLnBhcnNlKGpzb24pLnJlZnJlc2hfdG9rZW4pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ2V0UmVmcmVzaFRva2VuT3BlbiA9IEpTT04ucGFyc2UoanNvbikucmVmcmVzaF90b2tlbjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcGVuVG9rZW4uUmVmcmVzaFRva2VuT3BlbiA9IGdldFJlZnJlc2hUb2tlbk9wZW47XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGdldEFjY2Vzc1Rva2VuT3BlbiA9IEpTT04ucGFyc2UoanNvbikudG9rZW5fdHlwZSArICcgJyArIEpTT04ucGFyc2UoanNvbikuYWNjZXNzX3Rva2VuO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9wZW5Ub2tlbi5BY2Nlc3NUb2tlbk9wZW4gPSBnZXRBY2Nlc3NUb2tlbk9wZW47XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9pY3kvaWN5LWFsaS1PcGVuVG9rZW4uanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShPcGVuVG9rZW4pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncmVkaXJlY3QnLCAnMScpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAgICAgfTtcXFxcblxcXFxuICAgICAgICBmdW5jdGlvbiBvYXV0aFJlcXVlc3QoKSB7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGxldCBqc29uID0gZmV0Y2goJ2h0dHBzOi8vb3Blbi5hbGl5dW5kcml2ZS5jb20vb2F1dGgvdXNlcnMvYXV0aG9yaXplP2NsaWVudF9pZD0nICsgJzc2OTE3Y2NjY2Q0NDQxYzM5NDU3YTA0ZjYwODRmYjJmJyArICcmcmVkaXJlY3RfdXJpPWh0dHBzOi8vYWxpc3Qubm4uY2kvdG9vbC9hbGl5dW5kcml2ZS9jYWxsYmFjayZzY29wZT11c2VyOmJhc2UsZmlsZTphbGw6cmVhZCxmaWxlOmFsbDp3cml0ZSZzdGF0ZT0nLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRob3JpemF0aW9uJzogcmVhY2Nlc3NUaywgLy9nZXRBY2Nlc3NUb2tlblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3gtY2FuYXJ5JzogJ2NsaWVudD13ZWIsYXBwPXNoYXJlLHZlcnNpb249djIuMy4xJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4LXNoYXJlLXRva2VuJzogc2hhcmV0b2tlblxcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiYXV0aG9yaXplXFxcXFxcXCI6IDEsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInNjb3BlXFxcXFxcXCI6IFxcXFxcXFwidXNlcjpiYXNlLGZpbGU6YWxsOnJlYWQsZmlsZTphbGw6d3JpdGVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKCdvYXV0aHJlcVxcXFxcXFxcbicgKyBqc29uKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgY29kZSA9IEpTT04ucGFyc2UoanNvbikucmVkaXJlY3RVcmkuc3BsaXQoXFxcXFxcXCJjb2RlPVxcXFxcXFwiKVsxXTtcXFxcbiAgICAgICAgICAgICAgICAvL2xvZyhjb2RlKTtcXFxcbiAgICAgICAgICAgICAgICBvYXV0aFJlZGlyZWN0KGNvZGUpO1xcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIHJlYWNjZXNzVGsgPSAnJztcXFxcbiAgICAgICAgICAgICAgICBhY2Nlc3NUaygpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9O1xcXFxuXFxcXG4gICAgICAgIGZ1bmN0aW9uIHJlZnJlc2hPcGVuVG9rZW4oKSB7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcigncm90JywgJzEnKSAhPSAnMCcpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSBmZXRjaCgnaHR0cHM6Ly9hcGkueGhvZmUudG9wL2FsaXN0L2FsaV9vcGVuL3Rva2VuJywge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYW50X3R5cGUnOiAncmVmcmVzaF90b2tlbicsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZnJlc2hfdG9rZW4nOiBPcGVuVG9rZW4uUmVmcmVzaFRva2VuT3BlblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoanNvbiA9PSBcXFxcXFxcIlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gZmV0Y2goJ2h0dHBzOi8vYXBpLWNmLm5uLmNpL2FsaXN0L2FsaV9vcGVuL2NvZGUnLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnZ3JhbnRfdHlwZSc6ICdyZWZyZXNoX3Rva2VuJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZnJlc2hfdG9rZW4nOiBPcGVuVG9rZW4uUmVmcmVzaFRva2VuT3BlblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZygn6I635Y+WQWNjZXNzVG9rZW5PcGVuJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChqc29uLmluY2x1ZGVzKCdUb28gTWFueSBSZXF1ZXN0cycpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncm90JywgJzAnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCfor7fmsYLlpKrpopHnuYHvvIzooqvlsIHpmZDliLbkuoYnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKCfor7fmsYLlpKrpopHnuYHvvIzooqvlsIFJUOS6hicpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICcnO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3JvdCcsICcxJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoSlNPTi5wYXJzZShqc29uKS5yZWZyZXNoX3Rva2VuKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGdldFJlZnJlc2hUb2tlbk9wZW4gPSBKU09OLnBhcnNlKGpzb24pLnJlZnJlc2hfdG9rZW47XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgT3BlblRva2VuLlJlZnJlc2hUb2tlbk9wZW4gPSBnZXRSZWZyZXNoVG9rZW5PcGVuO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZXRBY2Nlc3NUb2tlbk9wZW4gPSBKU09OLnBhcnNlKGpzb24pLnRva2VuX3R5cGUgKyAnICcgKyBKU09OLnBhcnNlKGpzb24pLmFjY2Vzc190b2tlbjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcGVuVG9rZW4uQWNjZXNzVG9rZW5PcGVuID0gZ2V0QWNjZXNzVG9rZW5PcGVuO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFxcXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvaWN5L2ljeS1hbGktT3BlblRva2VuLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkoT3BlblRva2VuKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICB9O1xcXFxuXFxcXG4gICAgICAgIGZ1bmN0aW9uIGNvcHkoZmlsZUlkKSB7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGxldCBqc29uID0gZmV0Y2goJ2h0dHBzOi8vYXBpLmFsaXl1bmRyaXZlLmNvbS9hZHJpdmUvdjIvYmF0Y2gnLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRob3JpemF0aW9uJzogcmVhY2Nlc3NUayxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZ2V0QWNjZXNzVG9rZW5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4LWNhbmFyeSc6ICdjbGllbnQ9d2ViLGFwcD1zaGFyZSx2ZXJzaW9uPXYyLjMuMScsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAneC1zaGFyZS10b2tlbic6IHNoYXJldG9rZW5cXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInJlcXVlc3RzXFxcXFxcXCI6IFt7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJib2R5XFxcXFxcXCI6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJmaWxlX2lkXFxcXFxcXCI6IGZpbGVJZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJzaGFyZV9pZFxcXFxcXFwiOiBzaGFyZUlkLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImF1dG9fcmVuYW1lXFxcXFxcXCI6IHRydWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidG9fcGFyZW50X2ZpbGVfaWRcXFxcXFxcIjogXFxcXFxcXCJyb290XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwidG9fZHJpdmVfaWRcXFxcXFxcIjogZGVmZHJpdmVpZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJoZWFkZXJzXFxcXFxcXCI6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJDb250ZW50LVR5cGVcXFxcXFxcIjogXFxcXFxcXCJhcHBsaWNhdGlvbi9qc29uXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiaWRcXFxcXFxcIjogXFxcXFxcXCIwXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJtZXRob2RcXFxcXFxcIjogXFxcXFxcXCJQT1NUXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ1cmxcXFxcXFxcIjogXFxcXFxcXCIvZmlsZS9jb3B5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1dLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZXNvdXJjZVxcXFxcXFwiOiBcXFxcXFxcImZpbGVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKCdjb3B5XFxcXFxcXFxuJyArIGpzb24pO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGpzb24pLnJlc3BvbnNlc1swXS5ib2R5LmZpbGVfaWQ7XFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH07XFxcXG5cXFxcbiAgICAgICAgZnVuY3Rpb24gb3BlbihmaWxlSWQpIHtcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGpzb24gPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIGxldCBudW1iZXIgPSAwO1xcXFxuICAgICAgICAgICAgICAgIGRvIHtcXFxcbiAgICAgICAgICAgICAgICAgICAganNvbiA9IGZldGNoKCdodHRwczovL29wZW4uYWxpeXVuZHJpdmUuY29tL2Fkcml2ZS92MS4wL29wZW5GaWxlL2dldERvd25sb2FkVXJsJywge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLycsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGhvcml6YXRpb24nOiBPcGVuVG9rZW4uQWNjZXNzVG9rZW5PcGVuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9nZXRBY2Nlc3NUb2tlbk9wZW5cXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnZmlsZV9pZCc6IGZpbGVJZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnZHJpdmVfaWQnOiBkZWZkcml2ZWlkXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKCdvcGVuXFxcXFxcXFxuJyArIGpzb24pO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoanNvbi5pbmNsdWRlcygnXFxcXFxcXCJ1cmxcXFxcXFxcIjpcXFxcXFxcImh0dHAnKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGpzb24uaW5jbHVkZXMoXFxcXFxcXCJUb29NYW55UmVxdWVzdHNcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZGVsZXRlZShmaWxlSWQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoJ1RvbyBNYW55IFJlcXVlc3RzJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdyZWRpcmVjdCcsICcwJykgPT0gJzAnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvYXV0aFJlcXVlc3QoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hPcGVuVG9rZW4oKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBudW1iZXIrK1xcXFxuICAgICAgICAgICAgICAgIH0gd2hpbGUgKG51bWJlciA8IDIpO1xcXFxuICAgICAgICAgICAgICAgIC8vZGVsZXRlZShmaWxlSWQpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChqc29uLmluY2x1ZGVzKCdodHRwJykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoanNvbikudXJsICsgJyNpc1ZpZGVvPXRydWUjO3tSZWZlcmVyQGh0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS99JztcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBsb2coanNvbik7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9O1xcXFxuXFxcXG4gICAgICAgIGZ1bmN0aW9uIGRlbGV0ZWUoZmlsZUlkKSB7XFxcXG5cXFxcbiAgICAgICAgICAgIGZldGNoKCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vYWRyaXZlL3YyL2JhdGNoJywge1xcXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQSxcXFxcbiAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLycsXFxcXG4gICAgICAgICAgICAgICAgICAgICdhdXRob3JpemF0aW9uJzogcmVhY2Nlc3NUayxcXFxcbiAgICAgICAgICAgICAgICAgICAgJ3gtY2FuYXJ5JzogJ2NsaWVudD13ZWIsYXBwPXNoYXJlLHZlcnNpb249djIuMy4xJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgJ3gtc2hhcmUtdG9rZW4nOiBzaGFyZXRva2VuXFxcXG5cXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZXF1ZXN0c1xcXFxcXFwiOiBbe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJib2R5XFxcXFxcXCI6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImRyaXZlX2lkXFxcXFxcXCI6IGRlZmRyaXZlaWQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJmaWxlX2lkXFxcXFxcXCI6IGZpbGVJZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiaGVhZGVyc1xcXFxcXFwiOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJDb250ZW50LVR5cGVcXFxcXFxcIjogXFxcXFxcXCJhcHBsaWNhdGlvbi9qc29uXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImlkXFxcXFxcXCI6IGZpbGVJZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibWV0aG9kXFxcXFxcXCI6IFxcXFxcXFwiUE9TVFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ1cmxcXFxcXFxcIjogXFxcXFxcXCIvZmlsZS9kZWxldGVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9XSxcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZXNvdXJjZVxcXFxcXFwiOiBcXFxcXFxcImZpbGVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgLy9sb2coJ+WIoOmZpCAnICsgZGVsKTtcXFxcbiAgICAgICAgICAgIC8qXFxcXG4gICAgICAgICAgICBmZXRjaCgnaHR0cHM6Ly9vcGVuLmFsaXl1bmRyaXZlLmNvbS9hZHJpdmUvdjEuMC9vcGVuRmlsZS9kZWxldGUnLCB7XFxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcXFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgJ2F1dGhvcml6YXRpb24nOiBnZXRJdGVtKCdnZXRBY2Nlc3NUb2tlbk9wZW4nLCAnJyksXFxcXG4gICAgICAgICAgICAgICAgICAgICd4LXNoYXJlLXRva2VuJzogc2hhcmV0b2tlblxcXFxuXFxcXG5cXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJkcml2ZV9pZFxcXFxcXFwiOiBkZWZkcml2ZWlkLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImZpbGVfaWRcXFxcXFxcIjogZmlsZUlkXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAqL1xcXFxuICAgICAgICAgICAgLy9sb2coJ2RlbGVcXFxcXFxcXG4nICsganNvbik7XFxcXG4gICAgICAgIH07XFxcXG5cXFxcbiAgICAgICAgLy/lpITnkIbop4bpopEgIFxcXFxuICAgICAgICB2YXIgZHNpZCA9IHNoYXJlSWQ7XFxcXG4gICAgICAgIHZhciBkZmlkID0gaW5wdXQ7XFxcXG5cXFxcbiAgICAgICAgbGV0IGZpbGVJZCA9IGNvcHkoZGZpZCk7XFxcXG4gICAgICAgIHZhciBwbGF5ID0gb3BlbihmaWxlSWQpO1xcXFxuICAgICAgICBpZiAoZmlsZUlkLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgIGRlbGV0ZWUoZmlsZUlkKTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpZiAoemltdS5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIHppbXUpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgemltdXQgPSB6aW11W2ldLnRpdDtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZm5hbWUuaW5jbHVkZXMoemltdXQpIHx8IHppbXV0LmluY2x1ZGVzKGZuYW1lLnN1YnN0cmluZygwLCBmbmFtZS5sYXN0SW5kZXhPZignLicpKSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGxheSA9IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtwbGF5LnNwbGl0KCc7eycpWzBdXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IFt7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1dLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6IGdldHN1Yih6aW11W2ldLmZpZCwgemltdVtpXS5leHQpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGFubXU6Z2V0VmFyKCdkbV9zaGFyZScsJycpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICBwbGF5PUpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICB1cmxzOiBbcGxheS5zcGxpdCgnO3snKVswXV0sXFxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczogW3tcXFxcbiAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tLydcXFxcbiAgICAgICAgICAgICAgICB9XSxcXFxcbiAgICAgICAgICAgICAgICBkYW5tdTpnZXRWYXIoJ2RtX3NoYXJlJywnJylcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH1cXFxcbiAgICB9IGVsc2Uge1xcXFxuICAgICAgICAvL+aZrueUuyAgXFxcXG4gICAgICAgIHZhciBkc2lkID0gc2hhcmVJZDtcXFxcbiAgICAgICAgdmFyIGRmaWQgPSBpbnB1dDtcXFxcblxcXFxuICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nKSB7XFxcXG4gICAgICAgICAgICB2YXIgcGxheSA9IEpTT04uc3RyaW5naWZ5KGdldEFsaVVybChcXFxcbiAgICAgICAgICAgICAgICBzaGFyZUlkLFxcXFxuICAgICAgICAgICAgICAgIGlucHV0LFxcXFxuICAgICAgICAgICAgICAgIHJlZnRva2VuXFxcXG4gICAgICAgICAgICApKTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbn0gZWxzZSBpZiAoY2F0ZSA9PSAnaW1hZ2UnKSB7XFxcXG4gICAgLy/lpITnkIbmlofmoaNcXFxcbiAgICAvL2FjY2Vzc1RrKCk7XFxcXG5cXFxcbiAgICB2YXIganNvbiA9IGZldGNoKCdodHRwczovL2FwaS5hbGl5dW5kcml2ZS5jb20vdjIvZmlsZS9nZXRfc2hhcmVfbGlua19kb3dubG9hZF91cmwnLCB7XFxcXG4gICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXFxcXG4gICAgICAgICAgICAnQXV0aG9yaXph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Sk7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGV0IHVybCA9ICdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vc2lnbidcXFxcbiAgICAgICAgbGV0IGpzID0gJC50b1N0cmluZygobnRva2VuKSA9PiB7XFxcXG4gICAgICAgICAgICBjb25zdCB0b2tlbkZ1bmN0aW9uID0gZnVuY3Rpb24oKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRva2VuID0gSlNPTi5wYXJzZShsb2NhbFN0b3JhZ2UuZ2V0SXRlbSgndG9rZW4nKSlcXFxcbiAgICAgICAgICAgICAgICBpZiAodG9rZW4gJiYgdG9rZW4udXNlcl9pZCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgYWxpc3RmaWxlID0gXFxcXFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2ljeS9pY3ktYWxpLXRva2VuLmpzb25cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgbnRva2VuWzBdID0gdG9rZW47XFxcXG4gICAgICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAud3JpdGVGaWxlKGFsaXN0ZmlsZSwgSlNPTi5zdHJpbmdpZnkobnRva2VuKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvY2FsU3RvcmFnZS5jbGVhcigpO1xcXFxuICAgICAgICAgICAgICAgICAgICBhbGVydCgnVE9LRU7ojrflj5bmiJDlip/vvIzov5Tlm57lkI7liLfmlrDpobXpnaLvvIEnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5wYXJzZUxhenlSdWxlKGBoaWtlcjovL2VtcHR5QGxhenlSdWxlPS5qczpyZWZyZXNoWDVXZWJWaWV3KCcnKTtgKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5iYWNrKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB0b2tlbl90aW1lcigpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHZhciB0b2tlbl90aW1lciA9IGZ1bmN0aW9uKCkge1xcXFxuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQodG9rZW5GdW5jdGlvbiwgNTAwKVxcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIHRva2VuRnVuY3Rpb24oKTtcXFxcbiAgICAgICAgfSwgbnRva2VuKVxcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3g1X3dlYnZpZXdfc2luZ2xlJyxcXFxcbiAgICAgICAgICAgIGRlc2M6ICcxMDAlJiZmbG9hdCcsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGNhbkJhY2s6IHRydWUsXFxcXG4gICAgICAgICAgICAgICAgdWE6IFBDX1VBLFxcXFxuICAgICAgICAgICAgICAgIGpzOiBqc1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxcXG4gICAgfSksXFxcXG4gICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcXFxufSk7XFxcIn1dXCIsXCJwcm94eVwiOlwiXCJ9IiwidGl0bGUiOiLljY7or63nlLXlvbEsIOe7tOWkmuWIqeS6muS4gOWPtyJ9
Add Comment
Please, Sign In to add comment