xiaomianao666

小程序:哔哩Joe

Jan 11th, 2023
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@哔哩Joe @eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5ZOU5ZOpSm9lICIsImF1dGhvciI6IkpvZSAgIGJpbGliaWxpXG5cbua1t+mYlOinhueVjOmmlumhtemikemBk+inhOWImeOAkGJpbGliaWxp44CR77+laG9tZV9ydWxlX3VybO+/pWh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTU0OTRcbmh0dHBzOi8vY21kLmltLzNhNWZcbuWwj+eoi+W6j++8muWTlOWTqUpvZTEw5YaF5ZCr5Lul5LiLMTEuMjNcbmh0dHBzOi8vY21kLmltL3NiZmVcbuWwj+eoi+W6j++8muWTlOWTqUpvZTYgOS4yNOWGheWQq+S7peS4i1xu5L2/55So5YmN6aG755+lIOacrOinhOWImeiwg+eUqGh0dHBzOi8vZ2l0aHViLmNvbS9Tb2NpYWxTaXN0ZXJZaS9iaWxpYmlsaS1BUEktY29sbGVjdOeahGFwae+8jOaJgOacieS7o+eggeWFqOmDqOW8gOa6kO+8jOW5tuS4lOS4jeWtmOWcqOS4iuS8oOeUqOaIt+S/oeaBr+eahOihjOS4uiDmnKzop4TliJnkuLrlrabkuaDnm67nmoTvvIzor7fkuo7lr7zlhaUyNOWwj+aXtuWGheWIoOmZpO+8ge+8ge+8gSDlvIDlp4vkvb/nlKjmnKzop4TliJnljbPku6PooajpgbXlrojop4TliJlcblxuaHR0cHM6Ly9wYXN0ZW1lLnR5cmFudGcuY29tL3h4eHh4eC9ybWVnZm5lODlseXN5MWVpXG7lsI/nqIvluo/vvJrljoblj7LotrPov7lKb2UxMS4yN1xuY2Nj5bCP5qOJ6KKEXG5odHRwczovL2NtZC5pbS9wdWFkXG7lsI/nqIvluo/vvJrok53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CJhaWRcXFwiOiBpZFxcbiAgICB9KSwge1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiByZWFkRmlsZShcXFwiQ29va2llLnR4dFxcXCIpXFxuICAgICAgICB9XFxuICAgIH0pKS5kYXRhLmZhdm91cmVkXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogKGhhc0xpa2UgPyBjb2xvcihsaWtlLCBcXFwiI0ZBNzI5OFxcXCIpIDogbGlrZSksXFxuICAgICAgICBpbWc6IFxcXCJodHRwczovL2docHJveHkuY29tL2h0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9Tb2NpYWxTaXN0ZXJZaS9iaWxpYmlsaS1BUEktY29sbGVjdC9tYXN0ZXIvaW1ncy9saWtlLnN2Z1xcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfNFxcXCIsXFxuICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaWQsIGhhc0xpa2UpID0+IHtcXG4gICAgICAgICAgICBsZXQgY3NyZiA9IHJlYWRGaWxlKFxcXCJDb29raWUudHh0XFxcIikubWF0Y2goL2JpbGlfamN0PSguKj8pOy8pWzFdXFxuICAgICAgICAgICAgbGV0IHJlcyA9IHBvc3QoXFxcImh0dHA6Ly9hcGkuYmlsaWJpbGkuY29tL3gvd2ViLWludGVyZmFjZS9hcmNoaXZlL2xpa2VcXFwiLCB7XFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJhaWRcXFwiOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJsaWtlXFxcIjogKGhhc0xpa2UgPyAyIDogMSksXFxuICAgICAgICAgICAgICAgICAgICBcXFwiY3NyZlxcXCI6IGNzcmZcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICA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bHlcXFwiOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJjc3JmXFxcIjogY3NyZlxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogcmVhZEZpbGUoXFxcIkNvb2tpZS50eHRcXFwiKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aKleS6hlxcXCIgKyBpbnB1dCArIFxcXCLkuKrluIFcXFwiXFxuICAgICAgICB9LCBpZClcXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6IChoYXNGYXZvdXIgPyBjb2xvcihmYXZvdXJpdGUsIFxcXCIjRkE3Mjk4XFxcIikgOiBmYXZvdXJpdGUpLFxcbiAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly9naHByb3h5LmNvbS9odHRwczovL3Jhdy5naXRodWJ1c2VyY29udGVudC5jb20vU29jaWFsU2lzdGVyWWkvYmlsaWJpbGktQVBJLWNvbGxlY3QvbWFzdGVyL2ltZ3MvZmF2LnN2Z1xcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfNFxcXCIsXFxuICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaWQsIGhhc0Zhdm91cikgPT4ge1xcbiAgICAgICAgICAgIGxldCBib2R5ID0gaGFzRmF2b3VyID8ge1xcbiAgICAgICAgICAgICAgICBcXFwicmlkXFxcIjogaWQsXFxuICAgICAgICAgICAgICAgIFxcXCJ0eXBlXFxcIjogMixcXG4gICAgICAgICAgICAgICAgXFxcImRlbF9tZWRpYV9pZHNcXFwiOiAwLFxcbiAgICAgICAgICAgICAgICBcXFwiY3NyZlxcXCI6IGNzcmZcXG4gICAgICAgICAgICB9IDoge1xcbiAgICAgICAgICAgICAgICBcXFwicmlkXFxcIjogaWQsXFxuICAgICAgICAgICAgICAgIFxcXCJ0eXBlXFxcIjogMixcXG4gICAgICAgICAgICAgICAgXFxcImFkZF9tZWRpYV9pZHNcXFwiOiAwLFxcbiAgICAgICAgICAgICAgICBcXFwiY3NyZlxcXCI6IGNzcmZcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGNzcmYgPSByZWFkRmlsZShcXFwiQ29va2llLnR4dFxcXCIpLm1hdGNoKC9iaWxpX2pjdD0oLio/KTsvKVsxXVxcbiAgICAgICAgICAgIGxldCByZXMgPSBwb3N0KFxcXCJodHRwOi8vYXBpLmJpbGliaWxpLmNvbS9tZWRpYWxpc3QvZ2F0ZXdheS9jb2xsL3Jlc291cmNlL2RlYWxcXFwiLCB7XFxuICAgICAgICAgICAgICAgIGJvZHk6IGJvZHksXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiByZWFkRmlsZShcXFwiQ29va2llLnR4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6Ly93d3cuYmlsaWJpbGkuY29tXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyAoaGFzRmF2b3VyID8gXFxcIuWPlua2iOaUtuiXj1xcXCIgOiBcXFwi5pS26JeP5oiQ5YqfXFxcIilcXG4gICAgICAgIH0sIGlkLCBoYXNGYXZvdXIpXFxuICAgIH0sIHtcXG4gICAgICAgIHRpdGxlOiBcXFwi6K+E6K66XFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9Db21tZW50cz9wPWZ5cGFnZVxcXCIsXFxuICAgICAgICBpbWc6IFxcXCJ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0bGU6IFxcXCLmjqjpgIFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGlkLCBjaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlKFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vSm9lL1RWYm94LmpzXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4g5o6o6YCBdHZib3goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBcXFwi5o6o6YCBIGJ5IEpvZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvZDogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IFxcXCJiaWxpYmlsaVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBKU09OLnBhcnNlKCQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2FwaVxcXCIpLmxhenkoaWQsIGNpZCwgMTIwKS5yZXBsYWNlKC87L2csIFxcXCLvvJvvvJtcXFwiKSkudXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3d3dy5iaWxpYmlsaS5jb21cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSwgaWQsIGNpZClcXG4gICAgICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgICAgIFxcXCJpZFxcXCI6IFxcXCJxblxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgYS5zdXBwb3J0X2Zvcm1hdHMuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uZXdfZGVzY3JpcHRpb24sXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChpZCwgY2lkLCBxbikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2FwaVxcXCIpLmxhenkoaWQsIGNpZCwgcW4pLnJlcGxhY2UoLzsvZywgXFxcIu+8m++8m1xcXCIpXFxuICAgICAgICAgICAgICAgIH0sIGlkICsgXFxcIlxcXCIsIGNpZCArIFxcXCJcXFwiLCBpdGVtLnF1YWxpdHkgKyBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgcC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnBhcnQsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChpZCwgY2lkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvYXBpXFxcIikubGF6eShpZCwgY2lkLCAxMjApLnJlcGxhY2UoLzsvZywgXFxcIu+8m++8m1xcXCIpXFxuICAgICAgICAgICAgICAgIH0sIGlkLCBpdGVtLmNpZCArIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImNpZFxcXCI6IGl0ZW0uY2lkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImlkXFxcIjogaWQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiYnZpZFxcXCI6IGJ2aWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9XFxufSBjYXRjaCAoZSkge1xcbiAgICBsb2coZS5tZXNzYWdlKVxcbiAgICB0b2FzdChcXFwi56iL5bqP5Ye6546w6Zeu6aKY77yM6K+35omT5byA5pel5b+X5p+l55yLXFxcIilcXG59XFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Li76aG1XCIsXCJwYXRoXCI6XCJob21lcGFnZVwiLFwicnVsZVwiOlwidmFyIGQgPSBbXTtcXG50cnkge1xcbiAgICBjb25zdCB7XFxuICAgICAgICBnZXRGZWVkLFxcbiAgICAgICAgZ2V0VXNlckluZm9cXG4gICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2FwaVxcXCIpXFxuICAgIGlmIChmaWxlRXhpc3QoXFxcIkNvb2tpZS50eHRcXFwiKSkge1xcbiAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgIGxldCBpID0gZ2V0VXNlckluZm8oKVxcbiAgICAgICAgICAgIGQudW5zaGlmdCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpLnVuYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IGkuZmFjZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvdXNlckluZm9cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImRhdGFcXFwiOiBpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgIGZ1bmN0aW9uIGNvbG9yKHRleHQsIGNvbG9yKSB7XFxuICAgICAgICAgICAgICAgIHRleHQgKz0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgIGlmICh0ZXh0LmluZGV4T2YoXFxcIuKAnOKAnOKAneKAnVxcXCIpID09PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICB0ZXh0LnJlcGxhY2UoXFxcIuKAnOKAnOKAneKAnVxcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSdcXFwiICsgY29sb3IgKyBcXFwiJz5cXFwiICsgdGV4dCArIFxcXCI8L2ZvbnQ+XFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHRhYnMgPSB7XFxuICAgICAgICAgICAgICAgIFxcXCLmjqjojZBcXFwiOiBcXFwiaGlrZXI6Ly9pbWFnZXMvY29sbGVjdGlvblxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCLliIbnsbtcXFwiOiBcXFwiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vdmllLzY5LnN2Z1xcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCLmlrDnlapcXFwiOiBcXFwiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vdmllLzg0LnN2Z1xcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCLmiJHnmoRcXFwiOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbjNcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIE9iamVjdC5lbnRyaWVzKHRhYnMpLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXRlbVswXSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaXRlbVsxXSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKCh0YWIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwibW9kZVxcXCIsIHRhYilcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwgaXRlbVswXSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fcm91bmRfc21hbGxfNFxcXCJcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCJcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IG1vZGUgPSBnZXRNeVZhcihcXFwibW9kZVxcXCIsIFxcXCLmjqjojZBcXFwiKVxcbiAgICAgICAgaWYgKG1vZGUgPT0gXFxcIuaOqOiNkFxcXCIpIHtcXG4gICAgICAgICAgICBnZXRGZWVkKCkuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGEgPSBKU09OLnN0cmluZ2lmeShpdGVtKVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0udGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGl0ZW0ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogaXRlbS5zdGF0LnZpZXcgKyBcXFwi5pKt5pS+4oC7XFxcIiArIGl0ZW0uc3RhdC5saWtlICsgXFxcIueCuei1nlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZGV0YWlsI2dhbWVUaGVtZSNcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiaWRcXFwiOiBpdGVtLmlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJidmlkXFxcIjogaXRlbS5idmlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjaWRcXFwiOiBpdGVtLmNpZFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2UgaWYgKG1vZGUgPT0gXFxcIuaIkeeahFxcXCIpIHtcXG4gICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ2V0TXlWYXIoXFxcIndkXFxcIiwgXFxcImhpc3RvcnlcXFwiKSA9PSBcXFwiaGlzdG9yeVxcXCIgPyBjb2xvcihcXFwi6KeC55yL5Y6G5Y+yXFxcIiwgXFxcInJlZFxcXCIpIDogXFxcIuingueci+WOhuWPslxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcIndkXFxcIiwgXFxcImhpc3RvcnlcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIlxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ2V0TXlWYXIoXFxcIndkXFxcIiwgXFxcImhpc3RvcnlcXFwiKSA9PSBcXFwiZmF2XFxcIiA/IGNvbG9yKFxcXCLmlLbol49cXFwiLCBcXFwicmVkXFxcIikgOiBcXFwi5pS26JePXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwid2RcXFwiLCBcXFwiZmF2XFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCJcXG4gICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKFxcXCJ3ZFxcXCIsIFxcXCJoaXN0b3J5XFxcIikgPT0gXFxcInN1YlxcXCIgPyBjb2xvcihcXFwi5YWz5rOoXFxcIiwgXFxcInJlZFxcXCIpIDogXFxcIuWFs+azqFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcIndkXFxcIiwgXFxcInN1YlxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChnZXRNeVZhcihcXFwid2RcXFwiLCBcXFwiaGlzdG9yeVxcXCIpID09IFxcXCJoaXN0b3J5XFxcIikge1xcbiAgICAgICAgICAgICAgICBjb25zdCB7XFxuICAgICAgICAgICAgICAgICAgICBnZXRIaXN0b3J5XFxuICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9hcGlcXFwiKVxcbiAgICAgICAgICAgICAgICBnZXRIaXN0b3J5KE1ZX1BBR0UpLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXRlbS5waWMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2RldGFpbCNpbW1lcnNpdmVUaGVtZSNcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpZFxcXCI6IGl0ZW0uYWlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiYnZpZFxcXCI6IGl0ZW0uYnZpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNpZFxcXCI6IGl0ZW0uY2lkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGdldE15VmFyKFxcXCJ3ZFxcXCIsIFxcXCJoaXN0b3J5XFxcIikgPT0gXFxcImZhdlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRlYW1zID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvYXBpXFxcIikuZ2V0ZmF2dGVhbSgpWzBdLm1lZGlhTGlzdFJlc3BvbnNlLmxpc3RcXG4gICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGVhbXMuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogKGdldE15VmFyKFxcXCJmYXZvXFxcIiwgdGVhbXNbMF0uaWQgKyBcXFwiXFxcIikgPT0gaXRlbS5pZCA/IGNvbG9yKGl0ZW0udGl0bGUsIFxcXCJyZWRcXFwiKSA6IGl0ZW0udGl0bGUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJmYXZvXFxcIiwgaWQgKyBcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbS5pZClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9hcGlcXFwiKS5nZXRGYXZvdXIoZ2V0TXlWYXIoXFxcImZhdm9cXFwiLCB0ZWFtc1swXS5pZCArIFxcXCJcXFwiKSwgTVlfUEFHRSkubWVkaWFzLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXRlbS5jb3ZlcixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZGV0YWlsI2dhbWVUaGVtZSNcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpZFxcXCI6IGl0ZW0uaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjaWRcXFwiOiBpdGVtLnVnYy5maXJzdF9jaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJidmlkXFxcIjogaXRlbS5idmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9hcGlcXFwiKS5nZXRzbGlzdCgpLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IChnZXRNeVZhcihcXFwic3ViXFxcIiwgXFxcIjBcXFwiKSA9PSBpdGVtLnRhZ2lkID8gY29sb3IoaXRlbS5uYW1lLCBcXFwicmVkXFxcIikgOiBpdGVtLm5hbWUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJzdWJcXFwiLCBpZClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbS50YWdpZCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9hcGlcXFwiKS5nZXRTdWJzcmliZXMoZ2V0TXlWYXIoXFxcInN1YlxcXCIsIFxcXCIwXFxcIiksIE1ZX1BBR0UpLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnVuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXRlbS5mYWNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS91cHM/bWlkPVxcXCIgKyBpdGVtLm1pZCArIFxcXCImcD1meXBhZ2UjaW1tZXJzaXZlVGhlbWUjXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIGlmIChtb2RlID09IFxcXCLmlrDnlapcXFwiKSB7XFxuICAgICAgICAgICAgdmFyIHRhYnMgPSB7XFxuICAgICAgICAgICAgICAgIFxcXCLnlarliadcXFwiOiAxLFxcbiAgICAgICAgICAgICAgICBcXFwi55S15b2xXFxcIjogMyxcXG4gICAgICAgICAgICAgICAgXFxcIuWbveWIm1xcXCI6IDRcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyh0YWJzKS5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogKGdldE15VmFyKFxcXCJqdWppXFxcIiwgXFxcIueVquWJp1xcXCIpID09IGl0ZW0gPyBjb2xvcihpdGVtLCBcXFwicmVkXFxcIikgOiBpdGVtKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoYSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwianVqaVxcXCIsIGEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIh+aNouaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIlxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBsZXQgZGF5cyA9IDdcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDE7IGkgPCBkYXlzICsgMTsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAoZ2V0TXlWYXIoXFxcImZyb21cXFwiLCBcXFwiMVxcXCIpID09IGkgKyBcXFwiXFxcIiA/IGNvbG9yKGkgKyBcXFwi5aSp5YmNXFxcIiwgXFxcInJlZFxcXCIpIDogaSArIFxcXCLlpKnliY1cXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiZnJvbVxcXCIsIGkgKyBcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIlxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8IGRheXM7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogKGdldE15VmFyKFxcXCJ0b1xcXCIsIFxcXCIxXFxcIikgPT0gaSArIFxcXCJcXFwiID8gY29sb3IoaSArIFxcXCLlpKnlkI5cXFwiLCBcXFwicmVkXFxcIikgOiBpICsgXFxcIuWkqeWQjlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJ0b1xcXCIsIGkgKyBcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9hcGlcXFwiKS5nZXRNb3ZpZXModGFic1tnZXRNeVZhcihcXFwianVqaVxcXCIsIFxcXCLnlarliadcXFwiKV0sIGdldE15VmFyKFxcXCJmcm9tXFxcIiwgXFxcIjFcXFwiKSwgZ2V0TXlWYXIoXFxcInRvXFxcIiwgXFxcIjFcXFwiKSkuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0uZGF0ZSArIFxcXCIg5ZGoXFxcIiArIGl0ZW0uZGF5X29mX3dlZWssXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgaXRlbS5lcGlzb2Rlcy5mb3JFYWNoKGkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGkuY292ZXIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9kZXRhaWxhI2dhbWVUaGVtZSNcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNzaWRcXFwiOiBpLnNlYXNvbl9pZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJlcGlkXFxcIjogaS5lcGlzb2RlX2lkXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2UgaWYgKG1vZGUgPSBcXFwi5YiG57G7XFxcIikge1xcbiAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL2NhdFxcXCIpKS5ydWxlKVxcbiAgICAgICAgfVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgaWYgKGdldEl0ZW0oXFxcImZzXFxcIiwgXFxcIjBcXFwiKSA9PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICBsZXQgYSA9IFtdXFxuICAgICAgICAgICAgbGV0IHRpbWUgPSAxMFxcbiAgICAgICAgICAgIGEucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBgICAgICAgICAgICAgICAgICAgICAg5L2/55So5YmN6aG755+lXFxu5pys6KeE5YiZ6LCD55SoaHR0cHM6Ly9naXRodWIuY29tL1NvY2lhbFNpc3RlcllpL2JpbGliaWxpLUFQSS1jb2xsZWN055qEYXBp77yM5omA5pyJ5Luj56CB5YWo6YOo5byA5rqQ77yM5bm25LiU5LiN5a2Y5Zyo5LiK5Lyg55So5oi35L+h5oGv55qE6KGM5Li6XFxu5pys6KeE5YiZ5Li65a2m5Lmg55uu55qE77yM6K+35LqO5a+85YWlMjTlsI/ml7blhoXliKDpmaTvvIHvvIHvvIEgICAgICAgICAgICAgICAgICAgICAgICBcXG7lvIDlp4vkvb/nlKjmnKzop4TliJnljbPku6PooajpgbXlrojop4TliJkgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgIGAsXFxuICAgICAgICAgICAgICAgIFxcXCJjb2xfdHlwZVxcXCI6IFxcXCJsb25nX3RleHRcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJ0ZXh0XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGltZSArIFxcXCLnp5LlkI7nu6fnu61cXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogXFxcInRpbWVyXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBzZXRSZXN1bHQoYSlcXG4gICAgICAgICAgICB3aGlsZSAodGltZSAhPSAwKSB7XFxuICAgICAgICAgICAgICAgIGphdmEubGFuZy5UaHJlYWQuc2xlZXAoMTAwMClcXG4gICAgICAgICAgICAgICAgdGltZSAtPSAxXFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcInRpbWVyXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpbWUgKyBcXFwi56eS5ZCO57un57utXFxcIlxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB1cGRhdGVJdGVtKFxcXCJ0aW1lclxcXCIsIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmiJHlt7Lnn6XmmZNcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJmc1xcXCIsIFxcXCIxXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kvaDlt7Lnoa7orqRcXFwiXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvbG9naW5cXFwiKVxcbiAgICAgICAgfVxcbiAgICB9XFxufSBjYXRjaCAoZSkge1xcbiAgICBsb2coZS5tZXNzYWdlKVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Y2VudGVyPjxzbWFsbD48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICM5OTk5OTlcXFwiPu+9nu+9nu+9nuaIkeaYr+acieW6lee6v+eahO+9nu+9nu+9njwvc3Bhbj48L3NtYWxsPjwvY2VudGVyPicsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9KVxcbn1cXG5zZXRSZXN1bHQoZCk7XCJ9LHtcImNvbF90eXBlXCI6XCJpY29uXzJfcm91bmRcIixcIm5hbWVcIjpcIueUqOaIt+ivpuaDhVwiLFwicGF0aFwiOlwidXNlckluZm9cIixcInJ1bGVcIjpcImpzOlxcbnZhciBkID0gW107XFxubGV0IGluZm8gPSBNWV9QQVJBTVMuZGF0YVxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBpb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XCI6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImNzcmZcXFwiOiBjc3JmLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm1lc3NhZ2VcXFwiOiBpbnB1dFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogcmVhZEZpbGUoXFxcIkNvb2tpZS50eHRcXFwiKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICB9LCBpZClcXG4gICAgfSlcXG59XFxudmFyIHRhYnMgPSBbXFxcIueDreW6plxcXCIsIFxcXCLml7bpl7RcXFwiXVxcbnRhYnMuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBpdGVtLFxcbiAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICBwdXRNeVZhcihcXFwic29ydGJ5XFxcIiwgaSlcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgfSwgaXRlbSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiXFxuICAgIH0pXFxufSlcXG5sZXQgZGF0YSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2FwaVxcXCIpLmdldENvbW1lbnRzKGlkLCBnZXRNeVZhcihcXFwic29ydGJ5XFxcIiwgXFxcIueDreW6plxcXCIpLCBNWV9QQUdFKVxcbmRhdGEuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBpdGVtLm1lbWJlci51bmFtZSxcXG4gICAgICAgIGltZzogaXRlbS5tZW1iZXIuYXZhdGFyLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL3Vwcz9taWQ9XFxcIiArIGl0ZW0ubWVtYmVyLm1pZCArIFxcXCIjaW1tZXJzaXZlVGhlbWUjXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIlxcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGl0ZW0uY29udGVudC5tZXNzYWdlLFxcbiAgICAgICAgZGVzYzogaXRlbS5yZXBseV9jb250cm9sLmxvY2F0aW9uICsgXFxcIiBcXFwiICsgaXRlbS5yZXBseV9jb250cm9sLnRpbWVfZGVzYyxcXG4gICAgICAgIHVybDogJCgpLnJ1bGUoKHRleHQsIG9pZCwgcnBpZCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBkID0gW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRleHQsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibG9uZ190ZXh0XFxcIlxcbiAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgbGV0IHJlcGx5ID0gcmVxdWVzdChidWlsZFVybChcXFwiaHR0cDovL2FwaS5iaWxpYmlsaS5jb20veC92Mi9yZXBseS9yZXBseVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgXFxcInR5cGVcXFwiOiAxLFxcbiAgICAgICAgICAgICAgICBcXFwib2lkXFxcIjogb2lkLFxcbiAgICAgICAgICAgICAgICBcXFwicm9vdFxcXCI6IHJwaWRcXG4gICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogcmVhZEZpbGUoXFxcIkNvb2tpZS50eHRcXFwiKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVcXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBKU09OLnBhcnNlKHJlcGx5KS5kYXRhLnJlcGxpZXMuZm9yRWFjaChpdGVtID0+IHtcXG5cXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubWVtYmVyLnVuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXRlbS5tZW1iZXIuYXZhdGFyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS91cHM/bWlkPVxcXCIgKyBpdGVtLm1lbWJlci5taWQgKyBcXFwiI2ltbWVyc2l2ZVRoZW1lI1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0uY29udGVudC5tZXNzYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGl0ZW0ucmVwbHlfY29udHJvbC5sb2NhdGlvbiArIFxcXCIgXFxcIiArIGl0ZW0ucmVwbHlfY29udHJvbC50aW1lX2Rlc2MsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgc2V0UmVzdWx0KGQpXFxuICAgICAgICB9LCBpdGVtLmNvbnRlbnQubWVzc2FnZSwgaWQsIGl0ZW0ucnBpZCArIFxcXCJcXFwiKVxcbiAgICB9KVxcbn0pXFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2x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YWRlcnM6IHtcXG4gICAgICAgICAgICBcXFwiQ29va2llXFxcIjogY29va2llXFxuICAgICAgICB9XFxuICAgIH0pKS5kYXRhLnJlc3VsdFxcbiAgICBpZiAodHlwZSA9PSBcXFwiYmlsaV91c2VyXFxcIikge1xcbiAgICAgICAgcmVzLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0udW5hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogXFxcImh0dHBzOlxcXCIgKyBpdGVtLnVwaWMsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS91cHM/bWlkPVxcXCIgKyBpdGVtLm1pZCArIFxcXCIjZ2FtZVRoZW1lI1xcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgcmVzLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgaWYgKGl0ZW0uaXNfYXZpZCAhPSBmYWxzZSkge1xcbiAgICAgICAgICAgICAgICB2YXIgcCA9IEpTT04ucGFyc2UocmVxdWVzdChidWlsZFVybChcXFwiaHR0cDovL2FwaS5iaWxpYmlsaS5jb20veC9wbGF5ZXIvcGFnZWxpc3RcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiYWlkXFxcIjogaXRlbS5haWRcXG4gICAgICAgICAgICAgICAgfSkpKS5kYXRhXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS50aXRsZS5yZXBsYWNlKC88W14+XSo+fDxcXFxcL1tePl0qPi9nbSwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaHR0cHM6XFxcIiArIGl0ZW0ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2RldGFpbCNnYW1lVGhlbWUjXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImlkXFxcIjogaXRlbS5haWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImJ2aWRcXFwiOiBpdGVtLmJ2aWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNpZFxcXCI6IHBbMF0uY2lkXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnRpdGxlLnJlcGxhY2UoLzxbXj5dKj58PFxcXFwvW14+XSo+L2dtLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGl0ZW0uY292ZXIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZGV0YWlsYSNnYW1lVGhlbWUjXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNzaWRcXFwiOiBpdGVtLnNlYXNvbl9pZFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG59IGNhdGNoIChlKSB7XFxuICAgIGxvZyhlLm1lc3NhZ2UpXFxuICAgIHNldFJlc3VsdChbe1xcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Y2VudGVyPjxzbWFsbD48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICM5OTk5OTlcXFwiPu+9nu+9nu+9nuaIkeaYr+acieW6lee6v+eahO+9nu+9nu+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29yaWVzS2V5LnRpdGxlXVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IGVzY2FwZShpdGVtW0NhdGVnb3JpZXNIZWFkZXIuY2F0ZWdvcmllc0tleS51cmxdKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHVybExpc3RlbmVyKSB1cmwgPSB1cmxMaXN0ZW5lci5vbkRlYWwoaXRlbSwgc3ViX2NhdGVnb3J5X25hbWUsIHVybClcXG4gICAgICAgICAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiAjRkE3Mjk4XFxcIj4nICsgdGl0bGUgKyAnPC9zcGFuPjwvYj4nIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHVybCkubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwgKyBcXFwiI1xcXCIgKyBwYXJhbXMuc3ViX2NhdGVnb3J5X25hbWUsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3J5X25hbWU6IHN1Yl9jYXRlZ29yeV9uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgIH1cXG59XFxuJC5leHBvcnRzLkNhdGVnb3JpZXNIZWFkZXI9Q2F0ZWdvcmllc0hlYWRlclwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5YiG57G7IEJ5IFJ4XCIsXCJwYXRoXCI6XCJjYXRcIixcInJ1bGVcIjpcImNvbnN0IHtcXG4gICAgQ2F0ZWdvcmllc0hlYWRlclxcbn0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9jYXRlZ29yaWVzLWhlYWRlclxcXCIpXFxubGV0IG1DYXRlZ29yaWVzID0ge31cXG5sZXQgY2F0VXJsID0gJ2h0dHBzOi8vd3d3LmJpbGliaWxpLmNvbS9hbmltZS9pbmRleC8nXFxubGV0IGNhdFNyYyA9IHJlcXVlc3QoY2F0VXJsKVxcbi8vIGxvZyhjYXRTcmM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GUgLyorICcvJyArIGRhdGEuaW5kZXhfc2hvdyovICxcXG4gICAgICAgICAgICBkZXNjOiBkYXRhLm9yZGVyLFxcbiAgICAgICAgICAgIGltZzogZGF0YS5jb3ZlcixcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsYSNnYW1lVGhlbWUjJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJtZWRpYV9pZFxcXCI6IGRhdGEubWVkaWFfaWQsXFxuICAgICAgICAgICAgICAgIFxcXCJzc2lkXFxcIjogZGF0YS5zZWFzb25faWRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbn0gY2F0Y2ggKGUpIHtcXG4gICAgbG9nKGUubWVzc2FnZSlcXG59XCJ9XSIsImljb24iOiJodHRwczovL3MxLmF4MXguY29tLzIwMjIvMTAvMjAveDZFMlUxLmpwZyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment