xiaomianao666

小程序:番·仓✈️

Jan 15th, 2024
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@番·仓✈️@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6ImpzOlxudmFyIGNocCA9IFtdO1xudHJ5IHtcbiAgICB2YXIgaHRtbCA9IGdldFJlc0NvZGUoKTtcbiAgICB2YXIgY29udHMgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICdib2R5JiYuc29ydC1pdGVtJyk7XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb250cy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIgbGlzdCA9IHBkZmEoY29udHNbaV0sICdib2R5JiZhJyk7XG4gICAgICAgIGNocC5wdXNoKGxpc3QubGVuZ3RoKTtcbiAgICB9ICAgICBcbn0gY2F0Y2ggKGUpIHt9XG5zZXRSZXN1bHQoJ+abtOaWsOiHszonICsgKE1hdGgubWF4LmFwcGx5KG51bGwsIGNocCkpKTsiLCJ0aXRsZSI6IueVqsK35LuT4pyI77iPIiwiYXV0aG9yIjoiUiIsInVybCI6Imhpa2VyOi8vZW1wdHkjIy9mb3J1bS0xLmh0bSMjZnlwYWdlIiwidmVyc2lvbiI6MjAyMzExMDgsImNvbF90eXBlIjoibW92aWVfMiIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidmlkZW8iLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbnZhciBkID0gW107XG4vL2V2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvcmVwYWlyJykpLnJ1bGUpO1xuYWRkTGlzdGVuZXIoXCJvbkNsb3NlXCIsICQudG9TdHJpbmcoK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AgICBpZiAoaW5wdXQgPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICBpbnB1dCA9IHRydWU7XFxuICAgICAgfVxcbiAgICAgIHRoaXMuaXNCb29sZWFuKGlucHV0KTtcXG4gICAgICB0aGlzLm9wZW4gPSBpbnB1dDtcXG4gICAgICByZXR1cm4gdGhpcztcXG4gICAgfSxcXG4gICAgc2V0VGl0bGUoaywgaSwgdCkge1xcbiAgICAgIHJldHVybiBrID09IGkgPyBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIHQuZm9udGNvbG9yKHRoaXMu5YiG57G76aKc6ImyKSA6IHQ7XFxuICAgIH0sXFxuICAgIGFjdGlvbihvYmopIHtcXG4gICAgICByZXR1cm4gW1xcbiAgICAgICAge1xcbiAgICAgICAgICB0aXRsZTogXFxcIua4hemZpOeKtuaAgVxcXCIsXFxuICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChvYmopID0+IHtcXG4gICAgICAgICAgICBsb2cob2JqKTtcXG4gICAgICAgICAgICBjbGVhck15VmFyKG9iai5zdGF0ZSk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiaGVhZC5jYXRlXFxcIik7XFxuICAgICAgICAgICAgb2JqLmFsbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIG9iai5jbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgIH0sIG9iaiksXFxuICAgICAgICB9LFxcbiAgICAgIF07XFxuICAgIH0sXFxuICAgIGNoZWNrUGFyYW0oKSB7XFxuICAgICAgdmFyIG9iaiA9IHt9O1xcbiAgICAgIGlmICh0aGlzLnBhZ2UgPT0gMCAmJiB0eXBlb2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cXG4gICAgICAgICAgICB2YXIgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgeCk7XFxuICAgICAgICAgICAgdmFyIG9iaiA9IHsgdGl0bGU6IHRpdGxlLCB1cmw6IHVybCB9O1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShvYmopO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgcmV0dXJuIOWumuS9jTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgLy9sb2co5LiA57qnKVxcbiAgICAgICAgLy9sb2co5LiA57qnLmxlbmd0aClcXG4gICAgICAgIGlmICjkuIDnuqcubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKOS4gOe6py5qb2luKFxcXCJcXFxcblxcXCIpKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgIOS4gOe6py5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKGl0ZW0uam9pbihcXFwiLFxcXCIpKTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhjYXRlZ29yaWVzKVxcbiAgICAgIH0pO1xcbiAgICAgIGlmICjmipjlj6DnirbmgIEpIHtcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogZm9sZCA9PT0gXFxcIjFcXFwiID8g5oqY5Y+gIDog5bGV5byALFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShcXG4gICAgICAgICAgICAgIChmb2xkLCB1LCBhbGwpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCA9PT0gXFxcIjFcXFwiID8gXFxcIjBcXFwiIDogXFxcIjFcXFwiKTtcXG4gICAgICAgICAgICAgICAgLyphbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pOyovXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICBmb2xkLFxcbiAgICAgICAgICAgICAg54q25oCBLFxcbiAgICAgICAgICAgICAg5YWo5riFXFxuICAgICAgICAgICAgKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICBsb25nQ2xpY2s6IHRoaXMuYWN0aW9uKHtcXG4gICAgICAgICAgICAgICAgc3RhdGU6IOeKtuaAgSxcXG4gICAgICAgICAgICAgICAgYWxsOiDlhajmuIUsXFxuICAgICAgICAgICAgICAgIGNsOiDmuIXpmaQsXFxuICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICB9XFxuICAgICAgaWYgKHBhZ2UgPT0gMSkge1xcbiAgICAgIGNhdGVnb3JpZXMuZm9yRWFjaCgoY2F0ZWdvcnksIGluZGV4KSA9PiB7XFxuICAgICAgICAvL2xvZyhjYXRlZ29yaWVzKVxcbiAgICAgICAgbGV0IHN1Yl9jYXRlZ29yaWVzID0gW107XFxuICAgICAgICAvKmlmICjlsI/nsbvlrprkvY0uaW5jbHVkZXMoXFxcIjtcXFwiKSkge1xcbiAgICAgICAgICBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jS5zcGxpdChcXFwiO1xcXCIpWzBdKTtcXG4gICAgICAgICAgaWYgKHN1Yl9jYXRlZ29yaWVzLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0uc3BsaXQoXFxcIjtcXFwiKVsxXSk7XFxuICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7Ki9cXG4gICAgICAgIC8vbG9nKGluZGV4KVxcbiAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBKU09OLnBhcnNlKGBbJHtjYXRlZ29yeX1dYCk7XFxuICAgICAgICAvLyBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jSk7XFxuICAgICAgICAvL31cXG4gICAgICAgIGlmIChpbmRleCA9PT0gMCkge1xcbiAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG5cXG4gICAgICAgICAgICAvL2xldCB0aXRsZSA9IHBkZmgoaXRlbSwgX+Wkp+exu+agh+mimCk7XFxuICAgICAgICAgICAgbGV0IHRpdGxlID0gaXRlbS50aXRsZTtcXG4gICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXdSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBqc29uPScnXFxuICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgIFxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgIGNsZWFyczog5riF6ZmkLFxcbiAgICAgICAgICAgICAganNvbjoganNvbixcXG4gICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXG4gICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgIC8vbGV0IHVybCA9IHBkKGl0ZW0sIF/lpKfnsbvpk77mjqUpO1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAvKmlmICjlpKfnsbvlpITnkIYpIHtcXG4gICAgICAgICAgICAgIHVybCA9IOS4gOe6p+WIhuexu+WkhOeQhih1cmwpO1xcbiAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgIC8vbG9nKHVybClcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW107XFxuICAgICAgICAgICAgICAgIHBhcmFtcy5jbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSk7XFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhbXMuanNvbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICB9LCBwYXJhbXMpLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGZvbGQgPT09IFxcXCIxXFxcIiB8fCDmipjlj6DnirbmgIEgPT0gZmFsc2UpIHtcXG4gICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgdmFyIGV4dHJhcG9zID0gZmFsc2U7XFxuICAgICAgICA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TtcXG4gICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgIHZhciBqc29uID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAvKnN3aXRjaCAodHJ1ZSkge1xcbiAgICAgICAgICAgICAgICBjYXNlIOWIhuexu+mTvuaOpS5pbmNsdWRlcyhcXFwiQEBAXFxcIik6XFxuICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQEBcXFwiKVswXSksXFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAQFxcXCIpWzFdKSxcXG4gICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlIOWIhuexu+mTvuaOpS5pbmNsdWRlcyhcXFwiQEBcXFwiKTpcXG4gICAgICAgICAgICAgICAgICBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZTog5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQFxcXCIpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQFxcXCIpWzFdKSxcXG4gICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgICAgICAvLyBqc29uID0gcGQoaXRlbSwg5YiG57G76ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgICAgLyp2YXIganNvbj3liIbnsbvpk77mjqUuaW5jbHVkZXMoJ0BAQCcpP3tcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEBAJylbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEBAJylbMV0pLFxcbiAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQCcpP3tcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU65YiG57G76ZO+5o6lLnNwbGl0KCdAQCcpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpOyovXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eVxcXCIgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKCk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSk7XFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhbXMuanNvbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgIH0sIHBhcmFtcyksXFxuICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICA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AgICB2YXIgdXJsID0gdGhpcy51cmxIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICB2YXIgY29udGVudCA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmNvbnRlbnQpO1xcbiAgICAgICAgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgIGlkID0gXFxcImxhc3RpZF9cXFwiICsgcGFnZTtcXG4gICAgICAgICAgY2xzID0gXFxcImxhc3RtYXJrXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZXI/dXJsPVxcXCIgKyB1cmwsXFxuICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXFxuICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgY2xzOiBjbHMsXFxuICAgICAgICAgIH0sXFxuICAgICAgICB9KTtcXG4gICAgICAgIGlmIChpID09IGxpc3QubGVuZ3RoIC0gMSAmJiBzaG93KSB7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgaWQ6IFxcXCJwYWdlbGluZVxcXCIsXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08c21hbGw+5Yqg6L295L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NoKHtcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXCIjRkYwMDAwXFxcIj4gVGhpc0FWPC9mb250PjwvbWlkZGxlPicsXFxuICAgIHBpY191cmw6ICdodHRwOi8vaW1hZ2UuY29vbGFway5jb20vL2Fwa19sb2dvLzIwMjIvMDUwNy8xNC8wXzM4MjhfNzI1NF82MzlAMjYweDI2MC5wbmcudC5wbmcnLFxcbiAgICB1cmw6ICQoJycpLmxhenlSdWxlKCjnlarlj7cpID0+IHtcXG4gICAgICAgICAgICAgICAgIHZhciBhdiA9IFxcXCJodHRwczovL3RoaXNhdi5jb20vY24vXFxcIiArIOeVquWPtzsgXFxubG9nKGF2KVxcbiAgICAgICAgICAgICAgdHJ5e1xcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdiwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogJ01vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjApJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgIGV2YWwoaHRtbC5tYXRjaCgvZXZhbC4qP1xcXFxuLylbMF0pXFxuICAgICAgICAgICAgICAgICByZXR1cm4gc291cmNlICsgJzt7UmVmZXJlckBodHRwczovL3RoaXNhdi5jb219J1xcbiAgICAgICAgICAgICAgICAgfWNhdGNoe3JldHVybiBcXFwidG9hc3Q6Ly/mjILmoq/miJbmsqHmnInmraTlvbHniYdcXFwifVxcbiAgICAgICAgICAgICAgICAgIH0s55Wq5Y+3KSxcXG4gICAgY29sX3R5cGU6ICdpY29uX3NtYWxsXzQnLFxcbn0pO1xcblxcbi8vbmphdlxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+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Z2h1aS5jb20vaWNvbi8xMjgvNzAwMDQ3OC5wbmcnLFxcbiAgICB1cmw6ICQoJycpLmxhenlSdWxlKCjnlarlj7cpID0+IHtcXG4gICAgICAgICAgICAgICAgIHZhciBhdiA9IFxcXCJodHRwczovL2phdndhbi50dy9qYXYvXFxcIiArIOeVquWPty5yZXBsYWNlKC8tL2csXFxcIlxcXCIpICsgXFxcIi9cXFwiOyAgICAgICBcXG5sb2coYXYpICAgIFxcbiAgICAgICAgICAgICAgdHJ5e1xcbiAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdilcXG4gICAgICAgIHZhciBpbmZvID0gcGRmaChodG1sLCAnI3Bvc3QtZGF0YSYmSHRtbCcpXFxuICAgICAgICBsZXQgdXJsID0gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICB2YXIgcGxheWVyID0gcGRmaChpbmZvLCAnI3BsYXllci13aWR0aCYmSHRtbCcpXFxuICAgICAgICB2YXIgaWZyYW1lID0gcGxheWVyLm1hdGNoKC9pZD1cXFwiaWZyYW1lXFxcIi8pXFxuICAgICAgICBpZiAoaWZyYW1lKSB7XFxuICAgICAgICAgICAgbGV0IGlmcmFtZV9jb250ZXh0ID0gJydcXG4gICAgICAgICAgICBsZXQgaWZyYW1lX3NyYyA9ICcnXFxuICAgICAgICAgICAgbGV0IHNjcmlwdCA9IHBkZmgocGxheWVyLCAnc2NyaXB0JiZIdG1sJykucmVwbGFjZSgncmV0dXJuIHAnLCAnaWZyYW1lX2NvbnRleHQgPSBwJylcXG4gICAgICAgICAgICBldmFsKHNjcmlwdClcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBpZnJhbWVfc3JjID0gaWZyYW1lX2NvbnRleHQubWF0Y2goL3NyYz1cXFwiKC4qPylcXFwiLylbMV1cXG4gICAgICAgICAgICB9Y2F0Y2goZSl7fVxcblxcbiAgICAgICAgICAgIGlmIChpZnJhbWVfc3JjKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IH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CwgaW5kZXgpLnRyaW0oKTtcXG4gICAgICAgICAgICB2YXIgdmFsdWUgPSB4LnN1YnN0cmluZyhpbmRleCArIDEpO1xcbiAgICAgICAgICAgIGNvb2tpZXNba2V5XSA9IHZhbHVlO1xcbiAgICAgICAgfSlcXG4gICAgfVxcbn0pO1xcblxcbmZ1bmN0aW9uIGd1YXJkKHVybCwgaGVhZG9iaikge1xcbiAgICB2YXIgaGVhZCA9IGhlYWRvYmogPyBoZWFkb2JqOntcXG4gICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICBDb29raWU6IGdldENvb2tpZSh1cmwpLFxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIHZhciBodG1sID0gZmV0Y2godXJsLCBoZWFkKTtcXG4gICAgaWYgKGh0bWwuaW5jbHVkZXMoJ19ndWFyZC9hdXRvLmpzJykpIHtcXG4gICAgICAgIGRvY3VtZW50W1xcXCJjb29raWVcXFwiXSA9IGdldENvb2tpZSh1cmwpO1xcbiAgICAgICAgZXZhbChmZXRjaChnZXRIb21lKHVybCkgKyAnL19ndWFyZC9hdXRvLmpzJykpXFxuICAgICAgICBodG1sID0gZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICBDb29raWU6IGRvY3VtZW50W1xcXCJjb29raWVcXFwiXSxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICAvL2xvZyhkb2N1bWVudFtcXFwiY29va2llXFxcIl0pXFxuICAgIHJldHVybiBodG1sXFxufVxcbmZ1bmN0aW9uIGNzcGxpdChhLCBiLCBjKSB7XFxuICAgIGIgPSBwYXJzZUludChiLCAxMCkgfHwgNzY7XFxuICAgIGMgPSBjIHx8ICdcXFxcclxcXFxuJztcXG4gICAgaWYgKGIgPCAxKSB7XFxuICAgICAgICByZXR1cm4gZmFsc2VcXG4gICAgfVxcbiAgICByZXR1cm4gYS5tYXRjaChuZXcgUmVnRXhwKFxcXCIuezAsXFxcIiArIGIgKyBcXFwifVxcXCIsXFxcImdcXFwiKSkuam9pbihjKVxcbn1cXG5mdW5jdGlvbiByZXVybChhKSB7XFxuICAgIHZhciBiID0gJyc7XFxuICAgIHZhciBjID0gY3NwbGl0KGEsIDgpLnNwbGl0KCdcXFxcclxcXFxuJyk7XFxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgKGMubGVuZ3RoIC0gMSk7IGkrKykge1xcbiAgICAgICAgYiA9IGIgKyBTdHJpbmcuZnJvbUNoYXJDb2RlKChwYXJzZUludChjW2ldLCAyKSAtIDEwKS50b1N0cmluZygxMCkpXFxuICAgIH1cXG4gICAgcmV0dXJuIGJcXG59XCJ9XSIsImljb24iOiJodHRwczovL2NkbjQuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9lc3NlbnRpYWxzLTc0LzI0LzAwMl8tX1NlYXJjaC0xMjgucG5nIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment