xiaomianao666

小程序:Alist

Jan 3rd, 2023
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@Alist@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoiQWxpc3QiLCJhdXRob3IiOiJKb2Um6YGT6ZW/6a2U5pS5IiwidXJsIjoiaGlrZXI6Ly9lbXB0eSIsInZlcnNpb24iOjMyLCJjb2xfdHlwZSI6InBpY18xIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ0b29sIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG4gICAgdmFyIGQgPSBbXTtcbmlmIChnZXRBcHBWZXJzaW9uKCkgPCAzMjA0KSB7XG4gICAgc2V0UmVzdWx0KFt7XG4gICAgICAgIHRpdGxlOiBcIuaCqOW9k+WJjeeJiOacrOS4jeaUr+aMgeacrOWwj+eoi+W6j++8jOivt+abtOaWsOiHs+acgOaWsOeJiOacrFwiLFxuICAgICAgICB1cmw6IFwiaHR0cHM6Ly9oYWlrdW8ubGFuem91aS5jb20vdS9Hb2xkUml2ZXJcIlxuICAgIH1dKVxufSBlbHNlIHtcbiAgICBjb25zdCB7XG4gICAgICAgIGdldEZpbGVzLFxuICAgICAgICBnZXRMaW5rXG4gICAgfSA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2FwaScpO1xuICAgIGNvbnN0IHtjb2xvcixzbWFsbH09JC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvdXRpbHMnKTtcbiAgICB2YXIgcGF0aCA9IGdldE15VmFyKFwicGF0aFwiLCBcIlwiKTtcbiAgICBkLnB1c2goe1xuICAgICAgICB0aXRsZTogJ+Kame+4j+iuv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gICAgICAgICAgICAgIGNsZWFyTXlWYXIoXCJwYXRoXCIpO1xuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gXCJ0b2FzdDovL+WIh+aNouaIkOWKn1wiXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcInNjcm9sbF9idXR0b25cIlxuICAgICAgICB9KTtcbiAgICB9KTtcbiAgICBkLnB1c2goe1xuICAgICAgICBjb2xfdHlwZTogXCJibGFua19ibG9ja1wiXG4gICAgfSk7XG4gICAgZC5wdXNoKHtcbiAgICAgICAgdGl0bGU6IFwi4oCY4oCY4oCZ4oCZPHN0cm9uZz48Zm9udCBjb2xvcj0nIzFFOTBGRic+Li4uPC9mcm9udD48L3N0cm9uZz5cIixcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwYXRoKSA9PiB7XG4gICAgICAgICAgICAvLyDov5Tlm57kuIrnuqdcbiAgICAgICAgICAgIHBhdGgucG9wKCk7XG4gICAgICAgICAgICBwdXRNeVZhcihcInBhdGhcIiwgcGF0aC5qb2luKFwiL1wiKSk7XG4gICAgICAgICAgICBpZihnZXRJdGVtKCdjbGVhcl9jaGFuZ2UnLCcnKSl7XG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoJywnJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XG4gICAgICAgICAgICByZXR1cm4gXCJoaWtlcjovL2VtcHR5XCJcbiAgICAgICAgfSwgcGF0aC5zcGxpdChcIi9cIikpLFxuICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCJcbiAgICB9KTtcbiAgICBkLnB1c2goe1xuICAgICAgICB0aXRsZTogXCLwn4+g6aaW6aG1XCIsXG4gICAgICAgIGNvbF90eXBlOiBcInNjcm9sbF9idXR0b25cIixcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcbiAgICAgICAgICAgIHB1dE15VmFyKFwicGF0aFwiLCBcIlwiKTtcbiAgICAgICAgICAgIGlmKGdldEl0ZW0oJ2NsZWFyX3JlZnJlc2gnLCcnKSl7XG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoJywnJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XG4gICAgICAgICAgICByZXR1cm4gXCJoaWtlcjovL2VtcHR5XCJcbiAgICAgICAgfSksXG4gICAgfSk7XG4gICAgbGV0IHBhdGhzID0gXCJcIjtcbiAgICBmb3IgKGl0ZW0gb2YgcGF0aC5zcGxpdChcIi9cIikpIHtcbiAgICAgICAgaWYgKGl0ZW0gIT09IFwiXCIpIHtcbiAgICAgICAgICAgIHBhdGhzICs9IFwiL1wiICsgaXRlbTtcbiAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0sXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGF0aHMpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXCJwYXRoXCIsIHBhdGhzKTtcbiAgICAgICAgICAgICAgICAgICAgaWYoZ2V0SXRlbSgnY2xlYXJfY2hhbmdlJywnJykpe1xuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoJywnJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJoaWtlcjovL2VtcHR5XCJcbiAgICAgICAgICAgICAgICB9LCBwYXRocylcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICB9XG4gICAgbGV0IHNvcnRzID0gW1wi5ZCN56ewXCIsIFwi57G75Z6LXCIsIFwi5aSn5bCPXCIsICfml7bpl7QnXTtcbiAgICBsZXQgbnNvcnQgPSBnZXRNeVZhcignc29ydCcsICflkI3np7AnKTtcbiAgICBsZXQgbnNlYXJjaCA9IGdldE15VmFyKCdzZWFyY2gnLCcnKTtcbiAgICBzb3J0cy5mb3JFYWNoKGl0ZW0gPT4ge1xuICAgICAgICBsZXQgY2MgPSBuc29ydCA9PT0gaXRlbSArIFwiLVwiO1xuICAgICAgICBsZXQgaXNDbGlja2VkID0gbnNvcnQgPT09IGl0ZW07XG4gICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogY2MgfHwgaXNDbGlja2VkID8gXCLigJjigJjigJnigJk8c3Ryb25nPjxmb250IGNvbG9yPScjMUU5MEZGJz5cIiArIGl0ZW0gKyAoY2MgPyBcIuKIp1wiIDogXCLiiKhcIikgKyBcIjwvZnJvbnQ+PC9zdHJvbmc+XCIgOiBpdGVtLFxuICAgICAgICAgICAgY29sX3R5cGU6IFwiZmxleF9idXR0b25cIixcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaXRlbSwgaXNDbGlja2VkKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKGlzQ2xpY2tlZCkge1xuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcInNvcnRcIiwgaXRlbSArIFwiLVwiKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcInNvcnRcIiwgaXRlbSk7XG4gICAgICAgICAgICAgICAgICAgIGlmKGdldEl0ZW0oJ2NsZWFyX2NoYW5nZScsJycpKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaCcsJycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICA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gICAgICAgaWYoaW5wdXQ9PT0n6Ieq5a6a5LmJ6L+H5rukJyl7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2Uvc3VwZXJTZXR0aW5ncyNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSMnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZihmaWx0ZXJPcHRpb24hPT1pbnB1dCl7XG4gICAgICAgICAgICAgICAgc2V0SXRlbSgnZmlsdGVyT3B0aW9uJyxpbnB1dCk7XG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xuICAgICAgICB9LGZpbHRlck9wdGlvbiksXG4gICAgfSk7XG4gICAgZC5wdXNoKHtcbiAgICAgICAgdGl0bGU6bnNlYXJjaD9cIvCflI1cIitzbWFsbChjb2xvcignOicrbnNlYXJjaCwnIzEyYjY2OCcpKTon8J+UjScsXG4gICAgICAgIGNvbF90eXBlOidmbGV4X2J1dHRvbicsXG4gICAgICAgIHVybDokKG5zZWFyY2gsJ+i+k+WFpeimgeaQnOe0oueahOWGheWuueOAguaUr+aMgeato+WImeOAguWmglxcXFwuanMnKS5pbnB1dCgobnNlYXJjaCk9PntcbiAgICAgICAgICAgIGlmKGlucHV0IT09bnNlYXJjaCl7XG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NlYXJjaCcsaW5wdXQpO1xuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcbiAgICAgICAgfSxuc2VhcmNoKSxcbiAgICB9KTtcbiAgICBkLnB1c2goe1xuICAgICAgICB0aXRsZTogY29sb3IoXCLwn5WT5Y6G5Y+yXCIsXCIjZDk2NzE1XCIpLFxuICAgICAgICB1cmw6IFwiaGlrZXI6Ly9wYWdlL2hpc3Rvcnkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXCIsXG4gICAgICAgIGNvbF90eXBlOiBcImZsZXhfYnV0dG9uXCJcbiAgICB9KTtcbiAgICBsZXQgZGlySW5mbyA9IGdldEZpbGVzKHBhdGgsZmlsdGVyT3B0aW9uKTtcbiAgICBpZihkaXJJbmZvLmNhbl91cGxvYWQpe1xuICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgdGl0bGU6IGNvbG9yKFwi4puF6K6/5a6iXCIsXCIjMTVhYjIxXCIpLFxuICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS91cGxvYWQjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXCIsXG4gICAgICAgICAgICBjb2xfdHlwZTogXCJmbGV4X2J1dHRvblwiXG4gICAgICAgIH0pO1xuICAgIH1cbiAgICAvLyBsb2cobm93U3ViKTtcbiAgICBpZihwYXRoLnNwbGl0KCcvJykubGVuZ3RoPjEmJm5vd1N1YiYmbm93U3ViLndlYmRhdiYmbm93U3ViLndlYmRhdi51c2VyKXtcbiAgICAgICAgbGV0IHdlYl9kYXYgPSBub3dTdWIud2ViZGF2O1xuICAgICAgICAvLyBsb2cod2ViZGF2KTtcbiAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiBjb2xvcihcIvCfk4LliJvlu7pcIixcIiMxNWFiMjFcIiksXG4gICAgICAgICAgICB1cmw6ICQoJycsJ+ivt+i+k+WFpeW+heWIm+W7uueahOaWh+S7tuWkueWQjeensCcpLmlucHV0KCh1c2VyLHB3ZCxiYXNlX3BhdGgscGF0aCk9PntcbiAgICAgICAgICAgICAgICBpZihpbnB1dCl7XG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBiYXNlX3BhdGggKycvZGF2JytwYXRoO1xuICAgICAgICAgICAgICAgICAgICBsb2codXJsKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHdlYmRhdiA9I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CAn5omT5byAJyk7XG4gICAgbGV0IHNob3daaW11ID0gZ2V0SXRlbSgnc2hvd1ppbXUnLCflvIAnKTtcbiAgICBkaXJJbmZvLnJlc3VsdC5mb3JFYWNoKGl0ZW0gPT4ge1xuICAgICAgICBpZiAoaXRlbS51cmwpIHtcbiAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0udGl0bGUsXG4gICAgICAgICAgICAgICAgaW1nOiBpdGVtLmltZyxcbiAgICAgICAgICAgICAgICB1cmw6IGl0ZW0udXJsLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpdGVtLmNvbF90eXBlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBsZXQgaXRfdHlwZSA9IGl0ZW0uZXh0cmEudHlwZTtcbiAgICAgICAgICAgIGxldCBpdF90eXBlID0gaXRlbS50eXBlO1xuICAgICAgICAgICAgbGV0IHVybCA9ICdoaWtlcjovL2VtcHR5JztcbiAgICAgICAgICAgIGxldCB0aXRsZSA9IGl0ZW0uZXh0cmEubmFtZSB8fCBpdGVtLnRpdGxlO1xuICAgICAgICAgICAgbGV0IGlkPWl0ZW0uZXh0cmEuaWQ7XG4gICAgICAgICAgICBpZiAoaXRfdHlwZSA9PT0gMSkge1xuICAgICAgICAgICAgICAgIHVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGl0ZW0sIHRpdGxlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFwicGF0aFwiLCAkLnJzdHJpcChnZXRNeVZhcihcInBhdGhcIiwgXCJcIiksJy8nICkrIFwiL1wiICsgdGl0bGUpO1xuICAgICAgICAgICAgICAgICAgICBpZihnZXRJdGVtKCdjbGVhcl9jaGFuZ2UnLCcnKSl7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzZWFyY2gnLCcnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcImhpa2VyOi8vZW1wdHlcIlxuICAgICAgICAgICAgICAgIH0sIGl0ZW0sIHRpdGxlKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXRfdHlwZSA9PT0gMyB8fCAvXFwubTN1OCQvLnRlc3QodGl0bGUpKSB7IC8vM+aYr+WqkuS9kyznpoHnlKjkuIvovb3lkozot7PovaxcbiAgICAgICAgICAgICAgICB1cmwgPSBnZXRMaW5rKHRpdGxlLCBudWxsLCfmiZPlvIAnLCBzaG93WmltdSwnI2lzVmlkZW89dHJ1ZSMnKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaXRfdHlwZSA9PT0gNikge1xuICAgICAgICAgICAgICAgIHVybCA9IGdldExpbmsodGl0bGUsIG51bGwsJ+aJk+W8gCcsIHNob3daaW11LFwiIy5qcGdcIik7XG4gICAgICAgICAgICB9IGVsc2UgeyAvL+i3n+maj+ezu+e7n+mihOiniOWSjOS4i+i9vVxuICAgICAgICAgICAgICAgIHVybCA9IGdldExpbmsodGl0bGUsIG51bGwsY2xpY2tPcHRpb24sc2hvd1ppbXUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS50aXRsZSxcbiAgICAgICAgICAgICAgICBpbWc6IGl0ZW0uaW1nLFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpdGVtLmNvbF90eXBlLFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgIGlkOmlkLFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBpdF90eXBlLFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgf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eD0+eC5uYW1lPT09ZmlsdGVyT3B0aW9uKTtcXG4gICAgICAgICAgICAgICAgaWYoZmlsdGVyX3J1bGUmJmZpbHRlcl9ydWxlLnJ1bGUpe1xcbiAgICAgICAgICAgICAgICAgICAgaWYoZmlsdGVyX3J1bGUucnVsZS5zdGFydHNXaXRoKCchJykpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0LmZpbHRlcih4PT4hKG5ldyBSZWdFeHAoZmlsdGVyX3J1bGUucnVsZS5zbGljZSgxKSkpLnRlc3QoeC5uYW1lKSk7XFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5maWx0ZXIoeD0+KG5ldyBSZWdFeHAoZmlsdGVyX3J1bGUucnVsZSkpLnRlc3QoeC5uYW1lKSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgaWYoc2VhcmNoKXtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IGxpc3QuZmlsdGVyKHg9PihuZXcgUmVnRXhwKHNlYXJjaCkpLnRlc3QoeC5uYW1lKSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKFsn5aSn5bCPJywgJ+exu+WeiycsICflkI3np7AnLCAn5pe26Ze0J10uaW5jbHVkZXMoc29ydCkpIHtcXG4gICAgICAgICAgICAgICAgc29ydHMobGlzdCwgc29ydCk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgc29ydHMobGlzdCwgc29ydC5yZXBsYWNlKCctJywgJycpKS5yZXZlcnNlKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGV4dCA9IGl0ZW0ubmFtZS5zcGxpdCgnLicpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgbGV0IGltZyA9IGl0ZW0udHlwZSA9PT0gMSA/IGljb25fZGljdFsnMSddIDogKGljb25zW2V4dF0gfHwgaWNvbl9kaWN0W2l0ZW0udHlwZSArICcnXSk7XFxuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IGl0ZW0udHlwZSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6YmFzZXVybCtwYXRoK2l0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBpdGVtLnR5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTppdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBpZiAoc2hvd0RldGFpbCkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGUgPSBnZXRUaW1lKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHNpemUgPSBpdGVtLnNpemVfc3RyO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzaXplIHx8IHNpemUgPT09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IGl0ZW0uc2l6ZSA9PT0gMCA/IFxcXCIvXFxcIiA6IGJ5dGVzVG9TaXplKGl0ZW0uc2l6ZSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGlmIChzaXplICYmIHNpemUgIT09IFxcXCJcXFwiICYmIHNpemUgIT09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzaXplID0gXFxcIiZuYnNwOyZuYnNwOyZuYnNwO1xcXCIgKyBzaXplO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzaXplID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZGVzYyA9IGRhdGUgKyBzaXplO1xcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IGl0ZW0udHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogc21hbGwoY29sb3IoZGVzYywgJyNhYWFhYWEnKSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOmJhc2V1cmwrcGF0aCtpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IGl0ZW0udHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSBpZiAobXNnID09PSBcXFwiV3JvbmcgcGFzc3dvcmRcXFwiKSB7XFxuICAgICAgICAgICAgcmVzdWx0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIueCueaIkei+k+WFpeWvhueggVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKGdldE15VmFyKFxcXCJwYXNzd29yZFxcXCIsIFxcXCJcXFwiKSkuaW5wdXQoKHBhdGgsIGJhc2V1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBzdWJfdXJscyA9ICQuZ2V0X3N1Yl91cmxzKCk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWRleCA9IHN1Yl91cmxzLmZpbmRJbmRleCh4ID0+IHgudXJsLmluY2x1ZGVzKGJhc2V1cmwpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpZGV4ID4gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXN1Yl91cmxzW2lkZXhdLnBhc3N3b3JkKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl91cmxzW2lkZXhdLnBhc3N3b3JkID0ge31cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViX3VybHNbaWRleF0ucGFzc3dvcmRbcGF0aF0gPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnc3ViX3VybHMuanNvbicsIEpTT04uc3RyaW5naWZ5KHN1Yl91cmxzKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInBhc3N3b3JkXFxcIiwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mnKrojrflj5bliLDpk77mjqXkuLo6JyArIGJhc2V1cmwgKyAn55qE57Si5byVJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICB9L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AgICAgICAgICAgICAgICByZXR1cm4gJCgn5qOA5rWL5Yiw5pys5Zyw5pyJ6YeN5aSN55qEJyArIGFfbmFtZSArICcs5piv5ZCm6KaG55uWPycpLmNvbmZpcm0oKHN1Yl91cmxzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnc3ViX3VybHMuanNvbicsIEpTT04uc3RyaW5naWZ5KHN1Yl91cmxzKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5L+d5a2YJ1xcbiAgICAgICAgICAgICAgICB9LCBzdWJfdXJscylcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rKh5pyJ5pON5L2cJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgc3ViX3VybHMudW5zaGlmdCh7XFxuICAgICAgICAgICAgICAgIG5hbWU6IGFfbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiBhX3VybCxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBzYXZlRmlsZSgnc3ViX3VybHMuanNvbicsIEpTT04uc3RyaW5naWZ5KHN1Yl91cmxzKSwgMCk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7Lkv53lrZgnXFxuICAgICAgICB9XFxuICAgIH1lbHNlIGlmKHNhdmVfbW9kZSA9PT0gJ+aJuemHjycpe1xcbiAgICAgICAgbGV0IGFkZF9kYXRhID0gW107XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGFkZF9kYXRhID0gZXZhbChhX3VybCk7XFxuICAgICAgICAgICAgSlNPTi5zdHJpbmdpZnkoYWRkX2RhdGEpO1xcbiAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+aJuemHj+a3u+WKoOagvOW8j+acieivryzor7flj4LogIPpooTlpITnkIbnmoRqc29u5qC85byP44CC5ZCN56ew6YeN5aSN5Lya55u05o6l6KaG55uW5L+d5a2YJ1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHN1Yl91cmxzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnc3ViX3VybHMuanNvbicsIDApIHx8ICdbXScpO1xcbiAgICAgICAgbGV0IHN1Yl9jbnQgPSBzdWJfdXJscy5sZW5ndGg7XFxuICAgICAgICBsZXQgbmV3X2FkZF9kYXRhID0gW107IC8vIOiHquWKqOWOu+mHjVxcbiAgICAgICAgYWRkX2RhdGEgPSBhZGRfZGF0YS5maWx0ZXIoeD0+eC5uYW1lJiZ4LnVybCk7XFxuICAgICAgICBpZighQXJyYXkuaXNBcnJheShhZGRfZGF0YSkgfHwgYWRkX2RhdGEubGVuZ3RoIDwgMSl7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WvvOWFpeeahOS4nOilv+eci+i1t+adpeayoeWvueWRoiEnXFxuICAgICAgICB9XFxuICAgICAgICBhZGRfZGF0YS5mb3JFYWNoKChpdCk9PntcXG4gICAgICAgICAgICBsZXQgaWRleCA9IG5ld19hZGRfZGF0YS5maW5kSW5kZXgoeD0+JC5yc3RyaXAoeC51cmwpID09PSAkLnJzdHJpcChpdC51cmwpKTtcXG4gICAgICAgICAgICBpZGV4Pi0xP25ld19hZGRfZGF0YVtpZGV4XSA9IGl0Om5ld19hZGRfZGF0YS51bnNoaWZ0KGl0KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgLy8gbG9nKCflh4blpIfmlrDlop7liJfooag6Jyk7XFxuICAgICAgICAvLyBsb2cobmV3X2FkZF9kYXRhKTtcXG4gICAgICAgIG5ld19hZGRfZGF0YS5mb3JFYWNoKChpdCk9PntcXG4gICAgICAgICAgICBsZXQg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ly8nK2NvZGVcXG4gICAgICAgICAgICB9LHN1Yl91cmxzKSxcXG4gICAgICAgICAgICBjYW5jZWw6JC50b1N0cmluZygoc3ViX3VybHMpPT57XFxuICAgICAgICAgICAgICAgIHN1Yl91cmxzID0gc3ViX3VybHMubWFwKChpdCk9PntyZXR1cm4ge25hbWU6aXQubmFtZSx1cmw6aXQudXJsfX0pO1xcbiAgICAgICAgICAgICAgICBsZXQgY29kZSA9ICdBbGlzdOiuoumYhee8lueggeWIhuS6qyAnK3N1Yl91cmxzWzBdLm5hbWUrJ+etiScrc3ViX3VybHMubGVuZ3RoKyfmnaEnKyc6XFxcXG4nK2Jhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShzdWJfdXJscykpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2NvcHk6Ly8nK2NvZGVcXG4gICAgICAgICAgICB9LHN1Yl91cmxzKX0pO1xcbiAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICB9KSxcXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogJ+WFqOaWh+S7tuWIhuS6qycsXFxuICAgIGNvbF90eXBlOiBvcENvbCxcXG4gICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgIGxldCBzdWJfdXJscyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ3N1Yl91cmxzLmpzb24nLCAwKSB8fCAnW10nKTtcXG4gICAgICAgIGxldCBzaGFyZVBhdGggPSAnaGlrZXI6Ly9maWxlcy9jYWNoZS9hbGlzdOiuoumYhS50eHQnO1xcbiAgICAgICAgY29uZmlybSh7dGl0bGU6J+a4qemmqOaPkOekuicsXFxuICAgICAgICAgICAgY29udGVudDon5bCG5LiA6ZSu5YiG5Lqr5pys5Zyw55qE5omA5pyJ6K6i6ZiFLOaYr+WQpuWwhuWvhueggeS4gOi1t+WIhuS6q++8nycsXFxuICAgICAgICAgICAgY29uZmlybTokLnRv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IChpbnB1dCA9PT0gJ+e9rumhticpIHtcXG4gICAgICAgICAgICAgICAgc3ViX3VybHMuc3BsaWNlKGlkZXgsIDEpO1xcbiAgICAgICAgICAgICAgICBzdWJfdXJscy51bnNoaWZ0KGl0KTtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKFxcXCJiYXNldXJsXFxcIiwgXFxcIlxcXCIpICE9PSBpdC51cmwpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJiYXNldXJsXFxcIiwgaXQudXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcInBhdGhcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBlbHNlIGlmIChpbnB1dCA9PT0gJ+WIoOmZpCcpIHtcXG4gICAgICAgICAgICAgICAgc3ViX3VybHMuc3BsaWNlKGlkZXgsIDEpO1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcImJhc2V1cmxcXFwiLCBcXFwiXFxcIikgPT09IGl0LnVybCkge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImJhc2V1cmxcXFwiLCBzdWJfdXJsc1swXS51cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwicGF0aFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWVsc2UgaWYgKGlucHV0ID09PSAn5L+u5pS55ZCN56ewJykge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChpdC5uYW1lLCfnu5nmraTorqLpmIXmlLnkuKrlkI3lrZflkKcnKS5pbnB1dCgoc3ViX3VybHMsaWRleCk9PntcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl91cmxzW2lkZXhdLm5hbWUgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnc3ViX3VybHMuanNvbicsIEpTT04uc3RyaW5naWZ5KHN1Yl91cmxzKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55aSx6LSlJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LHN1Yl91cmxzLGlkZXgpO1xcbiAgICAgICAgICAgIH1lbHNlIGlmIChpbnB1dCA9PT0gJ+S/ruaUueWcsOWdgCcpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoaXQudXJsLCfnu5nmraTorqLpmIXmlLnkuKrlnLDlnYDlkKcnKS5pbnB1dCgoc3ViX3VybHMsaWRleCk9PntcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQmJi9eaHR0cC8udGVzdChpbnB1dCkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl91cmxzW2lkZXhdLnVybCA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdzdWJfdXJscy5qc29uJywgSlNPTi5zdHJpbmdpZnkoc3ViX3VybHMpLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnydcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnlpLHotKUnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sc3ViX3VybHMsaWRleCk7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PT0gJ+W/q+aNt+i+k+WFpScpIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImFsaXN0X25hbWVcXFwiLGl0Lm5hbWUpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiYWxpc3RfdXJsXFxcIixpdC51cmwpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9ZWxzZSBpZiAoaW5wdXQgPT09ICflr4bnoIHnrqHnkIYnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3Bhc3N3b3JkTWFuYWdlP2lkZXg9JytpZGV4XFxuICAgICAgICAgICAgfWVsc2UgaWYgKC/liIbkuqsvLnRlc3QoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgIGlmKGlucHV0LmluY2x1ZGVzKCfml6Dlr4bnoIEnKSl7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgaXQucGFzc3dvcmQ7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IGNvZGUgPSAnQWxpc3TorqLpmIXnvJbnoIHliIbkuqsgJytpdC5uYW1lKyc6XFxcXG4nK2Jhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShbaXRdKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnY29weTovLycrY29kZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzYXZlRmlsZSgnc3ViX3VybHMuanNvbicsIEpTT04uc3RyaW5naWZ5KHN1Yl91cmxzKSwgMCk7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AwMCxcXG4gICAgICAgIHNlY1VuaXQ6IHRydWVcXG4gICAgfVxcbn1cXG5cXG5mdW5jdGlvbiBDaGluZXNlVG9OdW1iZXIoY2huU3RyKSB7XFxuICAgIGxldCBydG4gPSAwO1xcbiAgICBsZXQgc2VjdGlvbiA9IDA7XFxuICAgIGxldCBudW1iZXIgPSAwO1xcbiAgICBsZXQgc2VjVW5pdCA9IGZhbHNlO1xcbiAgICBsZXQgc3RyID0gY2huU3RyLnNwbGl0KCcnKTtcXG5cXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzdHIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIGxldCBudW0gPSBjaG5OdW1DaGFyW3N0cltpXV07XFxuICAgICAgICBpZiAodHlwZW9mIG51bSAhPT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICBudW1iZXIgPSBudW07XFxuICAgICAgICAgICAgaWYgKGkgPT09IHN0ci5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gKz0gbnVtYmVyO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgbGV0IHVuaXQgPSBjaG5OYW1lVmFsdWVbc3RyW2ldXS52YWx1ZTtcXG4gICAgICAgICAgICBzZWNVbml0ID0gY2huTmFtZVZhbHVlW3N0cltpXV0uc2VjVW5pdDtcXG4gICAgICAgICAgICBpZiAoc2VjVW5pdCkge1xcbiAgICAgICAgICAgICAgICBzZWN0aW9uID0gKHNlY3Rpb24gKyBudW1iZXIpICogdW5pdDtcXG4gICAgICAgICAgICAgICAgcnRuICs9IHNlY3Rpb247XFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gPSAwO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gKz0gKG51bWJlciAqIHVuaXQpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBudW1iZXIgPSAwO1xcb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gICAgdmFyIG4gPSBzLmxlbmd0aFxcbiAgICB2YXIgbSA9IHQubGVuZ3RoXFxuICAgIHZhciBkID0gW11cXG4gICAgZiA9IGYgfHwgMlxcbiAgICB2YXIgbWluID0gZnVuY3Rpb24gKGEsIGIsIGMpIHtcXG4gICAgICAgIHJldHVybiBhIDwgYiA/IChhIDwgYyA/IGEgOiBjKSA6IChiIDwgYyA/IGIgOiBjKVxcbiAgICB9XFxuICAgIHZhciBpLCBqLCBzaSwgdGosIGNvc3RcXG4gICAgaWYgKG4gPT09IDApIHJldHVybiBtXFxuICAgIGlmIChtID09PSAwKSByZXR1cm4gblxcbiAgICBmb3IgKGkgPSAwOyBpIDw9IG47IGkrKykge1xcbiAgICAgICAgZFtpXSA9IFtdXFxuICAgICAgICBkW2ldWzBdID0gaVxcbiAgICB9XFxuICAgIGZvciAoaiA9IDA7IGogPD0gbTsgaisrKSB7XFxuICAgICAgICBkWzBdW2pdID0galxcbiAgICB9XFxuICAgIGZvciAoaSA9IDE7IGkgPD0gbjsgaSsrKSB7XFxuICAgICAgICBzaSA9IHMuY2hhckF0KGkgLSAxKVxcbiAgICAgICAgZm9yIChqID0gMTsgaiA8PSBtOyBqKyspIHtcXG4gICAgICAgICAgICB0aiA9IHQuY2hhckF0KGogLSAxKVxcbiAgICAgICAgICAgIGlmIChzaSA9PT0gdGopIHtcXG4gICAgICAgICAgICAgICAgY29zdCA9IDBcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjb3N0ID0gMVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkW2ldW2pdID0gbWluKGRbaSAtIDFdW2pdICsgMSwgZFtpXVtqIC0gMV0gKyAxLCBkW2kgLSAxXVtqIC0gMV0gKyBjb3N0KVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGxldCByZXMgPSAoMSAtIGRbbl1bbV0gLyBsKSAqMTAwXFxuICAgIHJldHVybiByZXMudG9GaXhlZChmKVxcbn1cXG5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xuc2V0UGFnZVRpdGxlKCdBbGlzdOWvhueggeeuoeeQhicpO1xcbmNvbnN0IHtjb2xvcixzbWFsbH0gPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS91dGlscycpO1xcbmxldCBpZGV4ID0gZ2V0UGFyYW0oJ2lkZXgnLCBNWV9QQVJBTVMuaWRleHx8XFxcIlxcXCIpO1xcbmlmKCFpZGV4KXtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifntKLlvJXojrflj5blpLHotKUs5peg5rOV566h55CG5a+G56CBJyxcXG4gICAgICAgIGNvbF90eXBlOid0ZXh0XzEnLFxcbiAgICAgICAgdXJsOidoaWtlcjovL2VtcHR5J1xcbiAgICB9KTtcXG59ZWxzZXtcXG4gICAgaWRleCA9IE51bWJlcihpZGV4KTtcXG4gICAgbGV0IHN1Yl91cmxzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnc3ViX3VybHMuanNvbicsIDApIHx8ICdbXScpO1xcbiAgICBsZXQgbm93U3ViID0gc3ViX3VybHNbaWRleF07XFxuICAgIGxldCBuYW1lID0gY29sb3Iobm93U3ViLm5hbWUsJyNkOTY3MTUnKTtcXG4gICAgbGV0IHBhc3N3b3JkID0gbm93U3ViLnBhc3N3b3JkO1xcbiAgICBsZXQgd2ViZGF2ID0gbm93U3ViLndlYmRhdnx8e307XFxuICAgIGlmKCFwYXNzd29yZCl7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiforqLpmIUnK25hbWUrJ+aaguaXoOWvhueggScsXFxuICAgICAgICAgICAgY29sX3R5cGU6J3RleHRfMScsXFxuICAgICAgICAgICAgdXJsOidoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfSk7XFxuICAgIH1lbHNle1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTon6K6i6ZiFJytuYW1lKyflr4bnoIHlpoLkuIsnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOid0ZXh0XzEnLFxcbiAgICAgICAgICAgIHVybDonaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTpKU09OLnN0cmluZ2lmeShwYXNzd29yZCksXFxuICAgICAgICAgICAgY29sX3R5cGU6J2xvbmdfdGV4dCcsXFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICB0aXRsZTonPGJpZz48c3Ryb25nPndlYmRhdumFjee9rjxiaWc+PHN0cm9uZz4nLFxcbiAgICAgICBjb2xfdHlwZToncmljaF90ZXh0JyxcXG4gICAgfSk7XFxuICAgIGxldCB3ZWJkYXZfcGF0aCA9ICQucnN0cmlwKG5vd1N1Yi51cmwsJy8nKSsnL2Rhdic7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTond2ViZGF25Zyw5Z2AJyxcXG4gICAgICAgIGRlc2M6d2ViZGF2X3BhdGgsXFxuICAgICAgICBjb2xfdHlwZTondGV4dF8xJyxcXG4gICAgICAgIHVybDonY29weTovLycrd2ViZGF2X3BhdGhcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+i0puWPtycsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKHVzZXIpPT57XFxuICAgICAgICAgICAgY29weSh1c2VyfHxnZXRNeVZhcignd2ViZGF2X3VzZXInLCcnKSk7XFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfSx3ZWJkYXYudXNlciksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIGRlc2M6IFxcXCJ3ZWJkYXbnmbvlvZXotKblj7dcXFwiLFxcbiAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOndlYmRhdi51c2VyfHxnZXRNeVZhcignd2ViZGF2X3VzZXInLCcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTpcXFwicHV0TXlWYXIoJ3dlYmRhdl91c2VyJyxpbnB1dClcXFwiLFxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn5a+G56CBJyxcXG4gICAgICAgIHVybDogJC50b1N0cmluZygocHdkKT0+e1xcbiAgICAgICAgICAgIGNvcHkocHdkfHxnZXRNeVZhcignd2ViZGF2X3B3ZCcsJycpKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICB9LHdlYmRhdi5wd2QpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwid2ViZGF255m75b2V5a+G56CBXFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgIHR5cGU6J3Bhc3N3b3JkJyxcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6d2ViZGF2LnB3ZHx8Z2V0TXlWYXIoJ3dlYmRhdl9wd2QnLCcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTpcXFwicHV0TXlWYXIoJ3dlYmRhdl9wd2QnLGlucHV0KVxcXCIsXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J+mqjOivgeW5tuS/neWtmCcsXFxuICAgICAgICBjb2xfdHlwZTondGV4dF9jZW50ZXJfMScsXFxuICAgICAgICB1cmw6JCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgod2ViZGF2X3BhdGgsaWRleCk9PntcXG4gICAgICAgICAgICBzaG93TG9hZGluZygn55m75b2V6aqM6K+B5LitLOivt+eojeetiS4uLicpO1xcbiAgICAgICAgICAgIGxldCB1cmwgPSB3ZWJkYXZfcGF0aDtcXG4gICAgICAgICAgICBsZXQgdXNlciA9IGdldE15VmFyKFxcXCJ3ZWJkYXZfdXNlclxcXCIpO1xcbiAgICAgICAgICAgIGxldCBwd2QgPSBnZXRNeVZhcihcXFwid2ViZGF2X3B3ZFxcXCIpO1xcbiAgICAgICAgICAgIGlmICghdXNlcnx8ICFwd2QpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ivt+i+k+WFpXdlYmRhdueZu+W9lei0puWPt+WSjOWvhueggVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCB3ZWJkYXYgPSBidWlsZFdlYkRhdih1cmwsIHVzZXIsIHB3ZCk7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBKU09OLnBhcnNlKHdlYmRhdi5saXN0KCkpO1xcbiAgICAgICAgICAgICAgICBpZihsaXN0Lmxlbmd0aCA8IDEpe1xcbiAgICAgICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZjlpLHotKUh55m75b2V5qOA5rWL5Yiw5paH5Lu25YiX6KGo5Li656m6LOivt+ehruS/nei0puWPt+Wvhueggeato+ehruS4lHdlYmRhdui3r+W+hOS4i+iHs+WwkeaciTHkuKrmlofku7Yv5paH5Lu25aS5J1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+d5a2Y5aSx6LSlIeeZu+W9leajgOa1i+WIsOaWh+S7tuWIl+ihqOS4uuepuizor7fnoa7kv53otKblj7flr4bnoIHmraPnoa7kuJR3ZWJkYXbot6/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XG4gICAgICAgICAgICBpZighQXJyYXkuaXNBcnJheShuZXdSdWxlcykgfHwgbmV3UnVsZXMubGVuZ3RoIDwgMSl7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lr7zlhaXnmoTkuJzopb/nnIvotbfmnaXmsqHlr7nlkaIhJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBuZXdSdWxlcy5mb3JFYWNoKChpdCk9PntcXG4gICAgICAgICAgICAgICAgbGV0IGlkZXggPSBmaWx0ZXJfcnVsZXMuZmluZEluZGV4KHg9PiQucnN0cmlwKHgubmFtZSkgPT09ICQucnN0cmlwKGl0Lm5hbWUpKTtcXG4gICAgICAgICAgICAgICAgaWRleD4tMT9maWx0ZXJfcnVsZXNbaWRleF0gPSBpdDpmaWx0ZXJfcnVsZXMudW5zaGlmdChpdCk7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGV0IG5ld19jbnQgPSBmaWx0ZXJfcnVsZXMubGVuZ3RoIC0gZmlsdGVyX2NudDtcXG4gICAgICAgICAgICBpZihuZXdfY250ID4gMCApe1xcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnZmlsdGVyX3J1bGVzLmpzb24nLCBKU09OLnN0cmluZ2lmeShmaWx0ZXJfcnVsZXMpLCAwKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5L+d5a2YJytuZXdfY250KyfmnaHorrDlvZUnXFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/msqHmnInlvoXkv53lrZjnmoTlhoXlrrknXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WvvOWFpeWksei0pSFcXFxcbicrIGUubWVzc2FnZTtcXG4gICAgICAgI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goe1xcbiAgICAgICAgdGl0bGU6IGl0LmFjdGl2ZT9jb2xvcihpdC5uYW1lLCcjMTJiNjY4Jyk6Y29sb3IoaXQubmFtZSwnI2FhYWFhYScpLFxcbiAgICAgICAgZGVzYzogaXQucnVsZSxcXG4gICAgICAgIHVybDogJChbJ+WIoOmZpCcsICfkv67mlLnlkI3np7AnLCfkv67mlLnop4TliJknLCflv6vmjbfovpPlhaUnLCflkK/nlKgnLCfnpoHnlKgnXSwgMiwgJ+ivt+mAieaLqTHkuKrmk43kvZwnKS5zZWxlY3QoKGl0LCBmaWx0ZXJfcnVsZXMsIGlkZXgpID0+IHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT09ICfliKDpmaQnKSB7XFxuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXJPcHRpb24gPSBnZXRJdGVtKCdmaWx0ZXJPcHRpb24nLCflhajpg6gnKTtcXG4gICAgICAgICAgICAgICAgaWYoZmlsdGVyT3B0aW9uPT09aXQubmFtZSl7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhckl0ZW0oJ2ZpbHRlck9wdGlvbicpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZmlsdGVyX3J1bGVzLnNwbGljZShpZGV4LCAxKTtcXG4gICAgICAgICAgICB9ZWxzZSBpZiAoaW5wdXQgPT09ICfkv67mlLnlkI3np7AnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKGl0Lm5hbWUsJ+e7meatpOinhOWImeaUueS4quWQjeWtl+WQpycpLmlucHV0KChmaWx0ZXJfcnVsZXMsaWRleCk9PntcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbHRlcl9ydWxlc1tpZGV4XS5uYW1lID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2ZpbHRlcl9ydWxlcy5qc29uJywgSlNPTi5zdHJpbmdpZnkoZmlsdGVyX3J1bGVzKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55aSx6LSlJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LGZpbHRlcl9ydWxlcyxpZGV4KTtcXG4gICAgICAgICAgICB9ZWxzZSBpZiAoaW5wdXQgPT09ICfkv67mlLnop4TliJknKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKGl0LnJ1bGUsJ+e7meatpOinhOWImeaUueS4quWMuemFjeWGheWuueWQpycpLmlucHV0KChmaWx0ZXJfcnVsZXMsaWRleCk9PntcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbHRlcl9ydWxlc1tpZGV4XS5ydWxlID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2ZpbHRlcl9ydWxlcy5qc29uJywgSlNPTi5zdHJpbmdpZnkoZmlsdGVyX3J1bGVzKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+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gICAgfSk7XFxuICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgIH0sY29sb3IpLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCIsXFxuICAgIGV4dHJhOntcXG4gICAgICAgIGlkOidoaXNfY2xpY2snXFxuICAgIH1cXG59KTtcXG5sZXQgdmlld19oaXN0b3J5ID0gSlNPTi5wYXJzZShyZWFkRmlsZSgndmlld19oaXN0b3J5Lmpzb24nLCAwKSB8fCAnW10nKTtcXG5pZih2aWV3X2hpc3RvcnkubGVuZ3RoID4gMCl7XFxuICAgIHZpZXdfaGlzdG9yeS5mb3JFYWNoKChpdCk9PntcXG4gICAgICAgIGl0LmNvbF90eXBlID0gJ3RleHRfMSc7XFxuICAgICAgICBpZihvcHRpb249PT0n5Yig6ZmkJyl7XFxuICAgICAgICAgICAgaXQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaWQpPT57XFxuICAgICAgICAgICAgICAgIGxldCB2aWV3X2hpc3RvcnkgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCd2aWV3X2hpc3RvcnkuanNvbicsIDApIHx8ICdbXScpO1xcbiAgICAgICAgICAgICAgICBsZXQgaWRleCA9IHZpZXdfaGlzdG9yeS5maW5kSW5kZXgoeD0+eC5leHRyYS5pZCA9PT0gaWQpO1xcbiAgICAgICAgICAgICAgICB2aWV3X2hpc3Rvcnkuc3BsaWNlKGlkZXgsMSk7XFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCd2aWV3X2hpc3RvcnkuanNvbicsIEpTT04uc3RyaW5naWZ5KHZpZXdfaGlzdG9yeSksMCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH0saXQuZXh0cmEuaWQpO1xcbiAgIC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AgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrO1xcbiAgICAgICAgICAgIHdpZHRoOiAxMDAlO1xcbiAgICAgICAgICAgIG1hcmdpbjogNnB4O1xcbiAgICAgICAgICAgIG91dGxpbmU6IG5vbmU7XFxuICAgICAgICAgICAgaGVpZ2h0OiA0MHB4O1xcbiAgICAgICAgICAgIGxpbmUtaGVpZ2h0OiA0MHB4O1xcbiAgICAgICAgICAgIGNvbG9yOiAjZmZmO1xcbiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICMyNmEyZmY7XFxuICAgICAgICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xcbiAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDRweDtcXG4gICAgICAgICAgICBib3JkZXI6IG5vbmU7XFxuICAgICAgICAgICAgY3Vyc29yOiBwb2ludGVyO1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgI3VwbG9hZC1pbnB1dCB7XFxuICAgICAgICAgICAgb3BhY2l0eTogMDtcXG4gICAgICAgICAgICBmaWx0ZXI6IGFscGhhKG9wYWNpdHk9MCk7XFxuICAgICAgICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xcbiAgICAgICAgICAgIHdpZHRoOiAxMDAlO1xcbiAgICAgICAgICAgIGhlaWdodDogMTAwJTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgICN1cGxvYWQtdGV4dCB7XFxuICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlO1xcbiAgICAgICAgICAgIGJvdHRvbTogNDBweDtcXG4gICAgICAgICAgICB1c2VyLXNlbGVjdDogbm9uZTtcXG4gICAgICAgIH1cXG4gICAgPC9zdHlsZT5cXG4gICAgPC9oZWFkPlxcbiAgICA8Ym9keT48YnV0dG9uIG9uY2xpY2s9XFxcImVhc3lVcGxvYWQoKVxcXCI+IDxzcGFuIGlkPVxcXCJ1cGxvYWQtaW5wdXRcXFwiPumAieaLqeaWh+S7tjwvc3Bhbj48c3BhbiBpZ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ZVxcXCI6IFxcXCJhcHBsaWNhdGlvbi9qc29uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJhdXRob3JpemF0aW9uXFxcIjogZ2V0SXRlbShcXFwiYXV0aG9yaXphdGlvblxcXCIsIFxcXCJcXFwiKVxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBwYXRoOiBwYXRoLFxcbiAgICAgICAgICAgICAgICAgICAga2V5d29yZDogbnNlYXJjaCxcXG4gICAgICAgICAgICAgICAgICAgIHBhc3N3b3JkOiBwYXNzd29yZFtwYXRoXSB8fCAnJ1xcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgdGltZW91dDogJC5nZXRUaW1lT3V0KCksXFxuICAgICAgICAgICAgfSkpO1xcblxcbiAgICAgICAgICAgIGxldCBsaXN0ID0gcmVzLmRhdGE7XFxuICAgICAgICAgICAgaWYgKGxpc3QubGVuZ3RoIDwgMSkge1xcbiAgICAgICAgICAgICAgICBzZWFyY2hSZXN1bHQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaJvuS4jeWIsOS9oOaDs+imgeeahMqVwrfhtKXCt8qUXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmKGZpbHRlck9wdGlvbj09PSfmlofku7YnKXtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0LmZpbHRlcih4PT54LnR5cGUhPT0xKVxcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZihmaWx0ZXJPcHRpb249PT0n5paH5Lu25aS5Jyl7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5maWx0ZXIoeD0+eC50eXBlPT09MSlcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoZmlsdGVyT3B0aW9uIT09J+WFqOmDqCcpe1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbHRlcl9ydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2ZpbHRlcl9ydWxlcy5qc29uJywgMCkgfHwgJ1tdJyk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsdGVyX3J1bGUgPSBmaWx0ZXJfcnVsZXMuZmluZCh4PT54Lm5hbWU9PT1maWx0ZXJPcHRpb24pO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoZmlsdGVyX3J1bGUmJmZpbHRlcl9ydWxlLnJ1bGUpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGZpbHRlcl9ydWxlLnJ1bGUuc3RhcnRzV2l0aCgnIScpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGxpc3QuZmlsdGVyKHg9PiEobmV3IFJlZ0V4cChmaWx0ZXJfcnVsZS5ydWxlLnNsaWNlKDEpKSkudGVzdCh4Lm5hbWUpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGxpc3QuZmlsdGVyKHg9PihuZXcgUmVnRXhwKGZpbHRlcl9ydWxlLnJ1bGUpKS50ZXN0KHgubmFtZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBzaG93TG9hZGluZygn5pCc57Si5YiwJyArIGxpc3QubGVuZ3RoICsgJ+adoee7k+aenCzliqDovb3kuK0nKTtcXG4gICAgICAgICAgICAgICAgbGlzdC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaXRfdHlwZSA9IGl0ZW0udHlwZTsvL+i1hOa6kOexu+Wei1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IGl0ZW0ubmFtZTsvL+i1hOa6kOWQjeensFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBpdGVtLnBhdGg7Ly/otYTmupDot6/lvoRcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpZCA9IGJhc2V1cmwgKyBwYXRoICsgdGl0bGU7Ly/otYTmupDllK/kuIDmoIflv5dcXG4gICAgICAgICAgICAgICAgICAgIGxldCBleHQgPSB0aXRsZS5zcGxpdCgnLicpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbWcgPSBpdF90eXBlID09PSAxID8gaWNvbl9kaWN0WycxJ10gOiAoaWNvbnNbZXh0XSB8fCBpY29uX2RpY3RbaXRfdHlwZSArICcnXSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXRfdHlwZSA9PT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInBhdGhcXFwiLCBpdGVtLnBhdGggKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpdF90eXBlID09PSAzIHx8IC9cXFxcLm0zdTgkLy50ZXN0KHRpdGxlKSkgeyAvLzPmmK/lqpLkvZMs56aB55So5LiL6L295ZKM6Lez6L2sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gZ2V0TGluayh0aXRsZSxwYXRoLCAn5omT5byAJywgc2hvd1ppbXUsICcjaXNWaWRlbz10cnVlIycsdHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGl0X3R5cGUgPT09IDYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBnZXRMaW5rKHRpdGxlLHBhdGgsICfmiZPlvIAnLCBzaG93WmltdSwgXFxcIiMuanBnXFxcIix0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7IC8v6Lef6ZqP57O757uf6aKE6KeI5ZKM5LiL6L29XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gZ2V0TGluayh0aXRsZSxwYXRoLCBjbGlja09wdGlvbiwgc2hvd1ppbXUsdHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBzZWFyY2hSZXN1bHQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTp0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogaXRfdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgLy8gbG9nKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNob3dEZXRhaWwpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0ZSA9IChpdGVtLnVwZGF0ZWRfYXQgfHwgaXRlbS50aW1lX3N0cikgPyBnZXRUaW1lKGl0ZW0pIDogJ1xcXFx0XFxcXHRcXFxcdFxcXFx0JztcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2l6ZSA9IGl0ZW0uc2l6ZV9zdHI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzaXplIHx8IHNpemUgPT09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemUgPSBpdGVtLnNpemUgPT09IDAgPyBcXFwiL1xcXCIgOiBieXRlc1RvU2l6ZShpdGVtLnNpemUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzaXplICYmIHNpemUgIT09IFxcXCJcXFwiICYmIHNpemUgIT09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IFxcXCImbmJzcDsmbmJzcDsmbmJzcDtcXFwiICsgc2l6ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkZXNjID0gZGF0ZSArIHNpemU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoUmVzdWx0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogc21hbGwoY29sb3IoZGVzYywgJyNhYWFhYWEnKSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBpdF90eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHRvYXN0KCfmkJzntKLnu5PmnZ/vvIzljbPlsIbliqDovb3lrozmr5UuLi4nKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ2xhc3RTZWFyY2gnLCBsYXN0U2VhcmNoKTtcXG4gICAgICAgICAgICBpZighc2hvd0RldGFpbCl7Ly/pnZ7or6bnu4bmqKHlvI/miY3oh6rliqjmjInlkI3np7DmjpLluo9cXG4gICAgICAgICAgICAgICAgc29ydHMoc2VhcmNoUmVzdWx0LCflkI3np7AnKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc2F2ZUZpbGUoJ3NlYXJjaF9yZXN1bHRzLmpzb24nLCBKU09OLnN0cmluZ2lmeShzZWFyY2hSZXN1bHQpLCAwKTtcXG5cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBzZWFyY2hSZXN1bHQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5aW95YOP5LiN6IO95pCc57SiLOeCueWHu+i/lOWbnlxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IGUubWVzc2FnZSxcXG4gICAgICAgICAgICAgICA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h0KTtcXG4gICAgICAgIGlmKC90b2FzdDovLnRlc3QodSkpe1xcbiAgICAgICAgICAgIHJldHVybiB1XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcGxheVVybCA9IGJhc2V1cmwgKyBcXFwiL2RcXFwiICsgbnBhdGg7Ly/mlofku7YzMDLnm7Tpk75cXG4gICAgICAgIHUgPSBleHQ/cGxheVVybCtleHQ6cGxheVVybDsgLy8g5pei54S26I635Y+WdeayoeaKpemUmSzkuLrkuoblj6/ku6Xorqnop4bpopHmipXlsY8s6YKj5LmIdeimhuWGmeS4ujMwMuebtOmTvlxcbiAgICAgICAgLy9sb2codSk7XFxuICAgICAgICBpZiAoY2xpY2tPcHRpb24gPT09ICfmiZPlvIAnKSB7XFxuICAgICAgICAgICAgaWYoZXh0JiYvaXNWaWRlby8udGVzdChleHQpJiZzaG93WmltdT09PSflvIAnKXsvL+WIpOaWreaJk+W8gOeahOaYr+WqkuS9k+aWh+S7tuaJjei1sOWtl+W5lemAu+i+kVxcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNldXJsICsgbnBhdGg7Ly/lvZPliY3mlofku7bnmoTllK/kuIDmoIfor4ZcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGEgPSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaW5wdXQsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDppZCxcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgdmFyIG5vd19maWxlcyA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJub3dfZmlsZXNcXFwiLFtdKTsvL+iOt+WPlue8k+WtmOeahCzpgb/lhY3kuozmrKHor7fmsYJcXG4gICAgICAgICAgICAgICAgLy8gbG9nKCflkIznm67lvZXmlofku7bmlbDkuLo6Jytub3dfZmlsZXMubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgaWYobm93X2ZpbGVzLmxlbmd0aCA8IDF8fCByZWxvYWQpey8v5LuO5pCc57Si6L+b5Y6755qELOWPquiDvemHjeaWsOiOt+WPluS6hlxcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qge2dldEZpbGVzfSA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2FwaScpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGRpckluZm8gPSBnZXRGaWxlcyhwYXRoLCfmlofku7YnKTtcXG4gICAgICAgICAgICAgICAgICAgIG5vd19maWxlcyA9IGRpckluZm8ucmVzdWx0fHxbXTtcXG4gICAgICAgICAgICAgICAgICAgIC8vIGxvZygn6YeN5paw6I635Y+W5ZCM55uu5b2V5paH5Lu2Oicrbm93X2ZpbGVzLmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IGZpbGVzO1xcbiAgICAgICAgICAgICAgICBpZihyZWxvYWQpe1xcbiAgICAgICAgICAgICAgICAgICAgZmlsZXMgPSBub3dfZmlsZXMuZmlsdGVyKHg9PngudHlwZSE9PTEmJi9cXFxcLnNydCR8XFxcXC52dHQkfFxcXFwuYXNzJHxcXFxcLnNzYSQvLnRlc3QoeC50aXRsZSkpLm1hcCh4PT54LnRpdGxlKTsgLy8g562b6YCJ5paH5Lu25bm25LiU5ZCN56ew5ZCr5a2X5bmV5ZCO57yA55qEXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgZmlsZXMgPSBub3dfZmlsZXMuZmlsdGVyKHg9PngudHlwZSE9PTEmJi9cXFxcLnNydCR8XFxcXC52dHQkfFxcXFwuYXNzJHxcXFxcLnNzYSQvLnRlc3QoeC5uYW1lKSkubWFwKHg9PngubmFtZSk7IC8vIOetm+mAieaWh+S7tuW5tuS4lOWQjeensOWQq+Wtl+W5leWQjue8gOeahFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vIGxvZyhub3dfZmlsZXMpO1xcbiAgICAgICAgICAgICAgICBpZihmaWxlcy5sZW5ndGggPiAwKXsvL+W9k+WJjeebruW9leacieWtl+W5leaWh+S7tlxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJlc3RGaWxlID0gZmlsZXMuZmluZCh4PT4kLnJlbW92ZUV4dChpbnB1dCkuaW5jbHVkZXMoJC5yZW1vdmVFeHQoeCkpKTsvL+inhumikeaWh+S7tuWOu+aOieWQjue8gOWujOe+juWMheWQq+Wtl+W5leaWh+S7tuWOu+WQjue8gFxcbiAgICAgICAgICAgICAgICAgICAgaWYoYmVzdEZpbGUpey8v5om+5Yiw5LqG5pyA56ym5ZCI55qE5paH5Lu25ZCN56ewXFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9nKGAke2lucHV0feiHquWKqOWMuemFjeacgOS9s+WkluaMguWtl+W5leaWh+S7tjoke2Jlc3RGaWxlfWApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gYmFzZXVybCArICcvZCcgKyBwYXRoICsgYmVzdEZpbGU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS51cmwgPSBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1XSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6IHJlYWxVcmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAkLnNhdmVIaXN0b3J5KGlkLGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1XSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6IHJlYWxVcmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVzID0gZmlsZXMuZmlsdGVyKHg9PiQuc2ltaWxhcigkLnJlbW92ZUV4dChpbnB1dCksJC5yZW1vdmVFeHQoeCkpPj0zMCk7Ly/nrZvpgInnm7jkvLzluqY+MzDnmoTmlofku7ZcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZXMubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlcy51bnNoaWZ0KCfkuI3pnIDopoHlrZfluZUnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoZmlsZXMsIDEsIFxcXCLor7fpgInmi6nlrZfluZVcXFwiKS5zZWxlY3QoKGJhc2V1cmwsIHBhdGgsIHUsZXh0LGlkLHBsYXlVcmwsZGF0YSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQ9PT0n5LiN6ZyA6KaB5a2X5bmVJyl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS51cmwgPSB1O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQuc2F2ZUhpc3RvcnkoaWQsZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gYmFzZXVybCArICcvZCcgKyBwYXRoICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnVybCA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6IHJlYWxVcmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJC5zYXZlSGlzdG9yeShpZCxkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YnRpdGxlOiByZWFsVXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgYmFzZXVybCwgcGF0aCwgdSxleHQsaWQscGxheVVybCxkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnVybCA9IHU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQuc2F2ZUhpc3RvcnkoaWQsZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIGRhdGEudXJsID0gdTtcXG4gICAgICAgICAgICAgICAgICAgICQuc2F2ZUhpc3RvcnkoaWQsZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWVsc2UgaWYoZXh0JiYvaXNWaWRlby8udGVzdChleHQpJiZzaG93WmltdSE9PSflvIAnKXtcXG4gICAgICAgICAgICAgICAgbGV0IGlkID0gYmFzZXVybCArIG5wYXRoOy8v5b2T5YmN5paH5Lu255qE5ZSv5LiA5qCH6K+GXFxuICAgICAgICAgICAgICAgIGxldCBkYXRhID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogaWQsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6dSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDppZCxcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgJC5zYXZlSGlzdG9yeShpZCxkYXRhKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVcXG4gICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoY2xpY2tPcHRpb24gPT09ICfmiZPlvIAnKSB7XFxuICAgICAgICAgICAgcmV0dXJuIHVcXG4gICAgICAgIH0gZWxzZSBpZiAoY2xpY2tPcHRpb24gPT09ICfkuIvovb0nKSB7XFxuICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1XFxuICAgICAgICB9XFxuICAgIH1lbHNle1xcbiAgICAgICAgbGV0IHN1Yl91cmxzID0gJC5nZXRfc3ViX3VybHMoKTtcXG4gICAgICAgIGxldCByc3RyaXAgPSAkLnJzdHJpcDtcXG4gICAgICAgIGxldCBub3dTdWIgPSBzdWJfdXJscy5maW5kKHg9PnJzdHJpcCh4LnVybCwnLycpPT09YmFzZXVybCk7XFxuICAgICAgICBsZXQgZGF2ID0gbm93U3ViP25vd1N1Yi53ZWJkYXZ8fHt9Ont9O1xcbiAgICAgICAgbGV0IHNlbF9saXN0ID0gWyfmiZPlvIAnLCAn5LiL6L29JywgJ+mihOiniCcsICflpI3liLbnm7Tpk74nXTtcXG4gICAgICAgIGlmKHBhdGguc3BsaXQoJy8nKS5sZW5ndGg+MSYmbm93U3ViJiZub3dTdWIud2ViZGF2JiZub3dTdWIud2ViZGF2LnVzZXIpe1xcbiAgICAgICAgICAgIHNlbF9saXN0LnB1c2goJ+WIoOmZpCcpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuICQoc2VsX2xpc3QsIDIsICfor7fpgInmi6kx5Liq5paH5Lu25pON5L2cJykuc2VsZWN0KChiYXNldXJsLCBwYXRoLG5wYXRoLGV4dCx1c2VyLHB3ZCxkYXYpID0+IHtcXG4gICAgICAgICAgICAvL2xvZyhkYXYpO1xcbiAgICAgICAgICAgIGxldCB1PSQuZ2V0VShiYXNldXJsLG5wYXRoLGV4dCk7XFxuICAgICAgICAgICAgaWYoL3RvYXN0Oi8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgIHJldHVybiB1XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCByZWFsVXJsID0gYmFzZXVybCArICcvZCcgKyBucGF0aDtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT09ICfmiZPlvIAnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB1O1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT09ICfkuIvovb0nKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT09ICflpI3liLbnm7Tpk74nKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnY29weTovLycgKyByZWFsVXJsXFxuICAgICAgICAgICAgfWVsc2UgaWYoaW5wdXQgPT09ICfliKDpmaQnKXtcXG4gICAgICAgICAgICAgICAgLy8gbGV0IHVybCA9IGJhc2V1cmwgKycvZGF2JytucGF0aDtcXG4gICAgICAgICAgICAgICAgbGV0IGZuYW1lID0gbnBhdGguc3BsaXQoJy8nKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBiYXNldXJsICsnL2RhdicrcGF0aDtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoJ+ehruiupOWIoOmZpDonK2ZuYW1lKycgPycpLmNvbmZpcm0oKHJlYWxVcmwsdXJsLGZuYW1lLHVzZXIscHdkKT0+e1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHdlYmRhdiA9IGJ1aWxkV2ViRGF2KHVybCwgdXNlciwgcHdkKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vIGxvZyhmbmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICBsb2codXJsK2ZuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgIHdlYmRhdi5kZWxldGUoZm5hbWUpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey5Yig6ZmkXFxcIityZWFsVXJsXFxuICAgICAgICAgICAgICAgIH0scmVhbFVybCx1cmwsZm5hbWUsdXNlcixwd2QpO1xcbiAgICAgICAgICAgIH1lbHNlIGlmIChpbnB1dCA9PT0gJ+mihOiniCcpIHtcXG4gICAgICAgICAgICAgICAgaWYgKC9cXFxcLm1kJC8udGVzdChyZWFsVXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVuZGVyVGV4dChyZWFsVXJsLCdtZCcpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcLmh0bWwkfFxcXFwuanNvbiR8XFxcXC5qcyR8XFxcXC5jc3MkfFxcXFwucHkkfFxcXFwucGhwJHxcXFxcLmdvJC8udGVzdChyZWFsVXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVuZGVyVGV4dChyZWFsVXJsLCdjb2RlJyk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFwudHh0JC8udGVzdChyZWFsVXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVuZGVyVGV4dChyZWFsVXJsLCd0eHQnKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvXFxcXC5wZGYkLy50ZXN0KHJlYWxVcmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIng1Oi8vaHR0cHM6Ly9hbGlzdC1vcmcuZ2l0aHViLmlvL3BkZi5qcy93ZWIvdmlld2VyLmh0bWw/ZmlsZT1cXFwiICsgcmVhbFVybFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQuaXNPZmZpY2UocmVhbFVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwieDU6Ly9odHRwczovL3ZpZXcub2ZmaWNlYXBwcy5saXZlLmNvbS9vcC92aWV3LmFzcHg/c3JjPVxcXCIgKyByZWFsVXJsXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgc3ViX3VybHMgPSAkLmdldF9zdWJfdXJscygpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhc3N3b3JkID0gc3ViX3VybHMuZmluZCh4ID0+IHgudXJsLmluY2x1ZGVzKGJhc2V1cmwpKS5wYXNzd29yZCB8fCB7fTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXMgPSBKU09OLnBhcnNlKHBvc3QoYmFzZXVybCArIFxcXCIvYXBpL3B1YmxpYy9wcmV2aWV3XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkNvbnRlbnQtVHlwZVxcXCI6IFxcXCJhcHBsaWNhdGlvbi9qc29uXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBucGF0aCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmQ6IHBhc3N3b3JkW25wYXRoXSB8fCBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiAkLmdldFRpbWVPdXQoKSxcXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXMuZGF0YSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXMuZGF0YS5wcmV2aWV3X3VybCArICcmYWNjZXNzX3Rva2VuPScgKyByZXMuZGF0YS5hY2Nlc3NfdG9rZW47XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nICsgcmVzLm1lc3NhZ2U7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5peg5pWI5pON5L2cJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sYmFzZXVybCwgcGF0aCxucGF0aCxleHQsZGF2LnVzZXIsZGF2LnB3ZCxkYXYpO1xcblxcbiAgICB9XFxufVxcblxcbiQuZXhwb3J0cy5jbGlja0xhenkgPSBjbGlja0xhenk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCJ3ZWJEYXbkuIrkvKDmlofku7ZcIixcInBhdGhcIjpcIndlYmRhdlVwbG9hZFwiLFwicnVsZVwiOlwianM6XFxubGV0IGQ9W107XFxuc2V0UGFnZVRpdGxlKCdBbGlzdHx3ZWJkYXbkuIrkvKAnKTtcXG5hZGRMaXN0ZW5lcignb25DbG9zZScsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICByZWZyZXNoUGFnZShmY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YWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9IGZpbmRJdGVtKFxcXCJ3ZWJkYXZfcGF0aFxcXCIpLmV4dHJhO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKFxcXCJ3ZWJkYXZfcGF0aFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHRhcmdldCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCd3ZWJkYXZfcGF0aCcsUEFUSCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG9uQ2xpY2tUeXBlOidjb25maXJtJyxcXG4gICAgICAgICAgICBmaWxlVHlwZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgcGF0dGVybjogMCxcXG4gICAgICAgICAgICByZXF1aXJlVXJsOmZwLFxcbiAgICAgICAgICAgIGluaXRpYWxQYXRoOmdldFBhdGgoJ2hpa2VyOi8vZmlsZXMvJykuc2xpY2UoNyksXFxuICAgICAgICAgICAgbWVtb3J5Oid0cnVlJyxcXG4gICAgICAgIH0pO1xcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG59KTtcXG5cXG5zZXRSZXN1bHQoZClcIn1dIiwiaWNvbiI6Imh0dHBzOi8vY2RuLmpzZGVsaXZyLm5ldC9naC9hbGlzdC1vcmcvbG9nb0BtYWluL2Nhbl9jaXJjbGUuc3ZnIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment