Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@聚直播@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6IGa55u05pKtIiwiYXV0aG9yIjoi5bCP5qOJ6KKE8J+MniZKb2tlciIsInVybCI6Imhpa2VyOi8vZW1wdHkiLCJ2ZXJzaW9uIjoxMCwiY29sX3R5cGUiOiJpY29uXzJfcm91bmQiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6ImxpdmUiLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbmV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1wiKSkucnVsZSk7IC8vZ2V0Q29uZmlnXG5cbmxldCBkYXRhID0gW10sXG4gICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XG5jb25maWcuZGF0YSA9IGNvbmZpZy5kYXRhLmZpbHRlcih2ID0+ICF2LmluVmlzaWJsZSk7XG5pZiAoY29uZmlnLmRhdGEubGVuZ3RoIDw9IDApIHtcbiAgICBkYXRhID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvcmVuZGVyU2V0dGluZycpLnJlbmRlclNldHRpbmcoKTtcbn0gZWxzZSB7XG4gICAgbGV0IHNlbGVjdCA9IGdldEl0ZW0oXCJsaXZlLXNlbGVjdFwiLCBjb25maWcuZGF0YVswXS5uYW1lKSxcbiAgICAgICAgaGFzID0gY29uZmlnLmRhdGEubWFwKGkgPT4gaS5uYW1lKS5pbmNsdWRlcyhzZWxlY3QpO1xuICAgIGlmICghaGFzKSB7XG4gICAgICAgIHNlbGVjdCA9IGNvbmZpZy5kYXRhWzBdLm5hbWU7XG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gICAgICAgICAgIGxldCBzZWxlY3RHcm91cCA9IGdldEl0ZW0oJ3NlbGVjdEdyb3VwJywgZ3JvdXBzWzBdKTtcbiAgICAgICAgICAgICAgICBpZiAoc2VsZWN0R3JvdXAgPT0gXCJcIiB8fCAhZ3JvdXBzLmluY2x1ZGVzKHNlbGVjdEdyb3VwKSkgc2VsZWN0R3JvdXAgPSBncm91cHNbMF07XG4gICAgICAgICAgICAgICAgZ3JvdXBzLmZvckVhY2goKGdyb3VwKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChncm91cCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ3JvdXAgPT0gc2VsZWN0R3JvdXAgPyBcIuKAnOKAnOKAneKAnTxzcGFuIHN0eWxlPSdjb2xvcjogIzE5Qjg5RCc+XCIgKyBncm91cCArIFwiPC9zcGFuPlwiIDogZ3JvdXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChncm91cCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCdzZWxlY3RHcm91cCcsIGdyb3VwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGdyb3VwKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgIGZvciAobGV0IHRpdGxlIGluIGl0ZW1zW3NlbGVjdEdyb3VwXSkge1xuICAgICAgICAgICAgICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKHNvdXJjZXVybCxzZWxlY3RHcm91cCx0aXRsZSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpdGVtcyA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL3JlbmRlckRhdGEnKS5yZW5kZXJMaXZlRGF0YShzb3VyY2V1cmwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdXJscyA9IGl0ZW1zW3NlbGVjdEdyb3VwXVt0aXRsZV0udXJsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzaGVhZGVycyA9IGl0ZW1zW3NlbGVjdEdyb3VwXVt0aXRsZV0uaGVhZGVycztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBncm91cGkgaW4gaXRlbXMpe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ3JvdXAgPSBpdGVtc1tncm91cGldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighZ3JvdXApIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdGl0bGUgaW4gZ3JvdXApe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXRpdGxlID09IHRpdGxlICYmICEhZ3JvdXBbaXRpdGxlXSl7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybHMgPSBncm91cFtpdGl0bGVdLnVybDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaGVhZGVycyA9IGdyb3VwW2l0aXRsZV0uaGVhZGVycztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1cmxzID0gc3VybHMuY29uY2F0KHVybHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hlYWRlcnMgPSBzaGVhZGVycy5jb25jYXQoaGVhZGVycyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VybHMgPSBBcnJheS5mcm9tKG5ldyBTZXQoc3VybHMpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGVhZGVycyA9IEFycmF5LmZyb20obmV3IFNldChzaGVhZGVycykpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IHN1cmxzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBzaGVhZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICB9LHNvdXJjZS51cmwsc2VsZWN0R3JvdXAsdGl0bGUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9jb2xfdHlwZTogJ3RleHRfMycsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFwiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMjI4LnBuZ1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlb0V4Y2x1ZGVSdWxlczogW1wiLnBocD9pZD1cIl1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5pWw5o2u5Yqg6L295aSx6LSlXFxuXCIgKyBKU09OLnN0cmluZ2lmeShlKSxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFwibG9uZ190ZXh0XCJcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG5cblxufVxuc2V0UmVzdWx0KGRhdGEpOyIsInNlYXJjaF91cmwiOiJoaWtlcjovL2VtcHR5P2tleT0qKiIsImdyb3VwIjoi4pGl55u05pKtIiwic2VhcmNoRmluZCI6ImpzOlxuZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXCJoaWtlcjovL3BhZ2UvY29uZmlnXCIpKS5ydWxlKTtcbmxldCBjb25maWcgPSBnZXRDb25maWcoKTtcbmxldCBydWxlcyA9IGNvbmZpZy5kYXRhLm1hcCgoc291cmNlKSA9PiB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgdGl0bGU6IHNvdXJjZS5uYW1lLFxuICAgICAgICBzZWFyY2hfdXJsOiAnaGlrZXI6Ly9lbXB0eT9rZXk9KionLFxuICAgICAgICBzZWFyY2hGaW5kOiAnanM6JyArICQudG9TdHJpbmcoKHVybCwgcnVsZV90aXRsZSkgPT4ge1xuICAgICAgICAgICAgbGV0IGQgPSBbXSxcbiAgICAgICAgICAgICAgICBrZXkgPSBnZXRQYXJhbSgna2V5Jyk7XG4gICAgICAgICAgICBsZXQgaXRlbXMgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9yZW5kZXJEYXRhP3J1bGU9JyArIHJ1bGVfdGl0bGUpLnJlbmRlckxpdmVEYXRhKHVybCk7XG4gICAgICAgICAgICBmb3IgKGxldCBncm91cCBpbiBpdGVtcykge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IHRpdGxlIGluIGl0ZW1zW2dyb3VwXSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGl0bGUuaW5kZXhPZihrZXkpID49IDAgfHwgdGl0bGUudG9Mb3dlckNhc2UoKS5pbmRleE9mKGtleSkgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IGl0ZW1zW2dyb3VwXVt0aXRsZV0udXJsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBpdGVtc1tncm91cF1bdGl0bGVdLmhlYWRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNldFJlc3VsdChkKTtcbiAgICAgICAgfSwgc291cmNlLnVybCwgZ2V0TXlWYXIoJ3RpdGxlJykpXG4gICAgfTtcbn0pXG5zZXRSZXN1bHQoW3tcbiAgICB0aXRsZTogXCLngrnmiJHlvIDlp4vogZrmkJxcIixcbiAgICB1cmw6IFwiaGlrZXI6Ly9zZWFyY2g/cz1cIiArIGdldFBhcmFtKFwia2V5XCIpLFxuICAgIGV4dHJhOiB7XG4gICAgICAgIHJ1bGVzOiAkLnRvU3RyaW5nKChydWxlcykgPT4ge1xuICAgICAgICAgICAgcmV0d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Bncm91cCA9IGlbMl07XFxuICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgdGl0bGUgPSBpWzJdLFxcbiAgICAgICAgICAgIHVybCA9IGlbM10uaW5jbHVkZXMoJyMnKSA/IGlbM10uc3BsaXQoJyMnKSA6IFtpWzNdXSxcXG4gICAgICAgICAgICBoZWFkZXJzID0gW107XFxuICAgICAgICBpZiAoIXVybFt1cmwubGVuZ3RoIC0gMV0pIHVybC5wb3AoKTtcXG4gICAgICAgIHVybC5mb3JFYWNoKCh2LCBpbmRleCwgYXJyYXkpID0+IHtcXG4gICAgICAgICAgICBpZiAoLztcXFxceyguKilcXFxcfS8udGVzdCh2KSkge1xcbiAgICAgICAgICAgICAgICBsZXQgb2JqID0ge30sXFxuICAgICAgICAgICAgICAgICAgICBjb24gPSB2Lm1hdGNoKC87XFxcXHsoLiopXFxcXH0vKVsxXSxcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IGNvbi5zcGxpdCgnJiYnKTtcXG4gICAgICAgICAgICAgICAgYXJyLmZvckVhY2goKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBba2V5LCB2YWx1ZV0gPSBpLnNwbGl0KCdAJyk7XFxuICAgICAgICAgICAgICAgICAgICBvYmpba2V5XSA9IHZhbHVlLnJlcGxhY2UoLzsvZywgJ++8m++8mycpO1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBhcnJheVtpbmRleF0gPSB2Lm1hdGNoKC9eKFteO10qKTtcXFxcey8pWzFdXFxuICAgICAgICAgICAgICAgIGhlYWRlcnMucHVzaChvYmopO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IE1PQklMRV9VQS5yZXBsYWNlKC87L2csICfvvJvvvJsnKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKGFycmF5W2luZGV4XS5pbmNsdWRlcyhcXFwiLnBocD9pZD1cXFwiKSkge1xcbiAgICAgICAgICAgICAgICBhcnJheVtpbmRleF0gPSBcXFwidmlkZW86Ly9cXFwiICsgYXJyYXlbaW5kZXhdXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgYXJyYXlbaW5kZXhdID0gYXJyYXlbaW5kZXhdLnJlcGxhY2UoLzsvZywgJ++8m++8mycpICsgJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGlmIChpdGVtc1tncm91cF0pIHtcXG4gICAgICAgICAgICBpZiAoaXRlbXNbZ3JvdXBdW3RpdGxlXSkge1xcbiAgICAgICAgICAgICAgICBpdGVtc1tncm91cF1bdGl0bGVdLnVybCA9IGl0ZW1zW2dyb3VwXVt0aXRsZV0udXJsLmNvbmNhdCh1cmwpO1xcbiAgICAgICAgICAgICAgICBpdGVtc1tncm91cF1bdGl0bGVdLmhlYWRlcnMgPSBpdGVtc1tncm91cF1bdGl0bGVdLmhlYWRlcnMuY29uY2F0KGhlYWRlcnMpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zW2dyb3VwXVt0aXRsZV0gPSB7XFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnNcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGl0ZW1zW2dyb3VwXSA9IHt9O1xcbiAgICAgICAgICAgIGl0ZW1zW2dyb3VwXVt0aXRsZV0gPSB7XFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzXFxuICAgIC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nYAnKS5pbnB1dCgocnVsZSkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LiN6IO95Li656m6XFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IDAgJiYgaW5wdXQuaW5kZXhPZihcXFwiZmlsZVxcXCIpICE9IDAgJiYgaW5wdXQuaW5kZXhPZihcXFwiaGlrZXJcXFwiKSAhPSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/mnInor69cXFwiXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoJycsIFxcXCLor7fovpPlhaXorqLpmIXmoIfpophcXFwiKS5pbnB1dCgodXJsLCBydWxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZz9ydWxlPVxcXCIgKyBydWxlKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAg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+36L6T5YWl55u05pKt5rqQ5ZCN56ewJykuaW5wdXQoKHJ1bGUpID0+IHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S4jeiDveS4uuepulxcXCJcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImZpbGVTZWxlY3Q6Ly9cXFwiICsgJC50b1N0cmluZygobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHMgPSBpbnB1dC5zcGxpdChcXFwiL1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvbGl2ZS9cXFwiICsgbmFtZSArIFxcXCIubTN1XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGMgPSBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9cXFwiICsgc1tzLmxlbmd0aCAtIDFdKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFjLmluY2x1ZGVzKCdodHRwJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6Z2e5rOV5paH5Lu2J1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKHVybCwgYylcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnP3J1bGU96IGa55u05pKtXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmRhdGEucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7Lkv53lrZgnXFxuICAgICAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGdldENvbG9yZWRUZXh0KFxcXCLliIbkuqvorqLpmIVcXFwiKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICB1cmw6ICQoW1xcXCLljp/lp4vmlbDmja5cXFwiLCBcXFwi5LqR5Ymq6LS05p2/XFxcIiwgXFxcIuS6keWPo+S7pFxcXCJdLCAzKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIHJldHVybiAkKCfnoa7lrprlr7zlh7rvvJ9cXFxcbijnpoHnlKjorqLpmIXkuI3kvJrlr7zlh7opJykuY29uZmlybSgodHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1xcXCIpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhID0gY29uZmlnLmRhdGEuZmlsdGVyKHYgPT4gIXYuaW5WaXNpYmxlKTtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT0gXFxcIuS6keWJqui0tOadv1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gJ+iBmuebtOaSreWIhuS6qyMjXFxcXG4nICsgc2hhcmVQYXN0ZShKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09IFxcXCLkupHlj6Pku6RcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YSA9ICfogZrnm7Tmkq3liIbkuqss5aSN5Yi25ZCO5omT5byA6L2v5Lu25Y2z5Y+v5a+85YWlXFxcXG4nICsgc2hhcmVQYXN0ZShKU09OLnN0cmluZ2lmeShjb25maWcpKSArICdAaW1wb3J0PWpzOmV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL2Nsb3VkP3J1bGU96IGa55u05pKtXFxcIikpLnJ1bGUpJztcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gSlNPTi5zdHJpbmdpZnkoY29uZmlnKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgZGF0YTtcXG4gICAgICAgICAgICB9LCBpbnB1dClcXG4gICAgICAgIH0pXFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGdldENvbG9yZWRUZXh0KFxcXCLnvJbovpHlhajpg6hcXFwiKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJlZGl0RmlsZTovL2hpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCJcXG4gICAgfSk7XFxuXFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICB9KTtcXG5cXG4gICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICBsZXQgZWRpdE1vZGUgPSBnZXRNeVZhcignZWRpdE1vZGUnLCAn5ZCv55So56aB55SoJyk7XFxuICAgIFsn5ZCv55So56aB55SoJywgJ+WIoOmZpOiuoumYhScsICfph43mlrDmjpLluo8nLCAn57yW6L6R6K6i6ZiFJywgJ+a4hemZpOe8k+WtmCddLmZvckVhY2goKHYpID0+IHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHYgPT0gZWRpdE1vZGUgPyAn4oCc4oCc4oCd4oCdJyArIHYuYm9sZCgpLmZvbnRjb2xvcignIzE5Qjg5RCcpIDogdixcXG4gICAgICAgICAgICB1cmw6IHYgPT0gZWRpdE1vZGUgPyAnaGlrZXI6Ly9lbXB0eScgOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh2KSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdlZGl0TW9kZScsIHYpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgdiksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSlcXG4gICAgfSk7XFxuICAgIGNvbmZpZy5kYXRhLmZvckVhY2goKHYsIGkpID0+IHtcXG4gICAgICAgIGxldCBlbCA9IHtcXG4gICAgICAgICAgICB0aXRsZTogdi5uYW1lLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIlxcbiAgICAgICAgfVxcbiAgICAgICAgc3dpdGNoIChlZGl0TW9kZSkge1xcbiAgICAgICAgICAgIGNhc2UgJ+WQr+eUqOemgeeUqCc6XFxuICAgICAgICAgICAgICAgIGVsLnRpdGxlID0gKHYuaW5WaXNpYmxlID8gJ/CflLQgJyA6ICfwn5+iICcpICsgZWwudGl0bGVcXG4gICAgICAgICAgICAgICAgZWwudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhW2ldLmluVmlzaWJsZSA9ICFjb25maWcuZGF0YVtpXS5pblZpc2libGU7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgIGNhc2UgJ+WIoOmZpOiuoumYhSc6XFxuICAgICAgICAgICAgICAgIGVsLnVybCA9IFxcXCJjb25maXJtOi8v56Gu6K6k5Yig6Zmk4oCcXFxcIiArIHYubmFtZSArIFxcXCLigJ3orqLpmIXvvJ8uanM6XFxcIiArICQudG9TdHJpbmcoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gZ2V0Q29uZmlnKCk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcuZGF0YS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWIoOmZpFxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgY2FzZSAn6YeN5paw5o6S5bqPJzpcXG4gICAgICAgICAgICAgICAgbGV0IHNvcnRGbGFnID0gcGFyc2VJbnQoZ2V0TXlWYXIoJ3NvcnRGbGFnJywgJy0xJykpXFxuICAgICAgICAgICAgICAgIGVsLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UgyAgJyA6ICcnKSArIGVsLnRpdGxlXFxuICAgICAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXG4gICAgICAgICAgICAgICAgICAgIGVsLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mAieaLqeimgeenu+WKqOWIsOeahOS9jee9ridcXG4gICAgICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGVsLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9sZEluZGV4LCBuZXdJbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhLnNwbGljZShuZXdJbmRleCwgMCwgY29uZmlnLmRhdGEuc3BsaWNlKG9sZEluZGV4LCAxKVswXSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsICctMScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgfSwgc29ydEZsYWcsIGkpXFxuICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgY2FzZSAn57yW6L6R6K6i6ZiFJzpcXG4gICAgICAgICAgICAgICAgbGV0IGFyciA9IFsn57yW6L6R5ZCN56ewJywgJ+e8lui+keWcsOWdgCcsICfnvJbovpHlhoXlrrknXTtcXG4gICAgICAgICAgICAgICAgZWwudXJsID0gJChhcnIsIDMpLnNlbGVjdCgodiwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09ICfnvJbovpHlkI3np7AnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQodi5uYW1lLCAn6L6T5YWl5paw5ZCN56ewJykuaW5wdXQoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFwiKSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IGdldENvbmZpZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhW2ldLm5hbWUgPSBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2xpdmUvY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kuI3og73kuLrnqbonXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gJ+e8lui+keWcsOWdgCcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh2LnVybCwgJ+i+k+WFpeaWsOWcsOWdgCcpLmlucHV0KChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIikpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LiN6IO95Li656m6XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluZGV4T2YoXFxcImh0dHBcXFwiKSAhPSAwICYmIGlucHV0LmluZGV4T2YoXFxcImZpbGVcXFwiKSAhPSAwICYmIGlucHV0LmluZGV4T2YoXFxcImhpa2VyXFxcIikgIT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+acieivr1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhW2ldLnVybCA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09ICfnvJbovpHlhoXlrrknKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHYudXJsLnN0YXJ0c1dpdGgoJ2ZpbGU6Ly8nKSB8fCB2LnVybC5zdGFydHNXaXRoKCdoaWtlcjovL2ZpbGVzJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdlZGl0RmlsZTovLycgKyB2LnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdlZGl0RmlsZTovL2hpa2VyOi8vZmlsZXMvbGlicy8nICsgbWQ1KHYudXJsKSArICcuanMnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHYsIGkpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICfmuIXpmaTnvJPlrZgnOlxcbiAgICAgICAgICAgICAgICBlbC51cmwgPSAkKCfnoa7lrprmuIXpmaTigJwnICsgdi5uYW1lICsgJ+KAneiuoumYhee8k+WtmO+8n1xcXFxuKOWPr+eri+WNs+abtOaWsCknKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUNhY2hlKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5riF6Zmk5oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICB9LCB2LnVybClcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBkLnB1c2goZWwpXFxuICAgIH0pO1xcbiAgICByZXR1cm4gZDtcXG59XFxuXFxuJC5leHBvcnRzID0ge1xcbiAgICByZW5kZXJTZXR0aW5nOiByZW5kZXJTZXR0aW5nXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5LqR5Y+j5LukXCIsXCJwYXRoXCI6XCJjbG91ZFwiLFwicnVsZVwiOlwiZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vcGFnZS9iYXR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